Hello @DarrenP
There is a provision in v2 API to update a Virtual machine with a vdisk, and specify the vdisk size and container UUID.
So you can simply create a virtual machine and then call this API endpoint to update the VM.
The full API call is
{
"uuid": "string",
"vm_disks": [
{
"disk_address": {
"device_bus": "SCSI",
"device_index": 123,
"device_uuid": "string",
"disk_label": "string",
"is_cdrom": true,
"ndfs_filepath": "string",
"vmdisk_uuid": "string",
"volume_group_uuid": "string"
},
"flash_mode_enabled": true,
"is_cdrom": true,
"is_empty": true,
"is_scsi_pass_through": true,
"is_thin_provisioned": true,
"vm_disk_clone": {
"disk_address": {
"device_bus": "SCSI",
"device_index": 123,
"device_uuid": "string",
"disk_label": "string",
"is_cdrom": true,
"ndfs_filepath": "string",
"vmdisk_uuid": "string",
"volume_group_uuid": "string"
},
"minimum_size": 123,
"snapshot_group_uuid": "string",
"storage_container_uuid": "string"
},
"vm_disk_create": {. <---------------VM Disk create
"size": 123, <-------------Size
"storage_container_uuid": "string" <-------Container
}
}
]
}
You can use this documentation for more info
https://www.nutanix.dev/reference/prism_element/v2/api/vms/post-vms-uuid-disks-attach-attachvmdisk/