Skip to main content
Solved

REST API call for PowerShell command Get-CVVirtualMachine

  • September 1, 2022
  • 3 replies
  • 146 views

Forum|alt.badge.img+3

What can replace the "Get-CVVirtualMachine" PowerShell command in the Commvault REST API?

I use the "Get-CVVirtualMachine -Protected" command to get a list of virtual machines that are being backed up so that I can start a restore.

Looked at the API page on my Commvault server (https://CommvaultSRV/webconsole/sandbox/apiexplorer/#/Virtualization%20Operations) and I couldn't identify any GET command that would give me the same result as the PowerShell command.

 

Does anyone have any idea how to get a list of all protected VMs from Commvault REST API?

Best answer by VladimirP

In case somebody has the same question, I checked and "slaCategoryDescription=Protected" is not actually the same as "Get-CVVirtualMachine -Protected".

I had two VMs in backup, then I deleted one VM from Commvault, but the "Get-CVVirtualMachine -Protected" command returned that I have two protected VMs (assuming because the backup hasn't expired).

When I checked "slaCategoryDescription" I saw that the existing VM has "slaCategoryDescription=Protected" but deleted VM has "slaCategoryDescription=Deconfigured".

View original
Did this answer your question?

3 replies

Forum|alt.badge.img+3
  • Author
  • Bit
  • 9 replies
  • September 1, 2022

I found solution to list VMs in this post:

https://community.commvault.com/commvault-q-a-2/api-call-to-get-information-about-vms-which-are-present-in-vmgroup-3034 

Can I consider that "slaCategoryDescription = Protected" is the same filter as in PowerShell command "Get-CVVirtualMachine -Protected"?


Forum|alt.badge.img+3
  • Author
  • Bit
  • 9 replies
  • Answer
  • September 1, 2022

In case somebody has the same question, I checked and "slaCategoryDescription=Protected" is not actually the same as "Get-CVVirtualMachine -Protected".

I had two VMs in backup, then I deleted one VM from Commvault, but the "Get-CVVirtualMachine -Protected" command returned that I have two protected VMs (assuming because the backup hasn't expired).

When I checked "slaCategoryDescription" I saw that the existing VM has "slaCategoryDescription=Protected" but deleted VM has "slaCategoryDescription=Deconfigured".


Onno van den Berg
Commvault Certified Expert
Forum|alt.badge.img+19
  • Commvault Certified Expert
  • 1228 replies
  • September 1, 2022

@VladimirP thanks for sharing! so it's quite confusing ;-s based on your finding I would say slaCategoryDescription should be renamed into something like vmBackupState. you b.t.w. might consider looking if there is a v4 API call to create the list as it might output the information differently. 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings