Unmount ISO on VM using Rest API Vcenter 6.5

Has anyone had success unmounting an ISO on a VM using vcenter’s RestAPI? I keep getting error 415 unsupported media type.

I’m using the following:



code used:

* i already have a session created and i’m able to pull other info, just unable to trigger an unmount.


$body = ‘{“cdrom”:”16000″}’
Invoke-WebRequest -uri “https://$vcenter/rest/com/vmware/vcenter/iso/id:$($vm.vm)?~action=unmount” -Body $body -Headers $session -Method Post

i’ve tried several variations of the body format but nothing seems to work. thanks in advance.
The vms are windows 10

View Reddit by admoseleyView Source

Related Articles

One Comment

  1. What OS are you trying to unmount from? Linux OS’s cause a VM to pause until you answer the question in vCenter or on the host. Something to the effect of “the operating system has locked this ISO are sure you want to forcefully remove it?”

    Not sure if that is what is happening, but that hung me up with a PowerShell script previously. Not using Rest API, though.

Leave a Reply