Tuesday, March 27, 2012

Is it possible the following scenario - Physical server 2008 VHD backup file, created by wbadmin.exe to run in Hyper-V server?

Is it possible the following scenario - Physical server 2008 VHD backup file, created by wbadmin.exe to run in Hyper-V server?
 
One of our physical web servers is running Windows Server 2008 Standard x64, and is being backuped daily by default backup utility for server 2008 (wbadmin.exe).
I am curiuous is it possible to restore this VHD backup file into Hyper-V server (said in other way to create new VM using that VHD image).
If it's possible - what are the steps to successfully do this?
Nope, won't work.
But, this will:
- Prepare a fresh VM with the same OS.
- Shut down the VM and mount the VHD file on another VM
- Mount the "backup" VHD you'd like to restore from the same VM
- Use robocopy /purge /b /e /copyall to take all the data from the backup vhd to the new VHD
After this, shut down the VM, and you should be able to create a new VM using the destination VHD file. It will boot - all you have to do is install integration services.
Now for some more "magic":
You can use vshadow.exe to create a VSS snapshot of a running physical OR virtual machine and expose it to a drive letter (yes, boot drive also), and use the robocopy trick above to perform P2Vs or V2Vs. What's good about this method is that you can do a first pass with the machine still servicing requests, then stop all critical services and do another pass to complete the process. Typically takes about 2-3 minutes, depending on how much data has changed. Robocopy will only copy files which are different, and also copies NTFS permissions.
 
Note:
 
1) You may need to use DriverInjection (http://www.911cd.net/forums//index.php?showtopic=22523&st=0) or something similar if the standard IDE driver is not present on the source.
2) You may have to edit boot.ini to point to partition 1 - some system manufacturers have a utility partition as #1.
Otherwise you should be good to go.
 
References:
 
How to configure WSB with the support for Hyper-V VSS writer.

Windows 2008 Hyper-V and Windows 2008 Backup

Windows 2008 (or R2) comes with Wondows backup application. It uses Microsoft volume snapshot technology to snapshot volume and copy the configuration and Data in *.vhd format, that is used for Microsoft Hyper-V server, to local attached storage or network storage. For quick data volume recovery, you just mount the *.vhd file to any Hyper-V server and you are done. You don't need any restore time you may need for the traditional tape backup to speed up SLA. If you need to recover systems, you will have to install Windows via CD or image and choose system recovery option during setup and specify where is system volume backup file is located, local media, UNC path, etc. since Microsoft doesn't support to make backup image *.vhd bootable.
 
You use wbadmin command to schedule backup job and restore.
 
You can run Wbadmin by following these steps:
1. Click Start, click All Programs, and then click Accessories to open the Accessories menu.
2. Start an elevated command prompt by right-clicking Command Prompt and then selecting Run As Administrator.
3. In the Command Prompt window, enter the necessary command text or run a script that invokes Wbadmin.

Wbadmin has a number of associated commands:
DELETE SYSTEMSTATEBACKUP Deletes the system state backup or backups from a specified location.
DISABLE BACKUP Disables scheduled daily backups so that they no longer run.
ENABLE BACKUP Enables or modifies a scheduled daily backup.
GET DISKS Lists the disks that are currently online for the local computer. Disks are listed by manufacturer name, type, disk number, GUID, total space, used space, and associated volumes. GET ITEMS Lists items contained in a specified backup.
GET STATUS Reports the status of the currently running backup or recovery job.
GET VERSIONS List details about the available backups stored in a specific location, including the backup time and backup destination.
START BACKUP Starts a one-time backup using the specified parameters. If no parameters are passed and scheduled backups are enabled, the backup uses the settings for scheduled backups.
START RECOVERY Initiates a recovery of volumes, applications, or files using the specified parameters.
START SYSTEMSTATEBACKUP Starts a system state backup using the options specified.
START SYSTEMSTATERECOVERY Starts a system state recovery using the specified parameters.
STOP JOB Stops the currently running backup or recovery job. Stopped jobs cannot be restarted from where they were stopped.

When you are working with Wbadmin, you can get help on available commands:
1.To view a list of management commands, type wbadmin /? at the command prompt.
2.To view the syntax for a specific management command, type wbadmin Command /?, where Command is the name of the management command you want to examine, such as wbadmin stop job /?.

When you work with Wbadmin, you'll find that just about every command accepts parameters and specific parameter values that qualify what you want to work with. To see more clearly how this works, consider the following syntax example:
wbadmin get versions [-backupTarget:{VolumeName | NetworkSharePath}] [-machine:BackupMachineName] 
The brackets tell you that –backupTarget and –machine are optional. Thus, you could type the following to get information on recoverable backups on the local computer:
wbadmin get versions 
You could type the following to get information on recoverable backups for C:
wbadmin get versions -backuptarget:f: 
Or you could type the following to get information on recoverable backups for C on Server88:
wbadmin get versions -backuptarget:f: -machine:server88 
Many Wbadmin commands use the –backupTarget and –machine parameters. The backup target is the storage location you want to work with, and can be expressed as a local volume name (such as F:) or as a network share path, such as \\FileServer32\backups\Server85. The –machine parameter identifies the computer you want to work with for backup or recovery operations.