What are the steps to export a VM using the vmware vcenter 7 rest api

Viewed 446

I'm attempting to build some custom automation to handle the import / export of VM's to / from an on-prem vmware cluster.

So far I have authenticated the rest api, can get a VM's info, but I cannot work out how to approach exporting the selected VM.

I believe I'll need to create a download session & iterate through its files, saving them to disk one by one whilst keeping the download session alive, but the documentation seems to skirt around the concept of exporting a VM and focus predominantly on deploying.

Does anyone have an example / list of steps required to achieve exporting a VM via the Rest API?

2 Answers

As of 7.0U2, that functionality doesn't exist in the vSphere Automation (REST) API. Here are the top level VM functions: link

If you're open to using the vSphere Web Services (SOAP) API, there's an exportVM function available: link

Related