REST API: Attaching an existing .vhd to a stopped VM
-
I am automating VM deployments using XOA's REST API. I am successfully deploying a VM from a template and uploading a VHD to one of my SRs. The final step in my automated deployment is attaching this existing VHD that i uploaded to the newly created, halted VM.
I also need to select which .iso is inserted into the CD drive. Is that something configured at the template level? I thought I had done that prior to converting my template.
I saw some discussions about attaching an existing VDI a year ago in the forums, so I am not sure if anyone has asked recently. I am not sure if attaching a disk to a stopped VM after it was newly created is an endpoint I might have missed.
Is this handled under an action sub-URL?
-
You attach a VDI to a VM by creating a VBD. Take a look at the
POST /vbdsendpoint. -
@Danp Thanks! Also, I converted my VM to a template and it had the .iso in it prior to doing that but then when i spin it up from the REST API the .iso is gone?
-
@Danp They're all GET methods no way to mount anything.

-
@Bytevenidos Are you up-to-date?


-
Updated now!

-
@Danp How about the CD-ROM with the .iso? Can i mount that on the VM using these also ?
-
@Bytevenidos I don't see an endpoint in the REST API for mounting an ISO. However, you should be able to mount the ISO during the VM creation. I will ask around about using the REST API to mount and eject ISOs.
