You can change the
VDC compute policy of a virtual machine by sending a PUT request to the
reconfigureVm link of
the virtual machine.
For information about VDC
compute policies, see
Managing VM-Host Affinity Rules.
Prerequisites
- You must be a
system
administrator,
organization
administrator,
vApp
Author, or
vApp
User.
- The
system
administrator published the new VDC compute policy to the
organization VDC of the target virtual machine.
Procedure
-
Retrieve the
Vm
element of the target virtual machine.
For example,
use a request similar to:
GET https://vcloud.example.com/api/vApp/vm-75
The
VdcComputePolicy
element references the current VDC compute policy of the virtual machine.
-
To update the VDC
compute policy, modify the retrieved
Vm
element by editing the
VdcComputePolicy
reference.
For example,
modify the
Vm
element similar to:
<Vm
xmlns="http://www.vmware.com/vcloud/v1.5"
...
<VCloudExtension required="false">
...
<VdcComputePolicy
href="https://vcloud.example.com/cloudapi/1.0.0/vdcComputePolicies/51"
id="51"
name="oracle_license"
type="application/json"/>
...
</Vm>
-
Use the modified
Vm
element as the body of a
reconfigureVm request.
For example, use
a request similar to:
PUT https://vcloud.example.com/api/vApp/vm-75/action/reconfigureVm
type="application/vnd.vmware.vcloud.vm+xml
...
<Vm
...
<VdcComputePolicy
.../>
...
</Vm>
Results
The placement engine
moves the virtual machine to the corresponding VM group of the new VDC compute
policy.