Defining Filters for a Backup Set from Command Line Interface (Microsoft Hyper-V)

Use XML to define filters for a backup set. You can run the XML from the command line, or automate the configuration by combining the command line operations in a script.

You can include the XML parameters in the xml file, or you can specify them on the command line when they frequently change. For more information on command line parameters and XML elements, see Command Line - Syntax.

Before You Begin

Log on to the CommServe host using the qlogin command.

About This Task

You can define backup set filters to exclude virtual machines or virtual machine disks from backups for all the subclients under the backup set. For more information, see Backup Set Filtering.

For information on supported XML parameters, see Available XML Parameters for Backup Set Configuration.

The following filters can be defined from the command line:

Virtual Machine Filters

  • Based on a Name Pattern

  • Based on the unique identifier (GUID) for the virtual machine

  • From a Specific Host or a Cluster

  • Power On Status

  • Notes

Disk Filters

  • With a Specific Device Node

  • Based on a Disk Name Pattern

Procedure

  1. Download the update_filters_template.xml file to the computer where you will run the command.

  2. On the command line, go to the software_installation_directory/Base folder, and type the command.

    qoperation execute -af $[downloaded location]\update_filters_template.xml -appName '$[Virtual Server]' -clientName $[xxxxx] -backupSetName $[xxxxx] -subclientName '$[Do Not Backup]' -vmContent/children/Name $[xxxx] -vmContent/children/type $[xx] -vmContent/children/displayName $[xxxx] -vmDiskFilter/filters/filter $[xxxx] -vmDiskFilter/filters/filterType $[xx] -vmContentOperationType $[ADD] -vmDiskFilterOperationType $[ADD]

    When you use the -subclientName 'Do Not Backup' parameter, the filter is applied to all subclients under the specified backup set. To define a filter for a subclient, use the subclient name instead of 'Do Not Backup'.

    To define multiple filters for the backup set, open the downloaded xml file and add an entry for each filter. For example, to add virtual machine filters based on host name and virtual machine name pattern, type the following lines under the <vmContent> node.

    <vmContent>
     <children allOrAnyChildren="$[1]" name="" type="$[1]" path="" displayName="$[hostname]" equalsOrNotEquals="$[1]" />
      <children allOrAnyChildren="$[1]" name="" type="$[10]" path="" displayName="$[vmname]" equalsOrNotEquals="$[1]" />
     </vmContent>
    

    Similarly, you can add disk filters under the <vmDiskFilter> node. For example,

    <vmDiskFilter>
     <filters filter="$[SCSI (0:0)]" filterType="$[3]" vmGuid=""/>
     <filters filter="$[test.vmdk]" filterType="$[2]" vmGuid=""/>
     </vmDiskFilter>
    

Examples

Based on Virtual Machine Name Pattern

qoperation execute -af update_vm_filters_template.xml -appName '$[Virtual Server]' -clientName '$[vm_client]' -backupSetName '$[defaultBackupSet]' -subclientName '$[Do Not Backup]' -vmContent/children/type '$[10]' -vmContent/children/displayName '$[vmname]' -vmContentOperationType $[ADD]

Based on the Unique Identifier (GUID) for the Virtual Machine

qoperation execute -af update_vm_filters_template.xml -appName '$[Virtual Server]' -clientName '$[vm_client]' -backupSetName '$[defaultBackupSet]' -subclientName '$[Do Not Backup]' -vmContent/children/Name '$[5039c191-5367-9b74-e918-7173ecd0bbc2]' -vmContent/children/type '$[9]' -vmContent/children/displayName '$[vmname]' -vmContentOperationType $[ADD]

From a Specific Host or a Cluster

qoperation execute -af update_vm_filters_template.xml -appName '$[Virtual Server]' -clientName '$[vm_client]' -backupSetName '$[defaultBackupSet]' -subclientName '$[Do Not Backup]' -vmContent/children/type '$[1]' -vmContent/children/displayName '$[hostname]' -vmContentOperationType $[ADD]

With a Specific Device Node

qoperation execute -af update_disk_filters_template.xml -appName '$[Virtual Server]' -clientName '$[vm_client]' -backupSetName '$[defaultBackupSet]' -subclientName '$[Do Not Backup]' -vmDiskFilter/filters/filter '$[SCSI (0:0)]' -vmDiskFilter/filters/filterType '$[3]' -vmDiskFilterOperationType $[ADD]

Based on a Disk Name Pattern

qoperation execute -af update_disk_filters_template.xml -appName '$[Virtual Server]' -clientName '$[vm_client]' -backupSetName '$[defaultBackupSet]' -subclientName '$[Do Not Backup]' -vmDiskFilter/filters/filter '$[test.vmdk]' -vmDiskFilter/filters/filterType '$[2]' -vmDiskFilterOperationType $[ADD]

Based on Virtual Machine Name Pattern and Device Node

qoperation execute -af update_filters_template.xml -appName '$[Virtual Server]' -clientName '$[vm_client]' -backupSetName '$[defaultBackupSet]' -subclientName '$[Do Not Backup]' -vmContent/children/type '$[10]' -vmContent/children/displayName '$[vmname]' -vmContentOperationType $[ADD] -vmDiskFilter/filters/filter '$[SCSI (0:0)]' -vmDiskFilter/filters/filterType '$[3]' -vmDiskFilterOperationType $[ADD]

Filter Virtual Machines Based on Power On Status

On the command line, go to the software_installation_directory/Base folder, and type the command after substituting the parameter values.

qoperation execute -af update_vm_filters_template.xml -appName '$[Virtual Server]' -clientName '$[vm_client]' -backupSetName '$[defaultBackupSet]' -subclientName '$[Do Not Backup]' -vmContent/children/type '$[VMPowerState]' -vmContent/children/displayName '$[Powered On]' -vmContentOperationType $[ADD]

Filter Virtual Machines Based on Notes

On the command line, go to the software_installation_directory/Base folder, and type the command after substituting the parameter values.

qoperation execute -af $[download_location]\update_vm_filters_template.xml -appName '$[Virtual Server]' -clientName $[xxxxx] -instanceName $[xxxxx] -backupsetName $[xxxxx] -subclientName $[xxxxx] -vmContent/children/displayName '$[Critical]' -vmContent/children/type '$[VMNotes]' -vmContentOperationType $[ADD]

×

Loading...