Does anyone have a working example?
Page 1 / 1
You can do this with Version 2 of the api but you will need to gather some information about the VM first.
Here is the endpoint where {uuid} is the UUID of the VM that you want to attach the disk to:
This is will attach a disk with the specified UUID to the Specified VM as Thin provisioned on scsi.1 interface.
You can add ISOs to CDRoms in the same manner and the same for snapshots.
- You must have the VM UUID you can get this from the /PrismGateway/services/rest/v2.0/vms/ endpoint {{VM_UUID}}
- You must have the vmdisk_uuid of the disk in the Image Services from the endpoint /PrismGateway/services/rest/v2.0/images/ endpoint {{vmDISK_UUID}}
Here is the endpoint where {uuid} is the UUID of the VM that you want to attach the disk to:
/PrismGateway/services/rest/v2.0/vms/{uuid}/disks/attach
Here is an example JSON body for rest callcode:
{
"uuid": "{{VM_UUID}}",
"vm_disks": [
{
"disk_address": {
"device_bus": "SCSI",
"device_index": 1,
"vmdisk_uuid": "{{vmDISK_UUID}}"
},
"is_scsi_pass_through": true,
"is_thin_provisioned": true,
"vm_disk_clone": {
"disk_address": {
"device_bus": "SCSI",
"device_index": 1,
"vmdisk_uuid": "{{vmDISK_UUID}}"
}
}
}
]
}
This is will attach a disk with the specified UUID to the Specified VM as Thin provisioned on scsi.1 interface.
You can add ISOs to CDRoms in the same manner and the same for snapshots.
What do you mean by "... the same for snapshots"?
I should have clarified:
Snapshots that are part of a protection domain and consistency group.
Snapshots that are part of a protection domain and consistency group.
That worked. Thanks!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.