Loading...

Defining Filters (VMware command line)

You can define filters to exclude virtual machines or virtual machine disks from backups for all subclients under a backup set. For more information, see Defining Filters for Content.

Note: The examples in this page are only intended for defining filters for backup sets by specifying Do Not Backup as the subclient name. For information about using the command line to define filters for subclients, see Defining Subclient Filters.

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 Datastore
  • From a Specific Host or a Cluster
  • Power On Status
  • Notes
  • Custom Attributes

Disk Filters

  • With a Specific Device Node
  • From a Specific Datastore
  • Based on a Disk Name Pattern
  • With Specific Disk Numbers

Procedure

  1. Download one of the following template files and save it on the computer where the command will be executed.
  2. Log in to the CommServe host using the qlogin command.
  3. When you use the -subclientName 'Do Not Backup' parameter, the filter is applied to the backup set, and is inherited by all subclients under the specified backup set. For example, to define a backup set filter, execute the following command from the software_installation_directory/Base folder after substituting the required parameter values.

    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

  4. 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 <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 <vmDiskFilter> node. For example,

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

Available Parameters

Parameter

Description of Parameter Values

clientName

Name of the client computer.

appName

Name of the application ('Virtual Server').

backupSetName

Name of the backup set.

subclientName

To define filters for a backup set, use 'Do Not Backup' as the subclient name.

vmContentOperationType

Type of operation you want to perform for VM filters. Valid values are:

  • ADD - Add filters.
  • OVERWRITE - Overwrite existing filters.
  • DELETE - Delete the filters.

vmDiskFilterOperationType

Type of operation you want to perform for disk filters. Valid values are:

  • ADD - Add filters.
  • OVERWRITE - Overwrite existing filters.
  • DELETE - Delete the filters.

vmContent/children/type

Type of virtual machine filter to be added. Valid values are:

  • 9 - Filter based on the virtual machine GUID.
  • 10 - Filter based on a virtual machine name pattern.
  • 7 - Filter based on the datastore name.
  • 1 - Filter based on an ESX host name or IP address.

vmContent/children/Name

Unique identifier (GUID) for the virtual machine. For example: 5039c191-5367-9b74-e918-7173ecd0bbc2

vmContent/children/displayName

Name pattern of the virtual machine, datastore, or ESX host, depending on the content type defined in the vmContent/children/type parameter.

Examples:

  • Test* to specify a name pattern beginning with "Test".
  • *client to specify a name pattern ending with "client"
  • *temp* to specify a name pattern containing the word "temp"

vmContent/children/equalsOrNotEquals

Indicates whether to exclude entities (virtual machines, datastores, or ESX hosts) that match or do not match the defined display name pattern. Valid values are:

  • 0 - Exclude virtual machines that do not match the defined display name pattern.
  • 1 - Exclude virtual machines with the defined display name or pattern.

vmDiskFilter/Filters/filterType

Type of disk filter to be added. Valid values are:

  • 2 - Filter based on disk name pattern.
  • 3 - Filter based on disk device node.
  • 4 - Filter based on disk datastore name.
  • 5 - Filter based on disk numbers.

vmDiskFilter/Filters/filter

Name of the disk device, datastore, or device number, depending on the filter type defined in the vmDiskFilter/Filters/filterType parameter.

Examples

Filter

Example

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

Based on Power On Status

qoperation execute -af update_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

Based on Notes

qoperation execute -af update_filters_template.xml -appName 'Virtual Server' -clientName 'vm_client' -instanceName xxxxx -backupsetName 'defaultBackupSet' -subclientName 'Do Not Backup' -vmContent/children/displayName 'Critical' -vmContent/children/type 'VMNotes' -vmContentOperationType ADD

Based on Custom Attributes

qoperation execute -af update_filters_template.xml -appName 'Virtual Server' -clientName 'vm_client' -instanceName xxxxx -backupsetName 'defaultBackupSet' -subclientName 'Do Not Backup' -vmContent/children/displayName 'resize' -vmContent/children/type 'VMCustomAttribute' -vmContentOperationType ADD

From a Specific Datastore

qoperation execute -af update_vm_filters_template.xml -appName 'Virtual Server' -clientName 'vm_client' -backupSetName 'defaultBackupSet' -subclientName 'Do Not Backup' -vmContent/children/type '7' -vmContent/children/displayName 'datastorename' -vmContentOperationType ADD

From a Specific Disk Datastore

qoperation execute -af update_disk_filters_template.xml -appName 'Virtual Server' -clientName 'vm_client' -backupSetName 'defaultBackupSet' -subclientName 'Do Not Backup' -vmDiskFilter/filters/filter 'datastorename' -vmDiskFilter/filters/filterType '4' -vmDiskFilterOperationType ADD

Based on Disk Numbers

qoperation execute -af update_disk_filters_template.xml -appName 'Virtual Server' -clientName 'vm_client' -backupSetName 'defaultBackupSet' -subclientName 'Do Not Backup' -vmDiskFilter/filters/filter 'Hard disk 1' -vmDiskFilter/filters/filterType '5' -vmDiskFilterOperationType ADD

Last modified: 3/13/2019 8:10:03 PM