Adding a Virtual Machine to a Subclient for OpenStack from the Command Line

You can use the command line to add VMs to a subclient.

You can also add virtual machines to a subclient based on the folder, power status, notes, or custom attributes that are associated with the VM.

Procedure

  1. To log on to the CommServe computer, run the qlogin command.

  2. Download the update_subclient_vm_template.xml file, and save it on the computer where the command will be executed.

  3. To add a single VM or all VMs that match specified criteria, on the command line, go to software_installation_directory/Base, and then type the following command:

    qoperation execute -af update_subclient_vm_template.xml -appName 'Virtual Server' -clientName xxxxx -instanceName xxxxx -backupsetName xxxxx -subclientName xxxxx -vmContent/children/displayName xxxxx -vmContent/children/type VMName -vmContentOperationType ADD

    where:

    • appName is the name of the application. In this case, it is 'Virtual Server'.

    • clientName is the name of the virtualization client.

    • instanceName is the name of the virtual server instance (OpenStack).

    • backupsetName is the name of the backup set.

    • subclientName is the name of the subclient.

    • vmContent/children/displayName is the display name of the virtual machine, or other entity, depending on the content type defined in the vmContent/children/type parameter.

    • vmContent/children/type is the type of content to be added to the subclient.

      For OpenStack, the only valid value is: VMName, to add a virtual machine to the subclient content.

    • vmContentOperationType is the type of operation that you want to perform to the subclient content.

      For OpenStack, the valid values are:

      ADD, to add content to the subclient.

      OVERWRITE, to overwrite contents to the subclient.

      DELETE, to delete the contents from the subclient.

  4. To add multiple VMs by name:

    1. Open the update_subclient_vm_template.xml file, and then add the following line under the <vmContent> node to specify each virtual machine:

      <children equalsOrNotEquals="1" name="" displayName="MyVM" type="VMName"/>

      For example, to add three virtual machines (VM001, VM002, and VM003), add the following lines to the XML:

      <vmContent>
           <children equalsOrNotEquals="1" name="" displayName="VM001" type="VMName"/>
           <children equalsOrNotEquals="1" name="" displayName="VM002" type="VMName"/>
           <children equalsOrNotEquals="1" name="" displayName="VM003" type="VMName"/>
       </vmContent>
    2. On the command line, go to software_installation_directory/Base, and then type the following command:

      qoperation execute -af update_subclient_vm_template.xml -appName 'Virtual Server' -clientName xxxxx -instanceName xxxxx -backupsetName xxxxx -subclientName xxxxx -vmContentOperationType ADD
  5. To log off the CommServe computer, run the qlogout command.

Example of Adding a VM by Name

The following example adds a single virtual machine VM01 to subclient1, under client1, instance VMware, and backupset1:

qoperation execute -af update_subclient_vm_template.xml -appName 'Virtual Server' -clientName client1 -instanceName OpenStack -backupsetName backupset1 -subclientName subclient1 -vmContent/children/displayName VM01 -vmContent/children/type VMName -vmContentOperationType ADD

Example of Adding a VM Based on Power Status

The following example adds virtual machines that are powered on:

qoperation execute -af update_subclient_vm_template.xml -appName 'Virtual Server' -clientName client1 -instanceName OpenStack -backupsetName backupset1 -subclientName subclient1 -vmContent/children/displayName Powered On -vmContent/children/type VMPowerState -vmContentOperationType ADD
×

Loading...