InstantiationParamsType instantiationParamsType = new InstantiationParamsType();
// fill in remaining InstantiationParams
InstantiateVAppTemplateParamsType instVappTemplParamsType = new
instVappTemplParamsType.name = "HellovCloudvApp";
instVappTemplParamsType.Source = vAppTemplateReference;
instVappTemplParamsType.InstantiationParams = instantiationParamsType;
// make the request, and get an href to the vApp in return
Vapp vapp = vdc.InstantiateVappTemplate(instVappTemplParamsType);
return vapp;
}
catch ...
}
Operate the vApp
The Vapp class includes methods that perform operations on the vApp. The majority of these operations return
a Task object that tracks the progress of the operation. The HellovCloud example uses these methods to cycle
the vApp through the following states:
1
Deploy the vApp using the vapp.Deploy() method.
2
Power on the vApp using the vapp.PowerOn() method.
3
Suspend the vApp using the vapp.Suspend() method.
4
Power off the vApp using the vapp.PowerOff() method.
5
Undeploy the vApp using the vapp.Undeploy() method.
6
Delete the vApp using the vapp.Delete() method.
VMware, Inc.
InstantiateVAppTemplateParamsType();
Chapter 3 Hello vCloud: A Structured Workflow Example
17