Exclude.vmdisk
The EXCLUDE.VMDISK option excludes a virtual machine disk from backup operations.
This option applies to both VMware and Microsoft Hyper-V virtual machine disks.
EXCLUDE.VMDISK for Microsoft Hyper-V virtual machines
Use the EXCLUDE.VMDISK option to exclude a virtual machine disk from Hyper-V backup operations.
Supported clients
This option can be used with Windows clients.
Options file
Set this option in the client options file. Command-line parameters override statements in the options file.
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 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.
Tips for restoring Hyper-V VMs with excluded disks
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.