Skip to main content

Hi, could you please help me with this? We are using the following workflow already preconfigured in Commvault: Demo - Client Group Policy. We need to automatically change the Storage Policy of the SQL Job on a daily basis to meet the copy requirements. The only customization we need is to modify the workflow so that it changes the Storage Policy on all SQL instances and not just the first instance. I really appreciate your support!

 

@Mike Struening  @chrisknows can you help me please? 🙏🏻😳

The code works, but it only moves the storage policy for one instance. I need it to move the storage policy to all instances.

 

<App_UpdateSubClientPropertiesRequest>
<subClientProperties>
<commonProperties>
<storageDevice>
<dataBackupStoragePolicy storagePolicyName="xpath:{/workflow/inputs/storagePolicy/storagePolicyName}" />
</storageDevice>
</commonProperties>
</subClientProperties>
<association>
<entity backupsetName="" 
                   subclientName="default" 
                   clientName="xpath:{/workflow/ForEach_1/row/cola@name="name"]}" 
                   appName="SQL Server" />
</association>
</App_UpdateSubClientPropertiesRequest>


This is another way that might work although you will have to test it out.

 

There is a way to assign a storage policy to a client at the client group level:

https://documentation.commvault.com/2024e/expert/configuring_region_based_data_protection_operations.html

  1. Turn that on and assign the appropriate storage policy and clients
  2. Save as script
  3. Modify the xml - either put it in a workflow or use the generated batch
        <associatedStoragePolicies>
          <storagePolicyName>Server plan</storagePolicyName>
        </associatedStoragePolicies>

You can override the storage policy on the group which should apply to all the default subclients on all the instances of the SQL servers you assign to the group.

 


@FeRox 

 

Sorry for taking so long to respond, I’m not around much these days. but the way that I do it is by querying for the instances and then looping through them using the ForEachJSon activity.

 

  1. Generate the url to get the instances using  using the httpclient script activity
  2. Feed the uri to the httpclient to get the list of instancs in json format
  3. Feed the json output to the ForEachJson activity.
  4. Place the updates in the loop body.

Screenshots are below.

 

// Set rest URIs for instances and subclients

String clientName = xpath:{/workflow/pbConfigureOracleiDas/ClientName/clientName},
restInstanceUri = "/SearchSvc/CVWebService.svc/Instance/?clientName=" + clientName;
restSubclientUri = "/SearchSvc/CVWebService.svc/Subclient/?clientName=" + clientName;

workflow.setVariable("restInstanceUri", restInstanceUri);
workflow.setVariable("restSubclientUri",restSubclientUri);

logger.info("The url for the retrieving for "+clientName+" instances has been set to e" + restInstanceUri + "]");
logger.info("The url for the subclients for "+clientName+" instances has been set to e" + restSubclientUri + "]");

 

 

 

The path will have to match the path to the subclients you are interested in.

I’ll look it up for you. 


Reply