VMCLI backup

You can use this command to run or schedule a backup task of your virtual machines.

Syntax

The vmcli -f backup command uses the following syntax:
Read syntax diagramSkip visual syntax diagram
vmcli command

>>-vmcli------ -f backup---------------------------------------->

>--+---------------------------------------+-------------------->
   '- -t--backup_type--+-----------------+-'   
                       '- ,--backup_type-'     

>---- -I--backupObjectListFile----+------------------+---------->
                                  '- -D--deviceClass-'   

>--+--------------+--------------------------------------------->
   '- -H--esxHost-'   

>--+-------------------------------------------------------------------+-->
   '- --vmbackupmode--SNAPSHOT_INCL_MEM|SNAPSHOT_EXCL_MEM|SUSPEND|ASIS-'   

>--+---------------------------------+-------------------------->
   '- --start--scheduleStartDateTime-'   

>--+------------------------------+----------------------------->
   '- --interval--intervalSeconds-'   

>--+-----------------------------+--+------------------+-------->
   '- --end--scheduleEndDateTime-'  '- --priority--1-5-'   

>--+-------------------+---------------------------------------->
   '- --name -taskName-'   

>--+---------------------------------------+--+-----------+----><
   '- --description -descriptionInFile.txt-'  '- --runnow-'   

Parameters

-t backupType
Specify the type of backup from the following types:
FCM
Specifies a Tivoli® Storage FlashCopy® Manager for VMware snapshot backup only. This snapshot backup is not used as a source for a subsequent tape backup operation.
FCM_TSM_YES
Creates a Tivoli Storage Manager for Virtual Environments backup from a Tivoli Storage FlashCopy Manager for VMware snapshot. The target set can be reused if the Tivoli Storage FlashCopy Manager for VMware backup operation does not complete successfully.
FCM_TSM_LATEST
Creates a Tivoli Storage Manager for Virtual Environments backup from a Tivoli Storage FlashCopy Manager for VMware snapshot. If the offloaded backup to Tivoli Storage Manager either did not start or fails, any new snapshot backup with this option removes the previous backup request to Tivoli Storage FlashCopy Manager for VMware.
TSM
Creates a Tivoli Storage Manager for Virtual Environments backup.

When this option is selected, then by default TSM_INCR is also selected.

TSM_INCR
Creates an incremental Tivoli Storage Manager for Virtual Environments backup by using the incremental option available with VMware.
TSM_FULL
Creates a full image Tivoli Storage Manager for Virtual Environments backup.
TSM_IFFULL
Creates an incremental forever full backup of the specified backup objects. When TSM_IFFULL is specified, template VMs that are unchanged since the last backup operation are also included.
TSM_IFINCR
Creates an incremental forever incremental backup of the specified backup object. Only data that has changed since last backup operation is copied.
Note: To specify a Tivoli Storage FlashCopy Manager for VMware snapshot that includes a subsequent offload to Tivoli Storage Manager, you specify the Tivoli Storage FlashCopy Manager for VMware backup type, followed by the Tivoli Storage Manager backup type. Use a comma to separate the two options, for example: FCM_TSM_YES,TSM. For a Tivoli Storage FlashCopy Manager for VMware only backup type, use only one option. Similarly, in the case of a Tivoli Storage Manager only backup type, only one option is required.
-I backupObjectListFile
Specifies a file that contains a list of objects to back up. The backupObjectListFile has the following requirements:
  • Each line can contain only one identifier and its value, which is separated by a colon.
  • The valid datastore identifiers are the data storeurl, datastoreurl, and the datastore name datastorename.
  • Exclude statements are allowed and begin with an exclamation point !. These statements can contain a vminstanceuuid, vmname, datastoreurl, or datastorename. Name statements can contain wildcard characters. Wildcard characters ? and * are allowed for the datastorename or vmname.
  • Specify include or exclude statements but not both in the same file. For example, to back up all virtual machines in a datastore and not to include newly added virtual machines in future runs, list each virtual machine to include. To back up all virtual machines in a datastore and to include newly added virtual machines in future runs, list each virtual machine to exclude.
Restriction: Support for virtual machine backup and restore operations is limited to virtual machine names and data center names that contain English 7-bit ASCII characters only. Virtual machine names and data center names that use other language characters are not supported currently.
The following example shows how to include objects in backupObjectListFile:
# Lines starting with # and blank lines will be ignored
#
# Wildcards ? and * are supported
# ? - any single character
# * - any character sequence (also empty)
# Wildcards are allowed for datastorename and 
# vmname identifier
#
# Include statements are optional
# Includes may comprise datastoreurl and datastorename identifier
#
# Exclude statements are optional
# Exclude statements begin with a "!"
# Excludes may comprise datastorename, datastoreurl, 
# vminstanceuuid and vmname identifier
# 

#Include datastore with this URL in the backup
datastoreurl:dsUrl
#Include datastore with this name in the backup 
datastorename:dsName
#Include datastores matching the wildcard string in the backup datastorename:
datastorename:ds?am*
#Include VM matching this instance uuid in the backup. Fails if it is not 
#found within the included datastores which additionally need to be specified 
#in the infile when this option is used
vminstanceuuid:vmInstanceUuid
Comments are allowed and must be marked with a '#' sign at the beginning of the line.
The following example shows how to exclude objects in backupObjectListFile:
# Lines starting with # and blank lines will be ignored
#
# Wildcards ? and * are supported
# ? - any single character
# * - any character sequence (also empty)
# Wildcards are allowed for datastorename and 
# vmname identifier
#
# Include statements are optional
# Includes may comprise datastoreurl and datastorename identifier
#
# Exclude statements are optional
# Exclude statements begin with a "!"
# Excludes may comprise datastorename, datastoreurl, 
# vminstanceuuid and vmname identifier
# 

#Exclude VM with this uuid from the backup
!vminstanceuuid:vmUuid
#Exclude VM with this name from the backup (needs to be unique)
!vmname:vmName
#Exclude all vms matching this wildcard string from the backup
!vmname:vmN*
#Exclude datastore with this URL from the backup
!datastoreurl:dsUrl
#Exclude all datastores matching this wildcard string from the backup
!datastorename:ds?am*
Comments are allowed and must be marked with a '#' sign at the beginning of the line.
-D deviceClass
Specifies the Tivoli Storage FlashCopy Manager for VMware device class to be used in the backup operation. This device class must exist in the profile, otherwise the operation fails. The default is STANDARD.
-H esxHost
Specifies the ESX host where the datastores are attached during a subsequent offload backup toTivoli Storage Manager for Virtual Environments. The default is the value of AUXILIARY_ESX_HOST in the Tivoli Storage FlashCopy Manager for VMware profile.
--vmbackupmode vmsnapType
Specifies if software snapshots are created for each virtual machine or if the virtual machines are suspended before the hardware snapshot. The default value is the value of the VM_BACKUP_MODE parameter in the Tivoli Storage FlashCopy Manager for VMware profile.
--start
Specifies a date/time when this scheduled backup is started
--interval intervalSeconds
Specifies an interval in seconds after which the backup operation reruns. This parameter is only valid when –start is specified.
--end scheduleEndDate
Specifies the end date/time when the scheduled reruns ends. This parameter is only valid when –start and –interval are specified.
--priority 1-5
If two backup tasks are scheduled to run at the same time, the task with a higher priority runs first. The priority is an integer value between 1 (lowest) and 5 (highest) priority.
--name taskName
This string can be used to identify this backup task.
--description descriptionInFile
This parameter specifies a text file which contains some textual description of this backup task.
--runnow
If scheduling options are set, this option can be used to start this task immediately.

