none
Backing up a VM with multiple vhds attached RRS feed

  • Question

  • 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?

    Friday, July 27, 2012 3:24 PM

All replies

  • Hi,

    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... 


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    • Proposed as answer by Julien Momier Thursday, November 15, 2012 1:37 PM
    Friday, July 27, 2012 8:41 PM
    Moderator
  • Hello!

    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

    Thanks!

    Friday, September 21, 2012 10:09 AM
  • Hello,

    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.

    Regards

    Thursday, November 15, 2012 1:36 PM
  • 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.


    -------------------------------------------------------------------------------- Regards, Michael V [MSFT] - This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, November 15, 2012 5:06 PM
    Moderator
  • Hello,

    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.

    Regards

    Friday, November 16, 2012 5:04 PM
  • Hi, 

    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.

    thanks

    steve 

    Tuesday, December 11, 2012 11:31 AM
  • Hello,

    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.

    Regards
    Julien

    Tuesday, December 11, 2012 12:46 PM
  • Hi,

    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.

    Stephane


    Please remember to click “Mark as Answer” on the post that helps you. This posting is provided "AS IS" with no warranties. knowledge is valid only if it is shared by All.

    My DPM blog Yet Another DPM Blog

    Tuesday, December 11, 2012 1:51 PM
  • 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.
    Tuesday, January 8, 2013 9:54 PM
  • Hi,

    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


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, January 8, 2013 10:35 PM
    Moderator
  • 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

    John.

    Wednesday, January 9, 2013 10:29 AM
  • Hi,

    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.  

    http://technet.microsoft.com/en-us/library/jj721498.aspx

    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.

    http://technet.microsoft.com/en-us/library/hh881752.aspx

    -HyperVPagefileExclusions<String>
    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.

    Copy
    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.

    Copy
    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.

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


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, January 9, 2013 4:32 PM
    Moderator
  • Hi Mike Thanks for the info and you are right it wasn’t 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.
    Wednesday, January 9, 2013 8:13 PM
  • 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.

    • Proposed as answer by AnguelS Wednesday, March 19, 2014 2:26 PM
    Wednesday, June 26, 2013 9:03 PM
  • Great proposal to use pass-through disks to store data that we don't want / need to backup.
    Wednesday, March 19, 2014 2:28 PM
  • I agree with everyone else, we need this added as a feature. If you have an agent on the VM to take care of the data you don't want to also be doing the VHD. I use to have pass-through, but have converted all to VHD now for Hyper-V replication, and some of my servers have many 1-2TB VHDs that are backed up via agent and I need these excluded from the Hyper-V backup.

    I have tested what is described here and it seems to work. I guess the only negative is that you to create a large replica volume and then shrink it (could be a problem if you didn't have 5TB etc of free space).

    So summarising what others have said.

    On the Hyper-V host(s) with RegEdit add HKLM\System\CurrentControlSet\Control\BackupRestore\FilesNotToBackup\[Server-VM-Name] (multi-string) and add a line with the path to each VHD you wish to exclude.

    Create the following empty key HonorFilesNotToBackup in HKLM\Software\Microsoft\Microsoft Data Protection Manager\Agent

    Then I modified the protection group and added the server, selected the smallest size I could, and told it to synchronize later (eg 30min in the future).

    Copy Replica Path to Notepad and it will look like

    E:\ on svrvirt-sp.wyong.nsw.gov.au
    c:\Program Files\Microsoft System Center 2012 R2\DPM\DPM\Volumes\Replica\Microsoft Hyper-V VSS Writer\vol_09a0d4e5-9574-444f-9692-f7f6914fa7d3\d753ec7b-28cf-4d87-93fc-f8076ab30720\Full\E-Vol\

    So the volume I needed was c:\Program Files\Microsoft System Center 2012 R2\DPM\DPM\Volumes\Replica\Microsoft Hyper-V VSS Writer\vol_09a0d4e5-9574-444f-9692-f7f6914fa7d3

    DiskPart (too confusing in Disk Management)

    Sel Vol "[volume]"

    Detail Volume (confirm it is the size you expect)

    Shrink QueryMax (should be able to recover lots)

    Shrink Desired=XXX (in MB - the amount to shrink)

    Detail Volume (confirm it is the size you require)

    I went into Recovery and confirmed that only the OS VHD was available.

    BTW Why are people creating separate VHDs for the page file ?

    Thursday, April 3, 2014 10:19 PM