1.5

Table Of Contents
3 Find the action/relocate link for the Vm, and note the datastore that the Vm currently occupies.
This fragment of the response to the request made in Step 2 includes the action/relocate link and the
reference to the datastore that the Vm currently occupies.
<Vm
xmlns="http://www.vmware.com/vcloud/v1.5"
... >
<VCloudExtension
required="false">
...
<vmext:VimObjectRef>
<vmext:VimServerRef
type="application/vnd.vmware.admin.vmwvirtualcenter+xml"
name="VC1"
href="https://vcloud.example.com/api/admin/extension/vimServer/35" />
<vmext:MoRef>datastore-191</vmext:MoRef>
<vmext:VimObjectType>DATASTORE</vmext:VimObjectType>
</vmext:VimObjectRef>
</VCloudExtension>
...
<Link
rel="relocate"
type="application/vnd.vmware.vcloud.relocateVmParams+xml"
href="https://vcloud.example.com/api/vApp/vm-257/action/relocate" />
...
</Vm>
4 Construct a RelocateParams element that specifies the destination datastore for the Vm.
See “Example: Relocate a Virtual Machine,” on page 193.
5 POST the RelocateParams element to the action/relocate link described in Step 3.
You do not need to power off the virtual machine before you make the request. See “Example: Relocate a
Virtual Machine,” on page 193.
The system creates a task to manage the relocation and returns a Task element in the response. When the task
is complete, the virtual machine is relocated.
Example: Relocate a Virtual Machine
This request relocates the virtual machine retrieved in Step 2 to one of the datastores listed in Step 1. The
response is a Task.
Request:
POST https://vcloud.example.com/api/vApp/vm-257/action/relocate
Content-Type: application/vnd.vmware.vcloud.relocateVmParams+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<RelocateParams
xmlns="http://www.vmware.com/vcloud/v1.5">
<Datastore
href="https://vcloud.example.com/api/admin/extension/datastore/607" />
</RelocateParams>
Chapter 7 Using vCloud API Extensions to Provision and Manage a Cloud
VMware, Inc. 193