Modifying Subclient Properties from Command Line Interface (Microsoft Hyper-V)

Use XML to add or remove a virtual machine to the subclient content or to modify subclient properties. 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 qlogin command. For instructions, see Qlogin.

Procedure

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

  2. Open the update_subclient_hyperv_template.xml file, add your specific parameters, and save the file.

    For information on supported instance XML parameters, see Available XML Parameters for Subclient Configuration.

  3. On the command line, go to <Software_Installation_Directory>/Base folder, and type the command.

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

    For example, add VM01 virtual machine to subclient subclient1, under instance Hyper-V and backup set backupset1 on client hyperv-client.

    qoperation execute -af download_location\update_subclient_hyperv_template.xml -appName 'Virtual Server' -clientName hyperv-client -instanceName Hyper-V -backupsetName backupset1 -subclientName subclient1 -vmContent/children/displayName VM01 -vmContent/children/type VMName -vmContentOperationType ADD

Examples

Adding Multiple Virtual Machines
  1. Open the update_subclient_hyperv_template.xml file and add the following line under the <vmContent> node to specify each virtual machine:

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

    For example, if you want to add 3 virtual machines (VM001, VM002 and VM003), it should look like this in 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 folder, and type the command after substituting the parameter values.

    qoperation execute -af download_location\update_subclient_hyperv_template.xml -appName 'Virtual Server' -clientName xxxxx -instanceName xxxxx -backupsetName xxxxx -subclientName xxxxx -vmContentOperationType ADD
Removing a Virtual Machine

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

qoperation execute -af download_location\update_subclient_hyperv_template.xml -appName 'Virtual Server' -clientName xxxxx -instanceName xxxxx -backupsetName xxxxx -subclientName xxxxx -vmContent/children/displayName xxxxx -vmContent/children/type VMName -vmContentOperationType DELETE
Adding Virtual Machines Based on Power On Status

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

qoperation execute -af download_location\update_subclient_hyperv_template.xml -appName 'Virtual Server' -clientName xxxxx -instanceName xxxxx -backupsetName xxxxx -subclientName xxxxx -vmContent/children/displayName Powered On -vmContent/children/type VMPowerState -vmContentOperationType ADD
Adding Virtual Machines Based on Notes

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

qoperation execute -af download_location\update_subclient_hyperv_template.xml -appName 'Virtual Server' -clientName xxxxx -instanceName xxxxx -backupsetName xxxxx -subclientName xxxxx -vmContent/children/displayName Critical -vmContent/children/type VMNotes -vmContentOperationType ADD
Changing the Number of Data Readers

Before performing a backup, you can run the following command to change the number of data readers to use for the backup.

  1. Download the update_subclient_number_of_readers.xml file and save it on the computer where the command will be executed.

  2. Run the following command:

    qoperation execute -af update_subclient_template.xml -entity/appName 'Virtual Server' -entity/clientName %client_name% -entity/instanceName %instance_name% -entity/backupsetName %backupset_name% -entity/subclientName "%subclient_name%" -commonProperties/numberOfBackupStreams 7

    Provide appropriate values for client_name, instance_name, backupset_name, and subclient_name.

After running this command, all subsequent backups for the subclient use the specified number of data readers.

Specifying Application-Consistent or Crash-Consistent Backups

Before performing a backup, you can run the following command to control whether the guest file system and applications are quiesced during backups.

  1. Download the update_subclient_properties_template.xml file and save it on the computer where the command will be executed.

  2. Run the following command:

    qoperation execute -af update_subclient_properties_template.xml -appName 'Virtual Server' -clientName xxxxx -instanceName xxxxx -backupsetName xxxxx -subclientName xxxxx -quiesceGuestFileSystemAndApplications true | false

    Provide appropriate values for client_name, instance_name, backupset_name, and subclient_name.

    For the quiesceGuestFileSystemAndApplications parameter, specify 'true' to perform an application-consistent backup or 'false' to perform a crash-consistent backup.

Enabling or Disabling Changed Block Tracking

Before performing a backup, you can run the following commands to enable or disable Changed Block Tracking (CBT).

Run the following command to enable CBT:

qoperation execscript -sn SetSubClientProperty.sql -si 'c=client_name' -si 'a=Q_VIRTUAL_SERVER' -si 'i=Hyper-V' -si 'b=backupset_name' -si 's=subclient_name' -si 'Change Tracking on VM' -si 1

Run the following command to disable CBT:

qoperation execscript -sn SetSubClientProperty.sql -si 'c=client_name' -si 'a=Q_VIRTUAL_SERVER' -si 'i=Hyper-V' -si 'b=backupset_name' -si 's=subclient_name' -si 'Change Tracking on VM' -si 0
×

Loading...