How can I attach a disk from the image service to an exiting VM?
+1
Does anyone have a working example?
This topic has been closed for comments
+1
That worked. Thanks!
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.
+1
What do you mean by "... the same for snapshots"?
You can do this with Version 2 of the api but you will need to gather some information about the VM first.
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}}
/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.
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.