Backup Hyper-V Virtual Machines with Pass-Through Disks

 Thanks to: https://www.doitfixit.com/


We cannot backup Hyper-V Virtual Machines with pass-through virtual disks due to Hyper-V checkpoints limitation. Backup software will stop processing the backup job with “Processing VMs with pass-through disks is not supported” or similar error.

Error Processing VMs with pass-through disks is not supported

To fix this issue (We are going to backup the Virtual Machine without pass-through disks) we can use pre/post scripts option in backup softwares. What we do here is when the backup starts we remove the pass-through disks and once the backup job is completed we re-attach the disks to the virtual machine.

Pre-Script:
Remove-VMHardDiskDrive -VMName <VirtualMachineName> -Passthru -ControllerType SCSI -ControllerNumber <ID> -ControllerLocation <ID>

Eg: Remove-VMHardDiskDrive -VMName VM01 -Passthru -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 0

Post-Script:
Add-VMHardDiskDrive -VMName <VirtualMachineName> -ControllerType SCSI -ControllerNumber <ID> -ControllerLocation <ID> -DiskNumber <ID>

Eg: Add-VMHardDiskDrive -VMName VM01 -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 0 -DiskNumber 3

You can get the DiskNumber from Hyper-V Virtual Machine settings.

Hyper-V Settings

Use a text editor such as Notepad and add the commands according to the backup job and save the files as .ps1 file format.

In my backup job there are two virtual machines and my scripts are configured as below.

Remove-Pass-through_Disks

Add-Pass-through_Disks

Once done edit your backup job and configure the pre/post script settings. Please see the below configuration settings on Veeam Backup and Replication.

Edit the Backup Job – Go to Storage > Advanced Settings

Veeam Backup and Replication Storage - Advanced Settings

Go to Scripts tab and set the scripts.

Veeam Backup and Replication Scripts

Veeam Backup and Replication PowerShell Scripts

Now your backup jobs will complete without any issue as when the backup job starts the script will remove the pass-through disks from the virtual machine and Hyper-V can take the snapshot without any issue.

Comentarios

Entradas populares de este blog

Guía de herramientas básicas para estudiantes: 31 apps y webs imprescindibles para ayudarte con los estudios

Comando FOR para archivos BAT

How to Fix Failed to Connect a Hyper-V Standalone to Veeam Backup