VMware Cloud Community
timothree
Contributor
Contributor

Using REST API to mount an ISO image from a content library to a live VM

We're trying to implement the functionality described here. So I list the library items and use the ID of the relevant image returned from this endpoint. However, when POSTing to the Mount image endpoint, I will get a 400 error with the following error message:

The library item (debian-11.1.0-amd64-netinst) cannot be mounted on the virtual machine (XYZXYZ) in the current state: poweredOn. The virtual machine must be in the state: poweredOff.

 Using the GUI to mount the same image works without powering off the VM.

I found this thread, which seems to have dealt with a similar problem. But they were using the PowerCLI, with which I'm not familiar so I don't fully understand the solution. Also the solution there apparently required the use of a different UUID (returned "via the VimDatastore provider"?), whereas the error message above seems to show that the correct library item was found.

Appreciate any input on this 🙂

0 Kudos
0 Replies