Skip to main content

I am trying to create a workflow to run multiple VSA backups through workflow by just selecting the client from the list. For VSA backup it is not working. Same is working for File System level backup. Is there some limitation to run for VSA backup? If yes, what is the easiest way to achieve this. Tried from Rest API as well but we need to give vm name and client name which becomes a bit complex.

 

Hi @Rahul Nair,

 

This command isn’t working due to how the Version 2 Virtual Server agent operates.  That subclient that you are pointing to (the default subclient that is displayed underneath an individual VM) is really pointing back to the VSA Subclient / VM Group on the Hypervisor that defines that particular VM. 

 

Since that VSA Subclient / VM Group can define multiple VMs, in order to protect 1 specific VM we will need to pass the VM GUID.  Hence that activity for triggering a backup won’t work for this particular use-case.

 

There are a few ways to go about this.  One method would be to leverage REST API, which you mentioned in your original question.  The correct API for this would be POST VM Backup, which again does require the vmGUID as a parameter. 

 

The vmGUID parameter can be obtained either by using a GET VM API, or alternatively you could use a CommservDBQuery activity to query the vmGUID out of the Commserv Database directly, and then pass that value into your HttpClient activity (which is the Activity that Workflows use to execute REST API).

 

Any way forward will require you to obtain the GUID for the VM you want to trigger an individual backup for.  If you wanted to try testing this for yourself before building out the full automation, there may be a very simple way for you to do so without going through too many steps.  Depending on your installed version of Commvault, we have added ‘Equivalent API’ buttons to many areas of the Command Center that allows you to simply copy / paste the REST API call necessary to trigger an operation that you can also trigger directly in the UI.

 

For example, let’s say I were to attempt to trigger a backup of 1 specific VM in my CPR 2023E (11.32) lab.  You’ll notice at the bottom of the window there is a clickable button that says ‘Equivalent API’ :

 

 

 

When I click that, it will show me the API payload that I need to trigger that exact same operation.  In this case, we see it’s using a CreateTask API (which is another API in addition to the POST VM Backup API I mentioned earlier), and it has done the work of obtaining that GUID / UUID for me.  All you have to do is copy / paste

 

 

You could then test this by either using a tool like Postman, or by using HttpClient activities inside of a Workflow to execute this API and confirm it triggers a backup.  Once you have that, it would be a matter of creating either a CommservDBQuery activity to pull the GUIDs from the database, or using other HttpClient activities to pull that value via API so that you could run this against any of your VMs.

 

I hope this helps!

 

-Brian Bruno


Reply