I am struggling to get my VM to unmount the ISO via the PC v3 API. I’m performing a GET, to get the VM Info, I’ve attempted to update the vm with data_source_reference removed, PC updates, but the iso is still attached. I see different references with V1 on PE, but can’t seem to do it via v3. anyone had any luck?
Solved
Unmount ISO CD-ROM via PC V3 API
Best answer by Chandru
Here is curl and jq combo that works in unmounting the cd rom for a single cdrom attached vm.
url='https://<pc_ip>:9440/api/nutanix/v3/vms/<vm_uuid>'
curl -k -s -u admin "$url" | jq 'del(.status)|del(.spec.resources.disk_list[]|select(.device_properties.device_type == "CDROM") | .data_source_reference,.disk_size_bytes,.disk_size_mib)' | curl -k -s -u admin "$url" -H "Content-type:application/json" -XPUT -d @-
Replace pc_ip and vm_uuid with appropriate values
This topic has been closed for comments
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.