Initiate Backup for 1 specific VM using command line

  • 11 January 2024
  • 2 replies

Badge +2

Hi! I am working on VM onboarding PS automation for CV, and I can not find the way how to trigger backup for 1 specific VM (which is final step for onboarding process in our company)

The only solution I found is: Backup-CVVirtualMachine, but unfortunately it returns me 404 error.

Other ways allow to run backup for Backup Sets only which is not ok for me 😐

Is there any other way I missing?

Thank you


Best answer by Albert Williams 13 January 2024, 01:28

View original

2 replies

Userlevel 7
Badge +19

@Alexey Tesov can you use other cmdlets without issues and are you running a "compatible” version of the Powershell SDK? This cmdlets should just work and when it generates a 404. Alternatively in case you are a experienced Powershell coder you can also retrieve the actual API call that is triggered when using the Backup-CVVirtualMachine cmdlet by opening Command Center and performing a VM-level backup from there see:

I would in all honesty stay away from the old save as script method as this requires the script to be executed on a system with an agent installed on it already. It is also much harder to integrate this into existing scripts. 

Userlevel 5
Badge +12

Hello @Alexey Tesov 

Thanks for the great question! I would recommend going to the VM its self ( assuming you are using V2 VSA client ) in the Java console and attempting to start a backup. Before you hit submit you can click “save as script”. If you are not using V2 you can only run on subclients level that contains a group of VM’s. you wont be able to run a job with just one VM in it in that case. 

This will give you the frame work on the commands you need to run and then edit them as needed for your other clients. 

Kind regards

Albert Williams