DisksResource


Copy a disk in a virtual machine template


Copy a disk, specifying in the body the sequence position where the new disk should be copied to.

POST https://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}/disks

Roles : [ROLE_VAPP_CREATE_STATEFUL, ROLE_APPLIB_ALLOW_MODIFY]

Content-Type : diskrequest Accept : acceptedrequest

Example

Create an empty disk in a virtual machine template


When you create an empty disk, you are not allowed to supply the following attributes: path, diskFileSize, and diskFormatType

POST https://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}/disks

Roles : [ROLE_VAPP_CREATE_STATEFUL, ROLE_APPLIB_ALLOW_MODIFY]

Content-Type : disk Accept : disk

Example

List disks of a virtual machine template


Retrieve disks of the VM template.

GET https://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}/disks

Roles : [ROLE_APPLIB_VIEW, ROLE_VDC_ENUMERATE, ROLE_VDC_MANAGE_VAPP, ROLE_VAPP_CUSTOMISE_SETTINGS, ROLE_VAPP_CREATE_STATEFUL]

Accept : disks

Example

Delete a disk of a virtual machine template


DELETE https://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}/disks/{disk}

Roles : [ROLE_APPLIB_ALLOW_MODIFY, ROLE_VAPP_CREATE_STATEFUL]

Example

Get a disk of a virtual machine template


GET https://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}/disks/{disk}

Roles : [ROLE_APPLIB_VIEW, ROLE_VDC_ENUMERATE, ROLE_VDC_MANAGE_VAPP, ROLE_VAPP_CUSTOMISE_SETTINGS, ROLE_VAPP_PERFORM_ACTIONS, ROLE_VAPP_DEPLOY_UNDEPLOY, ROLE_VAPP_ASSIGN_NETWORK, ROLE_VAPP_ASSIGN_VOLUME, ROLE_VAPP_CREATE_STATEFUL, ROLE_PHYS_DC_RETRIEVE_DETAILS, ROLE_MANAGE_HARD_DISKS]

Accept : disk

Example

Update a disk of a virtual machine template


PUT https://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}/disks/{disk}

Roles : [ROLE_APPLIB_ALLOW_MODIFY, ROLE_VAPP_CREATE_STATEFUL]

Content-Type : disk Accept : disk

Error Codes

  • DISK-6 - Cannot modify disk sequence. Edit the virtual machine template.
  • DSTIER-0 - The requested datastore tier does not exist
  • DSTIER-9 - The original enterprise is not allowed to use the given tier

Example

List tasks on a disk of a virtual machine template


Displays the tasks on the disk. Tasks are a set of jobs (operations). Any of these tasks may still be in progress.

GET https://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}/disks/{disk}/tasks

Roles : [ROLE_APPLIB_VIEW, ROLE_VDC_ENUMERATE, ROLE_VDC_MANAGE_VAPP, ROLE_VAPP_CUSTOMISE_SETTINGS, ROLE_VAPP_PERFORM_ACTIONS, ROLE_VAPP_DEPLOY_UNDEPLOY, ROLE_VAPP_ASSIGN_NETWORK, ROLE_VAPP_ASSIGN_VOLUME, ROLE_VAPP_CREATE_STATEFUL, ROLE_PHYS_DC_RETRIEVE_DETAILS, ROLE_MANAGE_HARD_DISKS]

Accept : tasks

Get a task on a disk of a virtual machine template


Displays a specific task on the disk. Tasks are a set of jobs (operations on hypervisors). Any of these tasks may still be in progress. Each task has a UUID.

GET https://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}/disks/{disk}/tasks/{id}

Roles : [ROLE_APPLIB_VIEW, ROLE_VDC_ENUMERATE, ROLE_VDC_MANAGE_VAPP, ROLE_VAPP_CUSTOMISE_SETTINGS, ROLE_VAPP_PERFORM_ACTIONS, ROLE_VAPP_DEPLOY_UNDEPLOY, ROLE_VAPP_ASSIGN_NETWORK, ROLE_VAPP_ASSIGN_VOLUME, ROLE_VAPP_CREATE_STATEFUL, ROLE_PHYS_DC_RETRIEVE_DETAILS, ROLE_MANAGE_HARD_DISKS]

Accept : task

Example

Make unavailabe a disk of a virtual machine template


To prevent users from creating new VMs from a disk, mark the disk as unavailable. This method removes the disk files from the datacenter repository filesystem but keeps the reference to the disk in the API (state = UNAVAILABLE). Use this method when you are not allowed to delete a disk because it is in use by VMs or instances

POST https://example.com/api/admin/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}/disks/{disk}/action/deletefile

Roles : [ROLE_VAPP_CREATE_STATEFUL, ROLE_APPLIB_ALLOW_MODIFY]

Example