1.5
Table Of Contents
- vCloud API Programming Guide
- Contents
- vCloud API Programming Guide
- About the VMware vCloud API
- Hello vCloud: A Simplified RESTful Workflow
- Exploring a Cloud
- Provisioning an Organization with vApps, Templates, and Media
- Deploying and Operating vApps
- Summary of vCloud API vApp and Virtual Machine Operations Requests
- Create a vApp From a Template
- Compose a vApp From Existing Virtual Machines
- Recompose a vApp to Add or Remove Virtual Machines
- Operate a vApp
- Configuring vApps and Virtual Machines
- Retrieve the Configuration Links for a vApp
- Retrieve the Configuration Links for a Virtual Machine
- Retrieve or Update a Modifiable Section
- Update a vApp Network Configuration
- Update the NetworkConnectionSection of a Virtual Machine
- Retrieve or Modify the CPU Configuration of a Virtual Machine
- Retrieve or Modify the GuestCustomizationSection of a Virtual Machine
- Retrieve or Modify ProductSection Elements
- Retrieve or Modify Groups of Related Sections in a Virtual Machine
- Retrieve or Modify the Hard Disk Configuration of a Virtual Machine
- Creating, Provisioning, and Managing Organizations
- Summary of Administrative Requests
- Administrator Credentials and Privileges
- Organization Administration
- Network Administration
- vDC Administration
- Catalog Administration
- User and Group Administration
- Working With Roles and Rights
- Controlling Access to vApps and Catalogs
- Using vCloud API Extensions to Provision and Manage a Cloud
- Working With Object Metadata
- Using the Query Service
- Configuring and Using Blocking Tasks and Notifications
- XML Representations in the vCloud API
- Index
Relocate a Virtual Machine to a Different Datastore
A Vm element, whether part of a Vapp or VappTemplate element, includes an action/relocate link that you can
use to move the virtual machine to a different datastore
In both vApps and vApp templates, virtual machines are defined by a combination of metadata in the
vCloud Director database and virtual disk files stored on a datastore in the cloud. vCloud Director determines
the initial location of this datastore based on how the virtual machine was created. You can move the disk files
to another datastore in the cloud by POSTing a RelocateParams element to the virtual machine's
action/relocate link.
When a virtual machine is deployed in a vDC that supports fast provisioning, its disks can become part of a
tree structure that includes parent and child disks. Disk tree structure and total storage consumption remain
the same regardless of the order in which virtual machines are relocated The folder structure in the target
datastore might change depending on the order in which virtual machines are relocated.
Prerequisites
Verify that you are logged in as a system administrator.
Procedure
1 List the datastores available in the cloud.
Use a request like this one.
GET https://vcloud.example.com/api/admin/extension/datastores
The response is a DatastoreReferences element, as shown here:.
<vmext:DatastoreReferences
xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5"
xmlns:vcloud="http://www.vmware.com/vcloud/v1.5"
type="application/vnd.vmware.admin.datastoreList+xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://vcloud.example.com/api/v1.5/schema/master.xsd">
<vcloud:Link
rel="up"
type="application/vnd.vmware.admin.vmwExtension+xml"
href="https://vcloud.example.com/api/admin/extension" />
<vcloud:Reference
type="application/vnd.vmware.admin.datastore+xml"
name="example-lun2"
href="https://vcloud.example.com/api/admin/extension/datastore/607" />
<vcloud:Reference
type="application/vnd.vmware.admin.datastore+xml"
name="example-lun4"
href="https://vcloud.example.com/api/admin/extension/datastore/191" />
</vmext:DatastoreReferences>
2 Retrieve the representation of the virtual machine.
The following request retrieves a Vm from a Vapp:
GET https://vcloud.example.com/api/vApp/vm-257
vCloud API Programming Guide
192 VMware, Inc.