Backing up a VM with multiple vhds attached

Hi all,

Is it possible to backup just the system .vhd of a VM that has multiple .vhds attached. We have some VMs that have multiple .vhds associated with them that are storing data and I would like to backup the VM, but only the system .vhd. Is it possible via PowerShell?

July 27th, 2012 6:24pm


I have not tested this, but in theory this should work.  Try it on a test VM before implementing it on a production VM including some test restores. 

On the protected hyper-v servers:

Under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToBackup
Add a Multi_SZ string and include the files to exclude - VSV, bin and the vhd file you want to exclude.

Add another reg key to enable this exclusion:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Data Protection Manager\Agent\HonorFilesNotToBackup

let me know the results... 

Free Windows Admin Tool Kit Click here and download it now
July 27th, 2012 11:41pm


Would this avoid creating the snapshot of the disk where the excluded VHD is in?   My hardware VSS provider is slow, specially creating the snapshot for the second disk. This maybe a way to speedup the backup


September 21st, 2012 1:09pm


FYI I dit try this and it works, only one thing to notice, when I add the VM to the protection group I have to disconnect VHD that I don't want to save from the VM, or it assign replica space for all VHD of the VM (and you cannot configure it to be lower thant the actuel size of all VHD), then after the protection group is created I can reconnect the different VHD.


Free Windows Admin Tool Kit Click here and download it now
November 15th, 2012 4:36pm

Have you tested restoring the VM from the backup that only includes the system VHD?  We are suspicious that while backups are working we may fail during recovery because the additional VHD that is added after the protection group configuration might be required.

November 15th, 2012 8:06pm


I did test a backup/restore of one VM (with one system VHD and one data VHD) on the the original host (after deleting all the VHD of or not) and all was fine. No error regarding missing VHD when lauching restore or at the end of the restore.

- When I don't delete the data VHD before restoring, I just have to restart the VM after restore.

- If I did delete the two VHD before restoring, then I must recreate the data VHD in the setting of the VM as it cannot restart without it.


Free Windows Admin Tool Kit Click here and download it now
November 16th, 2012 8:04pm


I just tried this in DPM2012 with no luck, are you able to add some step by step instructions including any restarts of services etc. 

IF you can add an example of the registry keys you set that would be great aswell.



December 11th, 2012 2:31pm


Here are the steps I did follow :

1) Put the VM offline, and disconnect the VHDs you don't want to save (so that you won't allocate useless replica space when you create the protection group)
2) Start the VM
3) Create the protection group
4) On each of the hyper-v cluster node (or on your hyper-v host if not on cluster) add this two keys :
a) In the existing HKLM\System\CurrentControlSet\Control\BackupRestore\FilesNotToBackup\ add a multi-string key with the name you want (here SQL Data VHD), and add one VHD per line :

b) create the following empty key HonorFilesNotToBackup in HKLM\Software\Microsoft\Microsoft Data Protection Manager\Agent

5) You can now reconnect the different VHD to your VM and let the backup run as scheduled. It won't backup the VHD that are in the above list.


Free Windows Admin Tool Kit Click here and download it now
December 11th, 2012 3:46pm


For step 1) you can avoid to shutdown your VM and disconnect VHD by asking DPM to create your replica manually.

Once your Protection Group is created (Manual replica creation pending):

  1. Retrieve replica path throw DPM GUI (Select your PG then Details: Replica path / Click to view details)
  2. Open Windows Disk manager (Or use Diskpart), retrieve Replica volume using Replica path, then Shrink volume according to your goal.
  3. Perform consistency check on your Protection Group to "create" your PG.


December 11th, 2012 4:51pm

Hi Michael Is there any plans that you know of where by Microsoft will include the ability to exclude specific VHD's from a DPM Child partition backup? We have dedicated volumes for OS , Page file and data for most of our 150+ VM's and it is ridiculous that I need to backup the page file vhd for every single one of them Thanks John.
Free Windows Admin Tool Kit Click here and download it now
January 9th, 2013 12:54am


Yes, that is a NEW feature added to DPM 2012 Sp1 - you can exclude page file .vhd from the backup.

New DPM 2012 Sp1 features

         DPM has efficient and end to end data protection solution for private cloud deployment with true block level change tracking and protection.
o   Hyper-V standalone with local storage as well as with Windows Remote SMB storage
o   Hyper-V CSV clusters with Clustered SAN storage as well as with Windows Remote SMB storage
o    Uninterrupted data protection upon live migration in any of the above scenarios
o   Protecting big clusters like 64 node clusters can be achieved by using multiple DPM servers
o   Backup storage savings by not backing up pagefile/temp storage as configured by customer

January 9th, 2013 1:35am

Hi Mike

Thanks for the reply.

Please can you clarify the following:

  • Will DPM 2012 SP1 allow me to exclude any VHD file from any child partition backup from a VM which resides on a HyperV R2 / 2012 Cluster?
  • If the above point is true is this option available within the DPM GUI? (do you have a screenshot :) )

Many Thanks


Free Windows Admin Tool Kit Click here and download it now
January 9th, 2013 1:29pm


Ok, the solution is not as eloquent as I had thought, but here we go, this can apply to any .vhd, not just page file, but it doesn't prevent doing the initial backup, just future changes, so this is probably not what you are looking for.

Exclude page file churns

To improve the performance of your Hyper-V backups, choose the option not to back up the entire churn in your pagefile. This gives you the benefit of reduced storage requirement and improvement in backup performance. Excluding pagefiles, DPM does not affect replica creation and consistency check. The only change is that when the pagefile is excluded, DPM does not perform incremental backups on the pagefile. To exclude pagefiles, perform the following procedure:
1. Move the pagefile for a virtual machine to a different VHD.
2. Exclude pagefiles by using the Set-DPMGlobalProperty cmdlet. For more information about how to use this cmdlet, see Set-DPMGlobalProperty.

Names of pagefile VHDs that should be excluded from backup jobs for HyperV data source. Supports use of wildcards. Use commas to separate multiple VHD names.
Aliases none
Required? true
Position? named
Default Value none
Accept Pipeline Input? false
Accept Wildcard Characters? false
To exclude some page file VHDs
In this example, all VHDs protected on TestingServer that have names that end with _pagefile.vhd are marked for exclusion.

PS C:\> SetDPMGlobalProperty -DPMServerName TestingServer -HyperVPagefileExclusions "*_pagefile.vhd"
To add more page file VHD exclusions
In this example, VHD files that have mypgf in their name are added to the existing exclusion list.

PS C:\> SetDPMGlobalProperty -DPMServerName <DpmServer> -HyperVPagefileExclusions "*_pagefile.vhd,*mypgf*.vhd*"
To remove all page file VHD exclusions
In this example, all existing exclusions are removed.

PS C:\> SetDPMGlobalProperty -DPMServerName <DpmServer> -HyperVPagefileExclusions ""

January 9th, 2013 7:32pm

Hi Mike Thanks for the info and you are right it wasnt quite what I had in mind. Is it me or does it not seem like madness not to have an option to exclude specific VHD's from a DPM backup? Do you know if there are any technical reasons not to include this or are there any plans for the future to include this? - I cant be the only one thinking this option is needed and surely it cant be that difficult to implement? Many Thanks John.
Free Windows Admin Tool Kit Click here and download it now
January 9th, 2013 11:13pm

iSCSI LUN's and Pass-Through disks are ignored by DPM in VM's.

I have used this trick in the past, it works.

However pass-through disks are not recommended by many, maybe the new virtual fibre channel feature is something to look at.

June 27th, 2013 12:03am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics