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?
Page 1 / 1
Could you please share they code? Please redact UUIDs.
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_listt]|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
I’ll try it. I had data_source_reference, but didn’t try and set the size elements. I’ll give that a shot. Thank you for the feedback.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.