Hyper-V Program Manager
Last week I posted about how you can now use Windows Server Backup in Windows Server 2012 to backup virtual machines. One of the first questions that people had was “how do I do this from the command-line?” So – let me show you!
The tool you will want to use is “wbadmin.exe”
Backing up a virtual machine is fairly straight forward. Your command will look like this:
wbadmin start backup –backupTarget:<location to backup to> –hyperv:<list of virtual machines to backup>
Which will result in something like this:
Some things to be aware of:
Once you have created the backup – you then need to know how to restore it. This is, unfortunately, more complicated. The first thing you will need to do is to find the version of the backup and the name of the virtual machine you want to restor. You can find the version of the backup by running:
wbadmin get versions –backupTarget:<location where you backed up to>
If the backup was taken a while ago – you may have forgotten the name(s) of the virtual machines that you backed up. You can find this by running:
wbadmin get items –version:<version string for the backup you want> –backuptarget:<location where you backed up to>
Once you have this information you can restore the backed up virtual machine by running:
wbadmin start recover –version:<version string for the backup you want> –itemType:hyperv –items:<list of virtual machines to restore> –backuptarget:<location where you backed up to>
Excellent post, thanks for documenting this so simply :)
Is this backup completely independent of a Windows Server Backup scheduled through the GUI? I.e. if I already have scheduled host-level backups to external USB drives (these are incremental) will calling wbadmin command-line backup to a network share somehow interfere with those USB backups (e.g. confuse their incrementals) or is it completely independent and just allows me to do additional backups this way? Thanks.
Hi Ben, Thanks, good info.
Is there a way to delete a backup taken by wbadmin?
I have tried this but am not able to backup Hyper-V Vm's
Thanks for this simple offering. Saves time, heartache and money.
This is separate from any other backups you are doing - just double-check in Windows Server Backup UI and also in Task Scheduler, to make sure you still have your other jobs. Having said that, you definitely don't want to run more than one backup at the same time, generally speaking - so, coordinate the times of any other jobs you have, so they do not overlap with this one.
I had posted that I think Ben may be wrong about the comment "The virtual machine will only be put into a saved state if it is not running the latest virtual machine additions (or is not a Windows virtual machine)."
What it means - "saved state," is just that they are saying it is taking a "snapshot" of the system - Snapshot = "A saved state." So, it's not saying it puts the VM into a 'suspended state;' just that it takes a snapshot. Thanks.
DENNIS: What does "backing the Host Component" do?
Is that like a full image backup of the Host machine?
And then, how to restore it?
I try to backup a VM 2012 R2 (V2) from server 2012 R2 with the comand line:
C:\windows\system32>wbadmin start backup -backupTarget:d:\a179681\ -hyperV:t-carbet -vssFull -noVerify
and i have an erro message:
wbadmin 1.0 - Backup command-line tool
(C) Copyright 2013 Microsoft Corporation. All rights reserved.
Retrieving volume information...
Any virtual machines included in the backup will be temporarily placed into a
saved state when the backup runs.
This will back up HyperV\T-CARBET to \d:\backup\.
Do you want to start the backup operation?
[Y] Yes [N] No y
ERROR - The specified backup location could not be found or is not a
supported backup storage location.
But is working if I put: D:\ to Target
what is the problem
thank you for your help
Hello, Ben! Is it possible to do incremental backup for VMs?
Thanks for the post. What about when having a Hyper-V Cluster?
Ben, This is great info. Im wondering if I use wbadmin to do a server 2012 R2 Core baremetal backup using -allcritical will this backup the Hyperv host and all the VM's as well? In short Im looking to backup to an external USB drive and need the wbadmin command to do a baremetal of the Hyperv 2012 R2 host and the VM's can youhelp me with the command syntax? P.S. Im new to forums so hope I am asking in the correct area:-)