Hi Folks,
I have a few machines I would like to convert from IDE to SCSI.
I understand this can be done with acli. The procedure is to clone the ide disk and replace it for the VM.
nutanix@cvm$ acli vm.disk_create <vm_name> clone_from_vmdisk=<vmdisk_UUID> bus=scsi
However, I’d like to do this in PowerShell given I’ve already started developing down that track. I have PowerShell cmdlets to snapshot and shutdown the VM which are recommended steps before performing this task.
I didn’t see a cmdlet to perform the clone and replacement, so I turned to the REST API.
I am fairly new to Nutanix to I wanted to get some feedback on whether this is the right approach or at least that its not going to break anything other than my test VM.
$uri = "https://$ntxCluster/api/nutanix/v2.0/vms/$($vm.vmid)/disks/attach"
$body = '{"uuid":"abcdefg-08h3-4i44-95j0-kl44m82no758","vm_disks":8{"vm_disk_clone":{"disk_address":{"device_bus":"SCSI","device_index":123}}}]}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri $uri -Method POST -Headers $headers -ContentType 'application/json' -Body $body
Thanks,
Michael