Creating a backup

The Data Protection for VMware command-line interface can be used to run backup tasks in a virtualized environment.

About this task

If Tivoli® Storage FlashCopy® Manager for VMware and Tivoli Storage Manager for Virtual Environments are installed and configured you can select the type of backup to create with the parameter, -t backupType. The following syntax diagram shows the Tivoli Storage FlashCopy Manager for VMware backup command:
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-'   

>--+----------------------------+------------------------------><
   |                        (1) |   
   '- -o--datamovernodename-----'   

Notes:
  1. Use this parameter to specify the data mover. The data mover is used only to offload a backup to Tivoli Storage Manager.

You can start the task immediately or create a schedule for it by using the --start, --interval, and --end parameters. The --start parameter postpones the task until a specified date and time. If you specify the --interval parameter, with the --start parameter, the task reruns at the specified interval. The --end parameter indicates the date and time when the task rerun ends.

You must specify the datastores that you want to back up in the input file that is specified by the -I backupObjectListFile parameter. You can specify a name for the task with the --name parameter and descriptive information for the task with the --description parameter.

To specify the data mover to use to offload a backup to Tivoli Storage Manager use the -o parameter. For example, ./vmcli -f backup -t FCM_TSM_LATEST -I backupInfile --name FCM_TSM_backup --runnow -o datamovernode1.
Note: Before, running an offloaded backup to Tivoli Storage Manager that has a backup type of incremental, you must enable changed block tracking (CBT) manually for all virtual machines. Alternatively, run a Tivoli Storage Manager for Virtual Environments backup that includes these virtual machines before you run the first offloaded backup to Tivoli Storage Manager.

If Tivoli Storage Manager for Virtual Environments is not installed, the backup type is always FCM and you can omit this parameter from the backup commands. For a Tivoli Storage FlashCopy Manager for VMware backup, you can overwrite the AUXILIARY_ESX_HOST and VM_BACKUP_MODE parameters in the Tivoli Storage FlashCopy Manager for VMware profile with command-line parameters -H and --vmbackupmode.

For backups to Tivoli Storage Manager for Virtual Environments, schedules cannot be defined. The --runnow parameter must be used. The following syntax diagram shows the Tivoli Storage Manager for Virtual Environments backup command:
Read syntax diagramSkip visual syntax diagram
vmcli command

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

>--+-------------------------------------+---------------------->
   '- -t -backupType--+----------------+-'   
                      '- ,--backupType-'     

>---- -I--backupObjectListFile----+---------------+------------->
                                  '- -B--backupID-'   

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

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

>--+-------------------------+--+------------------------+-----><
   '- -d--datacenternodename-'  '- -o--datamovernodename-'   

The backup snapshots are sent to the Tivoli Storage Manager server storage asynchronously by the fcmcli daemon.

Procedure

To back up a datastore, enter the following command:

vmcli -f backup -I backupObjectListFile

Where:

-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.