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?
Best answer by Chandru
Here is curl and jq combo that works in unmounting the cd rom for a single cdrom attached vm.
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