DisksManResource


Create a hard disk in a virtual datacenter


Create a new hard disk in a virtual datacenter available for use on any VM.
  • If the request body includes a ''disk'' link and it's an ISO VM template disk, create a new hard disk to represent it
  • Otherwise, create a new empty hard disk with the capacity specified in the request body

POST https://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/disks

Roles : [ROLE_MANAGE_HARD_DISKS]

Content-Type : harddisk Accept : harddisk

Error Codes

  • CONSTR-MIN - Parameter 'virtualdatacenter' must be greater than or equal to 1 but value '-40' was found
  • GEN-24 - The requested disk controller is not supported by the hypervisor plugin
  • GEN-25 - The current hypervisor plugin does not support ISO format
  • GEN-4 - Not enough permissions to perform this action
  • HD-14 - It's only possible to create a new hard disk from an ISO disk
  • HD-7 - Cannot create a hard disk because this feature is not available for this hypervisor

Example

List hard disks in a virtual datacenter


GET https://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/disks

Roles : [ROLE_MANAGE_HARD_DISKS, ROLE_VDC_ENUMERATE]

Accept : harddisks

Error Codes

  • CONSTR-MIN - Parameter 'virtualdatacenter' must be greater than or equal to 1 but value '-12' was found

Example

Delete a hard disk in a virtual datacenter


This method will raise an exception if the hard disk is currently used by a VM.

DELETE https://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/disks/{disk}

Roles : [ROLE_MANAGE_HARD_DISKS]

Example

Get a hard disk in a virtual datacente


GET https://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/disks/{disk}

Roles : [ROLE_MANAGE_HARD_DISKS, ROLE_VDC_ENUMERATE]

Accept : harddisk

Error Codes

  • CONSTR-MIN - Parameter 'virtualdatacenter' must be greater than or equal to 1 but value '-12' was found
  • HD-1 - The requested hard disk does not exist

Example

Update a hard disk in a virtual datacenter


Update an existing disk in a virtual datacenter. You can modify the following attributes: name, description, sizeInMB (increase only)

PUT https://example.com/api/cloud/virtualdatacenters/{virtualdatacenter}/disks/{disk}

Roles : [ROLE_MANAGE_HARD_DISKS]

Content-Type : harddisk Accept : acceptedrequest

Error Codes

  • ALLOC-1 - Cannot make the requested changes to the virtual machine because there are not enough free resources on the host machine. Please contact the Administrator.
  • GEN-24 - The requested disk controller is not supported by the hypervisor plugin
  • HD-10 - Invalid hard disk attachment sequence number
  • HD-12 - The hard disk cannot be edited because it is being used by a virtual machine
  • HD-13 - The hard disk cannot be resized because the virtual machine is not deployed
  • HD-15 - Only the IDE disk controller type is supported for the ISO disk format type
  • HD-16 - The hard disk cannot be resized because it is using the ISO disk format type
  • HD-17 - Cannot modify sequence 0; use virtual machine edit to reorder attached disks
  • HD-3 - Invalid disk size.
  • SCALING-GROUP-16 - The scaling group must be in maintenance mode in order to apply the requested operation

Example