disk exclusion - Hyper-v

Rajeswaran Sundarsingh 60 Reputation points
2025-03-18T16:51:05.56+00:00

Hello All,

Is it possible to exclude a particular disk from VM snap backup (Hyper-V) in DPM ? Because D:\ from server RMSXXX1 has agent backup. So, we want to exclude disk D:\ from Hyper-V snap backup.

if there is a possibility, could you please let me know the steps.

Thank you.

Best regards,

Rajes

Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
1,490 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Pranay Reddy Madireddy 6,180 Reputation points Microsoft External Staff Moderator
    2025-03-19T16:28:25.74+00:00

    Hi Rajeswaran Sundarsingh

    Yes, it is possible to exclude a specific disk from the Hyper-V VM backup when using Data Protection Manager (DPM). To do so, you can follow these steps:

    1.Stop the DPMRA service: Before performing the exclusion, ensure that there are no jobs in progress and stop the DPMRA (Data Protection Manager Remote Agent) service on the DPM server. This step is essential to avoid any conflicts during the process.
    https://learn.microsoft.com/en-us/system-center/dpm/back-up-vmware?view=sc-dpm-2025&tabs=Add#exclude-disk-from-vmware-vm-backup

    https://learn.microsoft.com/en-us/azure/site-recovery/hyper-v-exclude-disk#exclude-disks

    2.Run the exclusion command: Use the following PowerShell command to exclude the disk from the VM backup:

    ./ExcludeDisk.ps1 -Datasource $vmDsInfo[0] -Add "[Datastore] vmdk/vmdk.vmdk"
    

    Replace [Datastore] vmdk/vmdk.vmdk with the actual path of the disk you want to exclude. For example, if you want to exclude the disk D: from the server RMSXXX1, the command will look like:

    ./ExcludeDisk.ps1 -Datasource $vmDsInfo[0] -Add "[datastore1] RMSXXX1/DiskD.vmdk"
    

    3.Verify exclusion: To confirm that the disk has been successfully excluded, you can run the following command to view the current exclusion list:

    ./ExcludeDisk.ps1 -Datasource $vmDsInfo[0] -view
    

    4.Remove exclusion (if necessary): If you ever need to remove the disk from the exclusion list, you can run the following command:

    ./ExcludeDisk.ps1 -Datasource $vmDsInfo[2] -Remove "[datastore1] RMSXXX1/DiskD.vmdk"
    

    5.Perform a consistency check: After excluding the disk, it is recommended to run a consistency check manually to ensure everything is in a consistent state.

    let us know if any help, we will always help as you needed.!


    Please do not forget to "Accept the answer” and upvote it wherever the information provided helps you, this can be beneficial to other community members.it would be greatly appreciated and helpful to others.


  2. Amardeep Saini 1,735 Reputation points Microsoft Employee
    2025-03-28T09:09:16.5733333+00:00

    Thank you for contacting us on Microsoft Q&A platform. Happy to help!

    This is to inform you that currently exclusion disk is only available on VMware VMs and not on Hyper-V VM yet.

    https://learn.microsoft.com/en-us/system-center/dpm/back-up-vmware?view=sc-dpm-2025&tabs=Add#exclude-disk-from-vmware-vm-backup

    The PowerShell script which you are using above is designed for VMware VM due to which it is not working for Hyper-V VM and giving you the error.

    There is a workaround which you could use to exclude the Hyper-V Disk for your incremental backups. But that disk will be backed up when performing the Full Backup(Intial Replica) and Consistency Check for that VM.

    You can use below mentioned command to exclude a specific disk from incremental backup only.

    Set-DPMGlobalProperty -DPMServerName DPM -HyperVPagefileExclusions "DiskName.vhdx"

    Please run the below command to make sure the disk is listed which you want to exclude.

    Get-DPMGlobalProperty -PropertyName HyperVPagefileExclusions

    Please find how it worked in my lab:

    I have a Hyper-V VM with three disks.

    User's image

    From DPM PoweShell I set this:

    Set-DPMGlobalProperty -DPMServerName DPM2016MBS -HyperVPagefileExclusions "Data*.vhdx"

    Then I checked the status by this way:

    Get-DPMGlobalProperty -PropertyName HyperVPagefileExclusions

    Result: Data*.vhdx

    With this I will exclude all the VHDs with name DataXXX.VHDX from the backup. Keep in mind that the initial backup will contain all the data. The next backup will not.

    From logs perspective I see the DPM honor this:

    From MSDPM / DPM log:

    NORMAL Adding PolicyExclusion for ?\Volume{713B9566-8A2F-4AE6-A628-07A58C0FD0CC}, Specification = Data*.vhdx, IsRecursive = True

    Hyper-V DPMRA Logs

    NORMAL Exclusion rule for F:\HyperV_Disks\Data_Disk.vhdx is set to 1

    NORMAL Exclusion rule for F:\HyperV_Disks\Data_test.vhdx is set to 1

    Going to the recovery tab, I still see the VHDs, which is normal since we will contain the data on the initial / first backup:

    But if I drill down to the disks which are excluded then I do not have the new folders which got added\created after the full backup. Which is great, it means this is working as expected.

    You can follow this workaround if you want to exclude any specific disk from Hyper-V Backup.

    Currently Azure Backup Product Group is still working on this feature, and it will be released in future update of MABS.

    ** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful **

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.