Another nice little feature in the recently released vCloud Director 8.10 (read eight dot ten) is the ability to import running VM under vCloud Director management.
In the past the vCloud system administrator could import virtual machine running in vCloud Director managed vSphere environment, however that VM had to be turned off.
Now in vCloud DIrector 8.10 the VM can be running which enables new use cases:
- You can take existing vSphere environment under management of vCloud Director without impacting the workloads. Example would be going from vSphere only managed services to self service with vSphere + vCloud Director
- Migrations of running VMs from vSphere to vCloud Director or between vCloud Directors. Cross vCenter Server vMotion nicely complements this feature. Cross-Cloud vMotion.
There are currently some limitations and considerations:
- It is API only feature. The GUI button (above) can be used to import only powered-off VMs.
- VM must be running on resources that are available to the Org VDC where it is being imported. That includes compute (cluster), storage policies and network port group. Obviously the networking is the most complex to get it right during the migration and requires some thought.
- Import of VM with IDE controller is not supported.
- A new vApp is created for the imported VM. You cannot import VM to an existing vApp.
- As an input to the API call MoRef ID of the VM must be provided. The existing vCloud API call to list vSphere VMs outside of vCloud Director management however does not list running VMs. Therefore the MoRef ID must be acquired with vSphere API.
POST https://vcd-01a.corp.local/api/admin/extension/vimServer/3702cc8f-c23f-4a66-b9f3-73fc4b58ba82/importVmAsVApp Accept: application/*+xml;version=20.0 x-vcloud-authorization: 3e131f9e3bc240269a7758fdb6c1bf7f Content-type: application/vnd.vmware.admin.importVmAsVAppParams+xml <?xml version="1.0" encoding="UTF-8"?> <ImportVmAsVAppParams xmlns="http://www.vmware.com/vcloud/extension/v1.5" name="ImportedTestVM" sourceMove="true"> <VmMoRef>vm-86</VmMoRef> <Vdc href="https://vcd-01a.corp.local/api/vdc/a10bdf92-18dc-474b-aafc-42d31ba83207" /> </ImportVmAsVAppParams>