I need to backup running Hyper-V virtual machines with minimal downtime via a command prompt. Backups should be stored on another local disk or remote share.
I need to backup running Hyper-V virtual machines with minimal downtime via a command prompt. Backups should be stored on another local disk or remote share.
Below are sample scripts used to backup Hyper-V using VSS to create a snapshot. Guest operating systems that do not support VSS will be put into a saved state during the snapshot period.
This sample backs up images located on the E:\VS directory to a local directory at F:\VS Backups. These locations will need to be adjusted to fit your needs. For each source drive, an additional volume will need to be added to the VSS snapshot.
Documentation on the diskshadow.exe command is available on Technet.
Copy each of these three files into a directory and run HyperVBackup.cmd.
HyperVBackup.cmd:
diskshadow_script.txt:
HyperVBackup_exec.cmd: