Backup VM
Use the backup vm command to start a full backup of a virtual machine.
Backing up VMware virtual machines
Use the backup vm command to back up VMware virtual machines.
One or more virtual machines are backed up by the Tivoli® Storage Manager data mover node. Data mover node is the name that is given to a configuration where the backup-archive client runs on a vStorage backup server and is configured to protect the virtual machines in a Virtual Center or ESX/ESXi server. You must configure the VMware virtual machine before you use this command. For information about configuring the VMware virtual machine, see Preparing the environment for full backups of VMware virtual machines.
A full VM backup stores a backup copy of all virtual disk images and configuration information for a virtual machine. Full VM backups enable a complete restore of a virtual machine, but they take more time and more server space than a file-level or incremental backup.
File-level VM backups can individually restore virtual machine files, but they do not have an easy full VM recovery procedure.
If you set vmenabletemplatebackups option to yes, a backup vm operation includes the template VMs, but only if the vStorage backup server is connected to a vCenter Server, and not to an ESX or ESXi host.
If a snapshot fails during backup processing, the client attempts to back up the VMware virtual machine one more time. To control the number of total snapshot attempts, set the INCLUDE.VMSNAPSHOTATTEMPTS option in the client options file.
Virtual machines that are deployed in vApps are included in backup vm operations.
A Full VM backup uses VMware Changed Block Tracking (CBT) to create content-aware (used-block only) backups. Tivoli Storage Manager enables changed block tracking (CBT) on an ESX or ESXi server when a backup begins. VMware CBT requires an ESX 4.1 (or later) host, with virtual hardware 7 (or later). You cannot perform incremental or full VM content-aware backups on virtual machines that do not support CBT.
- A virtual disk that is stored on VMFS; the disk can be an iSCSI disk, a local disk, or a disk that is on a SAN.
- A virtual disk that is stored on NFS.
- An RDM that is in virtual compatibility mode.
- An RDM that is in physical compatibility mode.
- A disk that is accessed directly from inside a VM. For example, vSphere cannot track changes that are made to an iSCSI LUN that is accessed by an iSCSI initiator in the virtual machine.
- Off
- Indicates the CBT configuration parameter (ctkEnabled) is not enabled in the virtual machine's configuration parameters. Off is the default state.
- Not Supported
- Indicates that the virtual machine does not support CBT. Changed-block only backups are not possible.
- On
- Indicates the virtual machine supports CBT and that CBT is enabled in the virtual machine's configuration parameters (ctkEnabled=true).
- The client turns on CBT (it sets ctkEnable=true) with each backup attempt. After the client turns on CBT, it remains on, even if the virtual machine is deleted from the Tivoli Storage Manager server. With CBT enabled, after the first full VM backup is performed, only the changed blocks on the disk are backed up or restored.
- If you are no longer performing Tivoli Storage Manager backups of a virtual machine, you can turn off CBT. To turn off CBT, right-click the virtual machine that you want to turn off CBT for in the vSphere client. Click . Then, set the ctkEnabled configuration parameter to false.
For more information about compression, see Compression, encryption, and adaptive subfile backup processing.
- Full
- Full mode. In this mode, an image backup is created of all objects on a virtual machine’s disks. Contrast mode=full with mode=incremental, which creates a snapshot that contains only the data that changed since the last backup. The incremental-forever backup methods provide the most efficient backup operations. If you are not licensed to use Tivoli Storage Manager for Virtual Environments, you must specify a full VM backup.
- Incremental
- Incremental mode. In this mode, an image backup is created of the objects that changed since the last backup. You must be licensed to use Tivoli Storage Manager for Virtual Environments: Data Protection for VMware to use this option.
- IFFull
- Incremental-forever-full mode. In this mode, a snapshot of all used blocks on a virtual machine’s disks are backed up to the server. You must be licensed to use Tivoli Storage Manager for Virtual Environments: Data Protection for VMware, or Tivoli Storage Manager for Virtual Environments: Data Protection for Microsoft Hyper-V to use this option.
- IFIncremental
- Incremental-forever-incremental. In this mode, a snapshot is created of the blocks that changed since the last backup. You must be licensed to use Tivoli Storage Manager for Virtual Environments: Data Protection for VMware, or Tivoli Storage Manager for Virtual Environments: Data Protection for Microsoft Hyper-V to use this option.
For information about the incremental-forever backup strategy, see IBM Tivoli Storage Manager for Virtual Environments, Data Protection for VMware: Backup and restore types.
Supported Clients
This command is valid on supported Windows clients that are installed on a vStorage backup server that protects VMware virtual machines.
This command is valid only on supported Linux clients that are installed on a vStorage backup server that protects VMware virtual machines.
Syntax
.-,------. V | .---vmname-+-. >>-Backup VM--+------------+------------------------------------> >--+--------------------------------+---------------------------> | .-,--------------------------. | | V | | '---vmname--:vmdk=--disk_label-+-' >--+----------------------+--+-----------------------+--------->< '- -VMBACKUPUPDATEGUID-' '- -PREView-- --options-'
Parameters
- vmname
- Specify the name of one or more virtual machines that you want to back up. The name can be the
DNS host name or the virtual machine display name. Separate multiple virtual machine names with
commas. If you set the vmenabletemplatebackups option to yes,
vmname can specify the name of a template VM to back up.
VMware vCenter allows for two or more virtual machines to have the same display name. However, Tivoli Storage Manager requires that all virtual machine names in a vCenter server configuration be unique. To prevent errors during processing, ensure all virtual machines have a unique display name.
- If you do not specify vmname, you can identify the virtual machine with one
of the following options:
- domain.vmfull
- domain.vmfile
- :vmdk=disk_label
- This keyword is an extension to the vmname. It specifies the label (name) of the virtual machine disk to include in the backup operation. You can exclude a disk by preceding the keyword with the exclusion operator (-). For more ways to include or exclude disks from processing, see Domain.vmfull, Exclude.vmdisk, Include.vmdisk.
- -VMBACKUPUPDATEGUID
- You must be licensed to use Tivoli Storage Manager for Virtual Environments: Data Protection for VMware to use this option.
-
This option updates the globally unique identifier (GUID) for the virtual machine that you are backing up. This parameter is intended for use only in the following scenario:
You want to restore a previously backed up virtual machine named ORION. But, before you shut down and replace the copy of ORION that is running in your production environment, you want to verify the configuration of the restored virtual machine before you use it to replace the existing ORION.- You restore the ORION virtual machine and give it a new name: dsmc restore vm Orion -vmname=Orion2
- You update and verify the ORION2 virtual machine and determine that it is ready to replace the existing virtual machine that is named ORION.
- You power down and delete ORION.
- You rename ORION2 so that it is now named ORION.
- The next time that you backup ORION, by using either an incremental-forever full, or incremental-forever-incremental backup, you add the -VMBACKUPUPDATEGUID parameter to the backup vm command. This option updates the GUID, on the Tivoli Storage Manager server, so the new GUID is associated with the stored backups for the ORION virtual machine. The chain of incremental backups is preserved; there is no need to delete existing backups and replace them with new backups.
- -PREView
- This option displays information about a virtual machine, including
the labels of the hard disks in the virtual machine. You can use the
disk labels with the :vmdk= or
:-vmdk= keywords to include or exclude disks from
a backup operation. The following text is sample output from the -preview
parameter:
backup vm vm1 -preview Full BACKUP VM of virtual machines 'VM1' vmName:vm1 VMDK[1]Label: Hard disk 1 VMDK[1]Name: [ds5k_svt_1] tsmcetlnx14/tsmcetlnx14.vmdk VMDK[1]Status: Included VMDK[2]Label: Hard disk 2 VMDK[2]Name: [ds5k_svt_1] tsmcetlnx14/tsmcetlnx14_1.vmdk VMDK[2]Status: Excluded - user,Independent,pRDM
This example output from -preview shows that VMDK 2 was excluded by the previous backup. Disks that were included in a backup have a status of Included. Disks that were excluded from the backup have a status of Excluded, followed by a reason code. The reason codes can be any of the following:- user
- Indicates that the disk was skipped because it was excluded on a domain.vmfull statement, on the command line, or in the client options file.
- Independent
- Indicates that the disk is an independent disk. Independent disks cannot be part of a snapshot, so they are excluded from backup vm operations. Ensure that the vmprocessvmwithindependent option is set to yes or the entire virtual machine is bypassed by a backup operation if it contains one or more independent disks.
- pRDM
- Indicates that the disk is a physical Raw Device Mapped (pRDM) disk. pRDM disks cannot be part of a snapshot, so they are excluded from backup vm operations. Ensure that the vmprocessvmwithprdm option is set to yes or the entire virtual machine is bypassed by a backup operation if it contains one or more raw device mapping (RDM) volumes that are provisioned in physical-compatibility mode (pRDM).
Return codes for virtual machine backup operations
Return code | Description |
---|---|
0 | A command to back up one or more virtual machines completed successfully. |
8 | A command to back up multiple virtual machines succeeded for only some of the virtual machines that were targeted by the command. Examine the log file to determine the processing status for each of the targeted virtual machines. |
12 | Indicates that either of the following error
conditions occurred:
|
vStorage API for data protection example commands
dsmc backup vm vm1 -vmbackuptype=file
dsmc backup vm vm1 -vmbackuptype=file -vmchost=virtctr
dsmc backup vm vm3,vm4 -vmbackuptype=fullvm -mode=ifincremmental
dsmc backup vm vm1 -vmbackuptype=fullvm -mode=iffull
dsmc backup vm "vm1:vmdk=Hard Disk 1" -vmbackuptype=fullvm -mode=iffull
dcmc backup vm "vm1:-vmdk=Hard Disk 1:-vmdk=Hard Disk 4"
-vmbackuptype=fullvm -mode=iffull
dsmc backup vm "vm1:vmdk=Hard Disk 2:vmdk=Hard Disk 3",
vm2 -vmbackuptype=fullvm -mode=iffull
dsmc backup vm –vmmaxparallel=5 –vmlimitperhost=2 –vmlimitperdatastore=0
- Related links for backing up VMware virtual machines
Backing up Microsoft Hyper-V virtual machines
Use the backup vm command to back up Hyper-V virtual machines. You can back up Hyper-V guests that exist on a local disk, a SAN-attached disk, a cluster shared volume, or guests that exist on a remote file server share. Remote file server shares must be on a Windows Server 2012 (or newer) system.
- Full
- Full mode. In this mode, an image backup is created of all objects on a virtual machine’s disks, including configuration information, snapshots, and all of the disks. If you are not licensed to use Tivoli Storage Manager for Virtual Environments, you must specify a full VM backup.
- IFFull
- Incremental-forever-full mode. In this mode, a snapshot of all used blocks on a virtual machine’s disks are backed up to the server. The backup includes configuration information, and all of the disks. You must have a license for Tivoli Storage Manager for Virtual Environments: Data Protection for Microsoft Hyper-V to use this mode. This mode can be used only on Windows clients on Hyper-V hosts that are running in Windows Server 2012 or 2012 R2 environments.
- IFIncremental
- Incremental-forever-incremental. In this mode, a snapshot is created of the blocks that were changed since the last backup. The backup includes configuration information, and all of the disks. You must have a license for Tivoli Storage Manager for Virtual Environments: Data Protection for Microsoft Hyper-V to use this mode. This mode can be used only on Windows clients on Hyper-V hosts that are running in a Windows Server 2012 or 2012 R2 environments.
For information about the incremental-forever backup strategy, see Incremental-forever backup strategy.
Supported Clients
This command is valid on supported Windows clients that are installed on a Microsoft Hyper-V host server.
Syntax
>>-Backup VM--+-----------------+-------------------------------> | .-,------. | | V | | +---vmname-+------+ +-vmlist=--vmname-+ '-vmlist=?--------' >--+---------------------------+--+-------------------------+---> '- -VMBACKUPType=HYPERVFULL-' '- -VMBACKUPUPDATEGUID-- -' >--+-----------------------+----------------------------------->< '- -PREview-- --options-'
Parameters
- vmname
- Specify the name of the virtual machine that you want to back up; the name is case sensitive. If
you specify multiple virtual machine names, separate the names with commas. Note: VMware vCenter allows for two or more virtual machines to have the same display name. However, Tivoli Storage Manager requires that all virtual machine names in a vCenter server configuration must be unique. To prevent errors during processing, ensure that all virtual machines have a unique display name.Wildcard characters can be used in virtual machine names that are specified as this parameter. However, wildcard processing differs, depending on which backup mode is used.
- For backups that use mode=iffull or
mode=ifincremental, wildcards can be used to match VM name patterns. For example:
- backup vm VM_TEST* includes all virtual machines that have names that begin with VM_TEST
- backup vm VM?? includes any virtual machine that has a name that begins with the letters "VM", followed by 2 characters
If you do not specify a virtual machine name, and if you specify -mode=ifincremental or -mode=iffull, the domain.vmfull option is used to determine which virtual machines to include in the backup operation.
- For backups that use mode=full, wildcard
characters cannot be included in a VM name. However, if you omit the VM name from the command and
instead, you specify an asterisk (*), that syntax begins a full image backup of all Hyper-V virtual
machines that are defined to the Hyper-V host.
If you do not specify a virtual machine name, and if you specify -mode=full, the vmlist option is used to determine which virtual machines to include in the backup operation.
- For backups that use mode=iffull or
mode=ifincremental, wildcards can be used to match VM name patterns. For example:
- vmlist=vmname_1,vmname_2,vmname_n
- Specifies a list of virtual machine names to back up. Separate the virtual machine names with commas. Wildcard characters can be used in the virtual machine name to include virtual machines that match the wildcard pattern. The vmname and vmlist= syntaxes are mutually exclusive; you can specify a virtual machine name or a list of virtual machine names, but not both.
- vmlist=?
- The behavior of this syntax varies, depending on which backup
mode is specified on the
mode option:
- If the mode option is set to MODE=FULL, this syntax returns a list of virtual machines that are defined to the Hyper-V host. An error occurs if you specify an asterisk (*), instead of a question mark.
- If the mode option is set to MODE=IFFULL or MODE=IFINCREMENTAL, the question mark (?) in this syntax is interpreted as a wildcard, and the backup operation is performed for Hyper-V virtual machines that match the wildcard. That is, any Hyper-V virtual machines that have a one-character name are backed up.
- -VMBACKUPType=HYPERVFULL
- This parameter indicates that the backup operation that is being performed is for a Microsoft Hyper-V virtual machine. If you enable the Hyper-V server role, HYPERVFULL is the default backup type.
- -VMBACKUPUPDATEGUID
- You must be licensed to use Tivoli Storage Manager for Virtual Environments: Data Protection for Microsoft Hyper-V to use this option.
-
This option updates the globally unique identifier (GUID) for the virtual machine that you are backing up. This parameter is intended for use only in the following scenario:
You want to restore a previously backed up virtual machine named ORION. But, before you shut down and replace the copy of ORION that is running in your production environment, you want to verify the configuration of the restored virtual machine before you use it to replace the existing ORION.- You restore the ORION virtual machine and give it a new name: dsmc restore vm Orion -vmname=Orion2
- You update and verify the ORION2 virtual machine and determine that it is ready to replace the existing virtual machine that is named ORION.
- You power down and delete ORION.
- You rename ORION2 so that it is now named ORION.
- The next time that you backup ORION, by using either an incremental-forever full, or incremental-forever-incremental backup, you add the -VMBACKUPUPDATEGUID parameter to the backup vm command. This option updates the GUID, on the Tivoli Storage Manager server, so the new GUID is associated with the stored backups for the ORION virtual machine. The chain of incremental backups is preserved; there is no need to delete existing backups and replace them with new backups.
- -PREView
- This option causes this command to display additional information about a virtual machine, including the virtual disks in the virtual machine. This option applies only to Windows Server 2012, and subsequent versions of Windows Server operating systems. If you specify this option, the output is displayed, but the backup operation does not start.
- The following shows example output when you specify the -preview option. This example output is abbreviated to show
only information about one virtual machine and one disk.
Use both the -preview option and the -detail option on the command to display information about subdisks that are included when the backup is run. A subdisk is the AVHDX file that is created when a snapshot is taken of a VHDX file. This example output is abbreviated to show only information about one virtual machine and one disk.tsm> backup vm -vmbackuptype=hypervfull -mode=ifincr -preview Backup VM command started. Total number of virtual machines to process: 6 1. VM Name: VM2 Domain Keyword: all-vm Mode: Incremental Forever - Incremental Target Node Name: SPC Data Mover Node Name: SPC Cluster Resource: no Disk[1] Name: \\beta\d$\Hyper-V\VM2\VM2.vhdx Capacity: 40.00 GB Size: 9.13 GB Full Backup: included Incremental Backup: excluded Disk Type: VHDX Number of Subdisk: 1
tsm> backup vm -vmbackuptype=hypervfull -mode=ifincr -preview -detail Backup VM command started. Total number of virtual machines to process: 6 1. VM Name: VM2 Domain Keyword: all-vm Mode: Incremental Forever - Incremental Target Node Name: SPC Data Mover Node Name: SPC Cluster Resource: no Disk[1] Name: \\beta\d$\Hyper-V\VM2\VM2.vhdx Capacity: 40.00 GB Size: 9.13 GB Full Backup: included Incremental Backup: excluded Disk Type: VHDX Number of Subdisk: 1 Subdisk[1] Name: \\beta\d$\Hyper-V\VM2\VM2_88ABC7B4-E59F-87B9-20D064E549C4.avhdx Capacity: 40.00 GB Size: 4.00 MB Full Backup: included Incremental Backup: included Disk Type: AVHDX
Return codes for virtual machine backup operations
Return code | Description |
---|---|
0 | A command to back up one or more virtual machines completed successfully. |
8 | A command to back up multiple virtual machines succeeded for only some of the virtual machines that were targeted by the command. Examine the log file to determine the processing status for each of the targeted virtual machines. |
12 | Indicates that either of the following error
conditions occurred:
|
Microsoft Hyper-V backup examples
dsmc backup vm VM1 -vmbackuptype=hypervfull -mode=full
dsmc backup vm VM1 -vmbackuptype=hypervfull -mode=ifincremental
dsmc backup vm -vmbackuptype=hypervfull -mode=ifincremental
dsmc backup vm -vmbackuptype=hypervfull -mode=full -vmlist=vm1,vm5
dsmc backup vm -mode=full -vmlist=?
Hyper-V options file examples
backuptype hypervfull
vmlist vm1,vm2,vm5
- Related links for backing up Hyper-V virtual machines