how do you backup your virtual machines in HYPER-V ?

T

troyquigley

Guest
i am using hyper-v and i am looking for ways to backup the virtual machine.

i know i could just shutdown the virtual server and copy the files, but obviously that is not a good option with a server (lol).

can i just copy the 6 files WHILE the virtual server is running via XCOPY or robocopy ?

i am wanting to copy/backup to an esata drive (that way i can swap 1tb drives when they get to 75% capacity)

not looking to use san, nas, or tape.

any ideas ?

can u use the "windows server backup" feature, and if so, do you install it on the host or guest ?
 
Last edited by a moderator:
On hyper-v i just run Windows Server Backup on the host in the middle of the night to a secondary array. It uses the VSS service to copy the VHDs over.

Seems to work pretty good I did a restore from backup a few months ago and everything was good.
 
can't i just do an xcopy of the files ? (vhd, xml)
When you perform a backup of the virtual machines, you must back up all volumes that host files for the virtual machine, including the InitialStore.xml file (in C:\ProgramData\Microsoft\Windows\Hyper-V, by default) and the volume(s) containing the VHD(s) and configuration XML files.


trying to keep it simple.

or does windows server backup do something better ?

i was able to copy the VHD file while the virtual machine was running.
 
can't i just do an xcopy of the files ? (vhd, xml)

Yes, as long as you shut the VM down and leave it down during the file copies.

Its fairly easy to script doing so using vbscript.

I just use the built-in backup and leave them running myself.
 
does anyone know of a way to use VSS via command line, and copy the files to external hdd ? so i can leave the virtual machine up and running and be able to copy the files, and make my own backup.

so i can copy the files i want to backup without having to use windows server backup. i am trying to avoid it, if i can.
 
Although it is recommended to backup the host and use the VSS for backing up the guests, it's not ideal. You can't restore individual guests with that method. The easiest way is to use the Windows Backup role on each of the individual guest machines, and back them up like you would any server. That way you can restore the machine just like any other server (read how to restore a VM from a windows backup, it's easy).

Either that or you can do your method and copy the VHD. I have seen scripts that can do this automatically, you just load the script as a task and set it to run at a certain time, but I believe the VM has to shut down during the process. You can restore a VM using just the VHD, but you will have to configure the machine hardware again (make a new VM, and point it to the old VHD).
 
Back
Top