SBS 2008 Backup in Hyper-V Server R2

Windows SBS 2008 prefers to back up to a removable USB drive, which is a problem if your SBS is virtualized in Hyper-V, which doesn’t support USB. There are workarounds, such as FabulaTech’s USB over Network, which I’ve used, and like. But the current version (4.2) has issues, as I posted a few days ago. I expect them to resolve those, but in the meantime, here is a purely Microsoft solution – use Hyper-V R2’s new dynamic storage capabilities!

Dynamic storage? Yup. Hyper-V R2, whether as a role on Windows Server 2008 R2, or as the standalone Hyper-V Server R2, supports hot add and removal of VHDs. This gives us a way to indirectly support USB hard disks.

First, this only works with R2, so make sure you`re running the latest version of the Hyper-V Manager. You`ll need a Windows 7 or Server 2008 R2 machine with the Remote Server Administration Tools (RSAT) installed.

Next, make sure you`re VM has at least one SCSI adapter added to it. If you create a new VM in Hyper-V R2, this happens automatically, but if you created the VM in the original version of Hyper-V, it may not have a SCSI adapter. Before this will work, you must have a SCSI adapter added to the VM.

Now, plug in your USB hard disk, and format with NTFS from the host. (If you`re running Hyper-V Server R2, you may need to use diskpart.exe for this. ) Next, in the Hyper-V Manager, click on New, Hard->Hard Disk in the Action Menu to open the New Hard Disk Wizard.

image

Select Fixed Size, and click Next.

image

Point to the removable USB disk and supply a name for the VHD. Click Next and specify the size of the VHD. Make it essentially the full size of the USB disk.

image

Click Finish and the virtual hard disk will be built. This can take a while, be patient. Once the VHD has been built, you can add it to a running VM. Select the VM in Hyper-V Manager, and open the Settings for it.

Select the SCSI controller in the left pane, and Hard Disk in the right pane.

image

Click Add, and then enter the path to the VHD on your USB hard disk.

image

Click OK and the VHD is available in the SBS VM.

Now follow standard SBS steps to configure SBS Backup to use the virtual disk you just added. (For details on SBS Backup, see Windows Small Business Server 2008 Administrator’s Companion.)

You’ll need to add and remove disks using the Hyper-V Manager to avoid issues for the SBS Backup, or, alternately, you could write a PowerShell script using WMI to manage the process.

Charlie.

Published Thu, Nov 26 2009 10:11 by Charlie Russel

Comments

Friday, November 27, 2009 1:10 PM by Rosewood

# re: SBS 2008 Backup in Hyper-V Server R2

I'd like to know about this PowerSehll script. The nice thing about non virtualized SBS2008 is someone can just swap drives as needed.

Friday, November 27, 2009 1:52 PM by Alan

# re: SBS 2008 Backup in Hyper-V Server R2

Why not just publish the whole drive? that way you can recover files from that drive with out the need to mount the vhd.

That is what i am doing for my WHS backup. I just need to ensure its plugged in on boot else the machine will error because it cant find the drive.

Friday, November 27, 2009 3:02 PM by Charlie Russel

# re: SBS 2008 Backup in Hyper-V Server R2

"I just need to ensure it's plugged in..." - this is why you don't want to use passthrough disks for an SBS backup. You run into problems if you're removing a disk for remote site storage. Stick to using a VHD and you'll have fewer problems. WHS and a virtualized SBS are not the same thing.

Charlie.

Friday, November 27, 2009 3:04 PM by Charlie Russel

# re: SBS 2008 Backup in Hyper-V Server R2

I haven't written the PowerShell script, so you're welcome to have a go yourself. But it shouldn't be overly difficult, and you can also look at www.codeplex.com/PSHyperv for tools to help.

Charlie.

Sunday, December 20, 2009 1:15 AM by moshe raab

# re: SBS 2008 Backup in Hyper-V Server R2

I wrote a PS script that successfuly removes one drive and adds a second. (This is actualy the first script that i have written)

Unfortuanlty, the SBS2008 server does not see the new drive and requires a reboot in order to see the newly attached drive.

Have I left something out or done something wrong?

Import-Module "C:\Program Files\modules\HyperV\Hyperv.psd1"

$strComputer = "."

$BackupDriveV= "V:"

$BackupDriveW= "W:"

$BackupDriveVVHD= "V:\Virtual Backup Disk V.vhd"

$BackupDriveWVHD= "W:\Virtual Backup Disk W.vhd"

$Server = "Server SBS 2008"

write-host "Removing Drive: " $BackupDriveV

Remove-VMdrive $Server 0 0 -SCSI  

#Remove-VMdrive $Server 0 0 -SCSI -DiskOnly

write-host "Done!"

write-host "Removing Drive: " $BackupDriveW

Remove-VMdrive $Server 0 1 -SCSI  

#Remove-VMdrive $Server 0 1 -SCSI -DiskOnly

write-host "Done!"

$colItems = get-wmiobject -class "Win32_LogicalDisk" -namespace "root\CIMV2" `

-computername $strComputer

foreach ($objItem in $colItems) {

     write-host "Caption: " $objItem.Caption

     write-host "Name: " $objItem.Name

     write-host

 if ($objItem.DeviceID -eq $BackupDriveV)

 {

write-host "Adding VHD: " $BackupDriveVVHD

Add-VMDisk $Server 0 0 $BackupDriveVVHD -SCSI

 }

 elseif ($objItem.DeviceID -eq $BackupDriveW)

 {

write-host "Adding VHD: " $BackupDriveWVHD

Add-VMDisk $Server 0 1 $BackupDriveWVHD -SCSI

 }

}

Leave a Comment

(required) 
(required) 
(optional)
(required)