5. vCloud Resource Design : 5.10 Storage Independent of Virtual Machines : 5.10.1 Independent Disk Architecture
   
5.10.1 Independent Disk Architecture
The independent disk feature consists of:
*A DB schema to represent independent disks in vCloud Director and their associated backing in vSphere.
*A set of methods which implement the external vCloud Director API by manipulating the DB schema and invoking the VIM API.
*A set of event handlers invoked by the VC Listener which allow vCloud Director to keep track of relevant VC activity. For example, vSphere Storage vMotion initiated by SDRS, or vSphere Client.
Virtual disks in vSphere do not necessarily have unique IDs. For example, when a virtual disk is cloned (virtual machine clone) in vSphere, the new virtual machine receives a unique ID, but the disk IDs are reused. Also, the vSphere disk ID could actually be changed at any point using the vSphere API, which would break the vCloud Director reference pointer if it were the unique ID.
Therefore, vCloud Director generates and uses its own identifier for independent disks, persisted in the vCloud Director DB. vCloud Director does not currently have the API infrastructure to support adding the vCloud Director disk ID to the disk metadata in the VMDK files.
A disk becomes detached in vCenter when a virtual machine using that disk gets deleted in vCloud Director, but the disk must be saved for future virtual machines. Because detached disks are not known objects in vSphere, features such as Storage Distributed Resource Scheduling (SDRS) are unable to migrate these detached independent disks. To aid in this situation, vCloud Director creates a virtual machine shell for each detached virtual disk and attaches the disks to this new shell. If the independent disk needs to be attached to a new virtual machine, the shell is then deleted.
In the event that a delete action takes places before an attach action, vCloud Director performs a check to verify that the disk is attached to a virtual machine object before completing the delete request to avoid inadvertently deleting the independent disk.
In the event that actions are taken against the vCenter (through the UI or API), certain update actions are either safe or are unsafe to perform:
*Storage vMotion or virtual machine relocate actions are safe actions to perform. vCenter will update vCloud Director with the revised locations of the disk files.
*Disk add and disk remove actions are unknown to vCloud Director and the disk location(s) are unknown. Therefore, disk add and disk remove actions are unsafe to perform.