To remove an independent disk, verify that no powered-on virtual machine is attached to it, then use a DELETE request to delete it.

A Disk element includes a link of the following form, which you can GET to return a list of virtual machines to which the disk is attached.
<Link
   rel="down"
   type="application/vnd.vmware.vcloud.vms+xml"
   href="https://vcloud.example.com/api/disk/128/attachedVms" />
There are also two queries that you can use to return a list of virtual machines, the disks connected to them, and the VDC that contains them:
vmDiskRelation
Lists this information for Vm and Disk objects that you own.
AdminvmDiskRelation
Lists this information for all Vm and Disk objects in a cloud (system administrators only).

You can use the vmDiskRelation query to return a list of virtual machines that you own, Disk objects that are connected to them, and the VDC that contains them.

Note: An independent disk can be attached to at most one virtual machine.

Prerequisites

This operation requires the rights included in the predefined vApp Author role or an equivalent set of rights.Verify that you are logged in to the vCloud Air Compute Service as an Account Administrator.

Procedure

  1. Verify that the independent disk is not connected to any virtual machine.
  2. Delete the independent disk.
    Make a DELETE request to the URL in the rel="remove" link in the Disk.

Results

The server starts a task to manage the events that lead up to the removal of the object, and returns a Task element that you can use to track the progress of the task.

Example: Remove an Independent Disk

Request:
DELETE https://vcloud.example.com/api/disk/128
Response:
202 Accepted
...
<Task 
   ...
   operation="Deleting Disk (128)" 
   ... >
</Task>