Question

Assign Storage Policy to SQL Server Subclient

  • 21 May 2024
  • 1 reply
  • 37 views

Badge +3

I am using CVpySDK and trying to assign storage policy for a client that currently doesn’t have a storage policy.

 

I tried the code below from the documentation but it didn’t work:

 

client = commcell.clients.get(client_name)

agent = client.agent.get(‘sql server’)

backupset = agent.backupset.get(‘defaultBackupSet’)

subclient = backupset.subclients.get(‘default’)

subclient.storage_policy = ‘MyStoragePolicy’


1 reply

Userlevel 2
Badge +9

Hi @tonytony 

 

Have you tried ?

subclient2 = backupset.subclients.add(subclient_namestorage_policydescription)

ubclients

subclient

Performs operations on all subclients associated with a backup set

  •  

  • subclient1 = instance.subclients.add(subclient_namestorage_policydescription)

  • subclient2 = backupset.subclients.add(subclient_namestorage_policydescription)

ref: Operations for the Developer SDK for Python (commvault.com)

 

Regards,

Suleman

Reply