The Independent Disk feature in vCloud Director is, despite the name, something completely different from an Independent Disk in vSphere. This quote straight from the From the vCloud Architecture Toolkit:
“__The use of independent disks with vCloud Director 5.1 allows updates of virtual machines without impacting the underlying data. For example, we can detach the data disk from the existing virtual machine, delete the existing virtual machine, recreate this virtual machine, and reattach the original disk. This feature is a key enabler to enhance the deployment of a Cloud Foundry PaaS cloud within a vCloud environment.”
In vSphere, an Independent Disk is one that is not included in VM snapshots. In vCloud Director, an Independent Disk in essentially just a VMDK file that can be moved between VMs. It’s been a feature since vCloud Director 5.1, but it isn’t something that I’ve looked at in any detail and none of our customers on vCloud has had a use case that would demand it until now.
Unfortunately it’s not possible (at least not yet) to work with Independent Disks via the vCloud Director UI. You have to use the vCloud API, although it’s reasonably simple to do if you’re comfortable using REST APIs. If you’re not, then there’s a great blog post from VMware that may help you get started using the RESTClient in Firefox.
You need the URL for your VDC (in this example case it was https://vcd.mycloud.com/api/vdc/40cd7d91-7959-4ae0-acb0-691082d5290f/). You then put together a DiskCreateParams element and POST it to https://YOUR-VDC-URL/disk.
In my example:
URL | https://vcd.mycloud.com/api/vdc/40cd7d91-7959-4ae0-acb0-691082d5290f/disk |
Action | POST |
Content-Type | application/vnd.vmware.vcloud.diskCreateParams+xml |
Request Body | <?xml version="1.0" encoding="UTF-8"> <DiskCreateParams xmlns="http://www.vmware.com/vcloud/v1.5"> <Disk name="IndDisk_DBFiles1" size="53687091200" busType="6" busSubType="lsilogicsas"> <Description>Independent Disk for DB Files<?/Description> </Disk> </DiskCreateParams> |
A couple of things to note:
- The size is in bytes so if you want a 50GB file then it’s going to be 53687091200
- The type of disk controller that will be used when it is connected to a VM is actually set when the disk is created. If you don’t specify anything, it’ll default to being an LSI Logic Parallel controller. Consider what OS you’ll be connecting the disks to and what the best controller is. In my case I was using Windows Server 2012 R2 VMs for testing and I wanted LSI Logic SAS controllers to be used, so I set that when I create my independent disk.
Anyway… There will be quite a long response back from vCloud, including the reference to the disk that is being created. Note the status=”0” denotes that the disk creation is not complete but, if you’ve not received an error, then it’s creating it.
<Disk size="53687091200" status="0" name="IndDisk_DBFiles1" id="urn:vcloud:disk:09ab6551-a5f0-4649-8cbe-bd2a62d22573" href= "https://vcloud.mycloud.com/api/disk/09ab6551-a5f0-4649-8cbe-bd2a62d22573" </disk>
There is no way to manage a VMDK disk file in vSphere (like shifting it to a new datastore) unless it’s connected to a VM, so VM so vCloud Director creates a “Disk Shell VM” to attach the independent disk file to while it’s not connected to any real VM. You can see the disk shell VM in vSphere Client under a new folder called “Disk Shell VMs” in the folder that represents the customers Org VDC.
If you have a look at the properties of the disk on the new Disk Shell VM, you will see that it is an Independent Disk. That is, an “Independent Disk” in the vSphere sense of the word, in that it will not be included in snapshots.
Although you can’t manage Independent Disks in the vCloud Director UI, once you’ve created one then a new tab will appear in the UI showing you the Independent Disks that exist in your VDC. This was the case on the vCloud Director 5.6 instance I tested this on and I don’t believe it’s changed in 8.10. VMware have started developing the UI again so it’s possibly we may gain the ability to manage Independent Disks through the UI in future.
Next up, how to attach and detach Independent Disks.