Output

 #TASK taskID taskType dateCreated
 #PARAM TASK_NAME=taskName 
 #PARAM BACKUP_TYPE=backupType[,backupType[,...]] 
 #PARAM AUXILIARY_ESX_HOST=esxHostname
 #PARAM OBJECT=datastoreurl:datastoreurl
 #PARAM OBJECT=vminstanceuuid:vminstanceuuid
 #PARAM OBJECT=vminstanceuuid:vminstanceuuid
 #RUN runID runDate
 #LANG country-code (en-US,de-DE)
 #PARAM BID=BID 
 #PARAM CHAIN_NUMBER=CHAIN_NUMBER 
 #PARAM BACKEND=backendType
 #PARAM Version: 3.2.0.0 Build: 527
 #PARAM AUXILIARY_ESX_HOST=esxHostname
 #PARAM VM_BACKUP_MODE=SNAPSHOT_INCL_MEM|SNAPSHOT_EXCL_MEM|SUSPEND|ASIS 
 #PARAM DEVICE_CLASS=deviceClass 
 #PARAM BACKUP_TYPE=backupType 
 #PARAM BACKUP_ID=backupID
 #PHASE_COUNT 4
 #PARAM OBJECT=#datastoreurl:datastoreurl
 #PARAM OBJECT=datastoreurl:datastoreurl
 #PARAM OBJECT=# vmname
 #PARAM OBJECT=#vmname:vmname
 #PARAM OBJECT=vminstanceuuid:vminstanceuuid
 #PARAM OBJECT=#vmname
 #PARAM OBJECT=#vminstanceuuid:vminstanceuuid
 #PARAM OBJECT=vmname
 #PARAM OBJECT=vminstanceuuid:vminstanceuuid
 #PARAM OBJECT=#distributedvm...
 #PARAM OBJECT=#!vminstanceuuid:5vminstanceuuid
 #PARAM OBJECT=#vmname:vmname
 #CHILD datacentername:datacentername
 #PARENT vmuuid:vmUuid
 #CHILD vminstanceuuid:vmInstUuid
 #PARENT vmuuid:vmUuid
 #CHILD vmname:vmName
 #PARENT vmuuid:vmUuid
 #CHILD offloadstate:offloadstate
 #PARENT vmuuid:vmUuid
 #CHILD esxhostname:esxHostName
 #PARENT vmuuid:vmUuid
 #CHILD datacentername:datacentername
 #PARENT vmuuid:vmUuid
 #CHILD vminstanceuuid:vmInstUuid
 #PARENT vmuuid:vmUuid
 #CHILD vmname:vmName
 #PARENT vmuuid:vmUuid
 #CHILD offloadstate:TAPE_BACKUP_FAILED
 #PARENT vmuuid:vmUuid
 #CHILD esxhostname:esxHostName
 #PARENT vmuuid:vmUuid
 #PARAM COPYSERVICE_HARDWARE_TYPE=SVC|XIV|DS8000
 #PARAM FLASHCOPYTYPE=COPY|NOCOPY|INCR //This parameter
 is only set for storage types DS and XIV
 #PHASE PARTITION
 #CHILD lunid:lun_id
 #PARENT datastoreurl:dsUrl
 #CHILD datastorename:datastore_name
 #PARENT datastoreurl:dsUrl
 #CHILD datastoreurl:dsUrl
 #PARENT vmuuid:vmUuid
 #CHILD diskkey:key of virtual disk
 #PARENT vmuuid:vmUuid
 #CHILD disklabel:label of virtual disk
 #PARENT diskkey:key of virtual disk
 #CHILD disksize:disksize
 #PARENT diskkey:key of virtual disk
 #CHILD parentdiskfile:datastore path to vmdk file
 #PARENT diskkey:key of virtual disk
 #CHILD diskkey:key of virtual disk
 #PARENT vmuuid:vmUuid
 #CHILD disklabel:label of virtual disk
 #PARENT diskkey:key of virtual disk
 #CHILD disksize:disksize
 #PARENT diskkey:key of virtual disk
 #CHILD parentdiskfile:datastore path to vmdk file
 #PARENT diskkey:key of virtual disk
 #PHASE PREPARE
 #PHASE FLASH
 #PHASE VERIFY
 #PARAM STATUS=runStatus
 #END RUN runID endRunDate
 #END TASK taskID
 #END
 #

Rerun a defined backup task

This function is used to rerun a defined backup task against the corresponding backup server. It can be used to run a backup once and to schedule backup tasks.

Input
vmcli -f backup -T taskID --runnow

Change a backup task

This command changes a backup task. It can be used to edit or delete the details of a backup task. The taskID must be specified. The options for this command are the same as the backup function, except -I is an optional parameter. All parameters set for the task can now be overwritten with the new value. When a backup task is changed it is not run immediately. To start the backup task immediately, the --runnow parameter must be included in the command.

Input
vmcli -f backup -T taskID[-t backupType][-I backupObjectListFile} 
[-B backupID][-D deviceClass][-H esxHost]
[--vmbackupmode (SNAPSHOT_INCL_MEM|SNAPSHOT_EXCL_MEM|SUSPEND|ASIS)]
[--start scheduleStartDateTime[--interval intervalSeconds
[--end scheduleEndDateTime]][--priority 1-5]]
[--name taskName][--description descriptionInFile.txt][--runnow]
Output
#TASK taskID taskType dateCreated
[ #PARAM TASK_NAME=taskName ]
[ #PARAM TASK_DESCRIPTION=text with \n chars
[ #PARAM TASK_SCHEDULE=startDateTime [intervalSeconds [endDateTime]] ]
[ #PARAM TASK_PRIORITY=1-5
[ #PARAM NEXT_DUE_DATE=date/time
[ #PARAM AUXILIARY_ESX_HOST=esxHostname
[ #PARAM VM_BACKUP_MODE=SNAPSHOT_INCL_MEM|SNAPSHOT_EXCL_MEM|SUSPEND|ASIS]
[ #PARAM DEVICE_CLASS=STANDARD|Name ]
[ #PARAM BACKUP_TYPE=[,backupType,[,..]] ]
[ #PARAM DELETE_DATE=date/time // only set if marked for deletion
#PARAM OBJECT=one line from backup object list file
[ #PARAM OBJECT=... ]
...
#END TASK taskID
#END