We're running Hyper-V on Windows Server 2008. I have a production environment VM for which I'm planning some major application upgrades. These upgrades are completely within the VM (not at the host level) and are not related to the OS.
I'd like to clone the production VM so I can test the upgrade procedure without affecting active users.
So my questions are:
- what's the easiest way to clone the production machine?
- When I do the actual upgrade, is a VM snapshot a good way to make a just-in-case backup? What does a snapshot not protect me from?
shut down the machine and export. To replicate the machine copy the export folder into your Hyper-V directory and import it. NB you can only import once, so import a copy!
yes.
JR
Re Michael's question: You can't export a machine without shutting it down first. You could snapshot it (e.g. www.drivesnapshot.de) and then restore the snapshot to a new machine with disks of the same size. However when you boot it the new VM will think the original network card(s) have been removed and replaced with new one(s). Not a big deal, but you'll be left with a ghost network card that's hard to remove, just as if you had fiddled with the network cards in a real PC.
I would shrug and shut down the PC to use an export. It takes only the time needed to make a copy of the hard disk file(s), which can be a while if they're big.
1) You can do as John described, if the OS is 2008, you can perform a server backup while the server is running, and do a complete bare metal restore on a new VM, depends on your needs, or use 3rd party imaging utilities.
Personally i would go with Johns, way of exporting the VM.
Regarding #2, snapshots are handy, but do note that they will start making differential disks, which keep on growing, instead of the primary vhd you specified on the creation of the VM.
When you delete snapshots, and the UI indicate they are gone, they are infact still being used in the background until you perform a complete shutdown of the VM itself, at which point the merge will happen.
This has bitten me in the butt several times, since you need the double free space that you current VM uses (Like VM is 100GB, you need a total of 100GB free to merge).
If it runs out of space it pauses the VM, while in the merge process.
Just be aware of how it works, they can be nice for quick snapshots while testing stuff, but do remember to delete them (and shutdown the VM to get them merged back into the main VHD file) after they served their purpose.
I agree with the above answer. Here is an additional article that provides a little more information.