Undeploy A Vapp Or Virtual Machine; Power On A Vapp Or Virtual Machine - VMware VCLOUD API 1.0 - API Programming Manual

Table of Contents

Advertisement

Example 5-19. Deploy and Power On a vApp or Virtual Machine
Request:
POST http://vcloud.example.com/api/v1.0/vApp/vapp-7/action/deploy
Content-type: application/vnd.vmware.vcloud.deployVAppParams+xml
...
<DeployVAppParams powerOn="true" xmlns="http://www.vmware.com/vcloud/v1"/>
Response:
202 Accepted
Content-Type: application/vnd.vmware.vcloud.task+xml
...
<Task ... operation="Starting Virtual Application Linux FTP server (7) ...>
...
</Task>

Undeploy a vApp or Virtual Machine

Undeploying a vApp powers off or suspends any running virtual machines it contains, then frees the 
resources reserved for the vApp and sets the vApp's deployed attribute to a value of false to indicate that it 
is not deployed.
Undeploying a virtual machine powers off or suspends the virtual machine, then frees the resources reserved 
for it and sets the its deployed attribute to a value of false to indicate that it is not deployed. This operation 
has no effect on the containing vApp.
The saveState attribute specifies whether the undeployed virtual machines are suspended and their suspend 
state saved, or simply powered off.
The request body in each case is an UndeployVAppParams element.
Example 5-20. Undeploy a vApp or Virtual Machine
Request to undeploy a vApp:
POST http://vcloud.example.com/api/v1.0/vApp/vapp-7/action/undeploy
Content-type: application/vnd.vmware.vcloud.undeployVAppParams+xml
...
<UndeployVAppParams saveState="true" xmlns="http://www.vmware.com/vcloud/v1"/>
Request to undeploy a Vm:
POST http://vcloud.example.com/api/v1.0/vApp/vm-5/action/undeploy
Content-type: application/vnd.vmware.vcloud.undeployVAppParams+xml
...
<UndeployVAppParams saveState="true" xmlns="http://www.vmware.com/vcloud/v1"/>
Response:
202 Accepted
Content-Type: application/vnd.vmware.vcloud.task+xml
...
<Task ...>
...
</Task>

Power On a vApp or Virtual Machine

A powerOn request to a vApp URL powers on all of the virtual machines in the vApp, as specified in the vApp's 
ovf:StartupSection element.
A powerOn request to a virtual machine URL powers on the specified virtual machine and forces deployment 
of the parent vApp.
VMware, Inc.
Chapter 5 Datacenter Operations
81

Advertisement

Table of Contents
loading

Table of Contents