Exclude.vmdisk

The EXCLUDE.VMDISK option excludes a virtual machine disk from backup operations.

The EXCLUDE.VMDISK option specifies the label of a virtual machine's disk to be excluded from a backup vm operation. If you exclude a disk on the backup vm command, the command-line parameters override any EXCLUDE.VMDISK statements in the options file.
Windows operating systems

EXCLUDE.VMDISK for Microsoft Hyper-V virtual machines

Use the EXCLUDE.VMDISK option to exclude a virtual machine disk from Hyper-V RCT backup operations on Windows Server 2016 or later operating systems.

During a VM restore operation, an informational message is displayed to indicate that a VM disk is not restored because it was excluded during the backup operation. The restore operation also verifies whether the original disk file still exists in the restore destination folder. If the original disk file still exists, it is reconnected to the restored VM. Otherwise, an empty disk file is created with the same attributes (such as file name, disk size, and block size) and the empty disk file is connected to the restored VM.

After a restore operation, the controller and disk order in the restored VM remains the same as the original VM. You do not have to adjust the disk location in the EXCLUDE.VMDISK option for future backup operations of the restored VM.

However, if you remove a SCSI controller manually, all subsequent SCSI controllers' numbers are changed. For example, if you remove "SCSI 0", the next SCSI controller (previously "SCSI 1") becomes "SCSI 0". In this case, you must update the VM disk location in the EXCLUDE.VMDISK option.

The disk location information such as "SCSI 0 0" is displayed in messages for backup, restore, and query operations.

Supported clients

This option can be used with Windows Server 2016 or later clients.

Options file

Set this option in the client options file. Command-line parameters override statements in the options file.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-EXCLUDE.VMDISK--vmname-- -disk_location---------------------><

Parameters

vmname
Specifies the name of the VM that contains a disk that you want to exclude from a backup vm operation. The name is the virtual machine display name. You can specify only one VM name on each EXCLUDE.VMDISK statement. Specify additional EXCLUDE.VMDISK statements for each VM disk to exclude.
The VM name can contain an asterisk (*) to match any character string, and a question mark (?) to match any one character. If the VM name contains space characters, surround the name with quotation marks (" ").
Tip: If the VM name contains special characters, such as bracket characters ([) or (]), the VM name might not be correctly matched. If a VM name includes special characters, use a question mark (?) to represent the special characters.
For example, to exclude a SCSI virtual machine disk from the backup of a VM named "Windows VM3 [2012R2]", use this syntax in the options file:
EXCLUDE.VMDISK "Windows VM3 ?2012R2?" "SCSI 0 1"
disk_location
Specify the location of the virtual machine hard disk (VHDX) to exclude from a Hyper-V RCT backup operation. The disk location label must begin with "SCSI" or "IDE" followed by the controller number and device location number. Wildcard characters are not allowed.
Tip: Use the backup vm command with the -preview option to determine the location of disks in a given VM. See the "Backup VM" topic for the syntax.

Examples

Options file
Exclude the Windows system disk from all virtual machines that begin with WinVM in the following statement in the options file:
exclude.vmdisk WinVM* "IDE 0 0"
Virtual machine vm1 contains a virtual machine disk with IDE controller number 1 and device location 0. To exclude this virtual machine disk from backup vm operations, specify the following statement in the options file:
EXCLUDE.VMDISK vm1 "IDE 1 0"
Virtual machine vm2 contains a virtual machine disk with SCSI controller number 0 and device location 1. Exclude this disk from backup operations by specifying the following statement in the options file:
EXCLUDE.VMDISK vm2 "SCSI 0 1"
Command line
The command line examples show the use of the exclusion operator (-) before the vhdx= keyword, to indicate that the disk is to be excluded.
Exclude an IDE disk (with controller number 1 and device location 0) from the backup operation of virtual machine vm1:
dsmc backup vm "vm1:-vhdx=IDE 1 0"
Exclude a SCSI disk (with controller number 0 and device location 1) from the backup operation of virtual machine vm2:
dsmc backup vm "vm2:-vhdx=SCSI 0 1"
Restriction: You cannot use the all-vm option together with the vmname:-vhdx= option on the command line or in the options file.