Compose vApp operation
The Compose vApp operation enables you to compose or create a vApp using the following entities:
- A vApp template
- An existing vApp
- An existing VM
The following figure shows a sample <items> XML element for the Compose vApp operation:
Sample <items> XML element for the Compose vApp operation
<item>
<parameters>
<vdc-id></vdc-id>
<vapp-name></vapp-name>
<deploy></deploy>
<power-on></power-on>
<description></description>
<instantiation-params>
<network-config-section>
<info></info>
<network-config>
<network-name></network-name>
<description></description>
<configuration>
<parent-network-id></parent-network-id>
<fence-mode></fence-mode>
<ip-scope>
<is-inherited></is-inherited>
<gateway></gateway>
<netmask></netmask>
<dns1></dns1>
<dns2></dns2>
<dns-suffix></dns-suffix>
<ip-ranges>
<ip-range>
<start-address></start-address>
<end-address></end-address>
</ip-range>
</ip-ranges>
</ip-scope>
</configuration>
</network-config>
</network-config-section>
<startup-section>
<info/>
<vm-startup-details>
<vm-name></vm-name>
<order></order>
<start-action></start-action>
<start-delay></start-delay>
<stop-action></stop-action>
<stop-delay></stop-delay>
</vm-startup-details>
</startup-section>
<lease-setting-section>
<info/>
<deployment-lease-in-seconds></deployment-lease-in-seconds>
<storage-lease-in-seconds></storage-lease-in-seconds>
</lease-setting-section>
</instantiation-params>
<compose-vapp-params>
<compose-vapp-param>
<vapp-id></vapp-id>
<network-assignment>
<inner-network></inner-network>
<container-network></container-network>
</network-assignment>
</compose-vapp-param>
<compose-vapp-param>
<vapp-template-id></vapp-id>
<network-assignment>
<inner-network></inner-network>
<container-network></container-network>
</network-assignment>
</compose-vapp-param>
<compose-vapp-param>
<vm-id></vm-id>
<name></name>
<network-connection-section>
<info></info>
<primary-network-connection-index></primary-network-connection-ind
<network-connection>
<network></network>
<network-connection-index></network-connection-index>
<is-connected></is-connected>
<ip-address></ip-address>
<mac-address></mac-address>
<ip-address-allocation-mode></ip-address-allocation-mode>
</network-connection>
</network-connection-section>
<network-assignment>
<inner-network></inner-network>
<container-network></container-network>
</network-assignment>
</compose-vapp-param>
</compose-vapp-params>
<all-eulas-accepted></all-eulas-accepted>
</parameters>
</item>
</items>
The following table describes the elements for this adapter request:
Adapter request elements for the Compose vApp operation
Element | Definition | Required |
---|---|---|
<operation-name> | Defines the type of operation: Compose_vApp | Yes |
<vcloud-organization> | Specifies the name of the vCloud organization | Conditional:
|
<user-name> | Specifies the user name required for basic HTTP authentication on vCloud | Conditional:
|
<password> | Contains the password corresponding to the specified user name | Conditional:
|
<parameters> | Contains the elements for the operation | Yes |
<vdc-id> | Specifies the ID of the target virtual data center | Yes |
<vapp-name> | Specifies the name for the vApp that you want to compose | Yes |
<deploy> | Specifies whether the vApp must be deployed after being composed | No |
<power-on> | Specifies whether the vApp must be powered on after being composed | No |
<description> | Specifies the description for the vApp that you want to compose | No |
<network-config-section> | Contains the following elements:
| No |
<info> | Specifies information about the <network-config-section> element | No |
<network-config> | Defines the configuration of the vApp network
| No |
<network-name> | Specifies the name of the vApp's parent network | Conditional; required if <network-config> is specified |
<description> | Specifies the description of the network | No |
<configuration> | Specifies the properties of the network, including the following elements:
| Conditional; required if <network-config> is specified |
<parent-network-id> | Specifies a reference to a network to which this network can be connected | No |
<fence-mode> | Specifies how this network is connected to its parent network Valid values: bridged, isolated, natRouted | Conditional; required if <network-config> is specified |
<ip-scope> | Defines the address range, gateway, netmask, DNS, and other properties of the network | Conditional; required when creating a NAT-routed or isolated network |
<is-inherited> | Specifies whether the values in the <ip-scope> element are inherited from the parent network | Conditional; required when creating a NAT-routed or isolated network |
<gateway> | Specifies the IP address of the network gateway | Conditional; required when creating a NAT-routed or isolated network |
<netmask> | Specifies the network mask that you must apply to addresses on the new network | Conditional; required when creating a NAT-routed or isolated network |
<dns1> | Specifies the IP address of the primary DNS server for the new network | Conditional; required when creating a NAT-routed or isolated network |
<dns2> | Specifies the IP address of the secondary DNS server for the new network | No |
<dns-suffix> | Specifies the suffix that you must use when resolving host names that are not fully qualified | No |
<ip-ranges> | Contains the <ip-range> element | No |
<ip-range> | Defines the address range of the network | No |
<start-address> | Specifies the start IP address for the specified IP range | Conditional; required if <ip-range> is specified |
<end-address> | Specifies the end IP address for the specified IP range | No |
<startup-section> | Contains the <info> and <vm-startup-details> elements | No |
<info> | Specifies descriptive information about the <startup-section> element | No |
<vm-startup-details> | Specifies startup information for the VM, including the following elements:
| No |
<vm-name> | Specifies the name of the VM | No |
<order> | Specifies the order in which the VMs in the composed vApp start and stop | No |
<start-action> | Specifies the start-up action for the VM | No |
<start-delay> | Specifies the delay in seconds after which the VM performs the action specified in the <start-action> element | No |
<stop-action> | Specifies the manner in which the VM stops | No |
<stop-delay> | Specifies the delay in seconds after which the VM performs the action specified in the <stop-action> element | No |
<lease-setting-section> | Contains the following elements:
| No |
<info> | Specifies descriptive information about the <lease-setting-section> element | No |
<deployment-lease-in-seconds> | Specifies the duration of the deployment lease in seconds | No |
<storage-lease-in-seconds> | Specifies the duration of the storage lease in seconds | No |
<compose-vapp-param> | Contains the following elements:
| No |
<vapp-id> | Specifies the ID of the vApp to use to compose the vApp | Conditional:
|
<vapp-template-id> | Specifies the ID of the vApp template to use to compose the vApp | Conditional:
|
<vm-id> | Specifies the ID of the VM to use to compose the vApp | Conditional:
|
<name> | Specifies a new name for the VM | No |
<network-connection-section> | Contains the following elements:
| No |
<info> | Specifies information about the <network-connection-section> element | No |
<primary-network-connection-index> | Specifies the value of the <rasd:AddressOnParent> element, which specifies the index of the Network Interface card (NIC) supporting the primary network connection on the VM | No |
<network-connection> | Describes a single network connection
| No |
<network> | Specifies the name of the network to which this connection connects | Conditional; required if <network-connection> is specified |
<network-connection-index> | Specifies the value of the <rasd:AddressOnParent> element, which specifies the index of the Network Interface card (NIC) supporting the connection | Conditional; required if <network-connection> is specified |
<is-connected> | Specifies the connection state of the vApp | Conditional; required if <network-connection> is specified |
<ip-address> | Specifies the IP address of the connection | No |
<external-ip-address> | Contains the external address if the network to which the NIC is connected has network address translation (NAT) or port mapping | No |
<mac-address> | Specifies the MAC address of the connection | No |
<ip-address-allocation-mode> | Specifies how an IP address is allocated to the connection | Conditional; required if <network-connection> is specified |
<network-assignment> | Maps logical networks in the source to logical networks in the composed vApp | No |
<inner-network> | Specifies the name of the network in the source | Conditional; required if <network-assignment> is specified |
<container-network> | Specifies the name of the vApp network to which the value specified in the <inner-network> element is mapped | Conditional; required if <network-assignment> is specified |
<all-eulas-accepted> | Specifies whether to accept the terms and conditions in the template's EULA section | No |
The following figure shows the sample adapter request for the Compose vApp operation when the <fence-mode> element is set to isolated:
Sample adapter request for the Compose vApp operation (fence-mode = isolated)
<operation-name>Compose_vApp</operation-name>
<vcloud-organization>TestOrg</vcloud-organization>
<user-name>TestUser</user-name>
<password>Password</password>
<parameters>
<vdc-id>1481190991</vdc-id>
<vapp-name>TestTmpl108</vapp-name>
<deploy>true</deploy>
<power-on>true</power-on>
<description>This is compose Vapp functionality</description>
<instantiation-params>
<network-config-section>
<network-config>
<network-name>qwe</network-name>
<configuration>
<fence-mode>isolated</fence-mode>
<ip-scope>
<is-inherited>false</is-inherited>
<netmask>255.255.0.0</netmask>
<gateway>10.128.128.1</gateway>
<dns1>10.10.1.1</dns1>
</ip-scope>
</configuration>
<ip-ranges>
<ip-range>
<start-address>10.128.128.2</start-address>
<end-address>10.128.128.10</end-address>
</ip-range>
</ip-ranges>
</network-config>
</network-config-section>
</instantiation-params>
<compose-vapp-params>
<compose-vapp-param>
<vm-id>vm-849472990</vm-id>
<name>testuser</name>
<network-connection-section>
<network-connection>
<network>qwe</network>
<network-connection-index>1</network-connection-index>
<is-connected>true</is-connected>
<ip-address>10.128.128.4</ip-address>
<mac-address>01:01:01:01:01:01</mac-address>
<ip-address-allocation-mode>MANUAL</ip-address-allocation-mode>
</network-connection>
</network-connection-section>
</compose-vapp-param>
</compose-vapp-params>
<all-eulas-accepted>true</all-eulas-accepted>
</parameters>
</vmware-vcloud-request>
The following figure shows the response for the sample request when the <fence-mode> element is set to isolated:
Sample adapter response for the Compose vApp operation (fence-mode = isolated)
<metadata>
<status>success</status>
</metadata>
<status-line>
<code>201</code>
<reason>Created</reason>
</status-line>
<message-body>
<VApp
deployed = "false"
status = "0"
name = "TestTmpl108"
type = "application/vnd.vmware.vcloud.vApp+xml"
href = "https://10.128.248.112/api/v1.0/vApp/vapp-1234561431">
<Link
rel = "up"
type = "application/vnd.vmware.vcloud.vdc+xml"
href = "https://10.128.248.112/api/v1.0/vdc/1481190991"/>
<Description>This is compose Vapp functionality</Description>
<Tasks>
<Task
status = "running"
startTime = "2011-03-01T15:09:40.364+05:30"
operation = "Composing Virtual Application
TestTmpl118(1234561431)"
expiryTime = "2011-05-30T15:09:40.364+05:30"
endTime = "9999-12-31T23:59:59.999+05:30"
type = "application/vnd.vmware.vcloud.task+xml"
href = "https://10.128.248.112/api/v1.0/task/vcqtlf2
eh41xs5xxho">
<Owner
type = "application/vnd.vmware.vcloud.vApp+xml"
name = "TestTmpl108"
href = "https://10.128.248.112/api/v1.0/vApp/vapp-1234
561431"/>
</Task>
</Tasks>
</VApp>
</message-body>
</vmware-vcloud-response>
The following figure shows the sample adapter request for the Compose vApp operation with <vm-startup-details> and <lease-setting-section> elements:
Sample adapter request for the Compose vApp operation with <vm-startup-details> and <lease-setting-section>
<operation-name>Compose_vApp</operation-name>
<vcloud-organization>TestOrg</vcloud-organization>
<user-name>TestUser</user-name>
<password>Password</password>
<parameters>
<vdc-id>1481190991</vdc-id>
<vapp-name>TestTmpl108</vapp-name>
<deploy>true</deploy>
<power-on>true</power-on>
<description>This is compose Vapp functionality</description>
<instantiation-params>
<network-config-section>
<network-config>
<network-name>abcd</network-name>
<configuration>
<fence-mode>bridged</fence-mode>
<parent-network-id>539454687</parent-network-id>
</configuration>
</network-config>
</network-config-section>
<startup-section>
<info/>
<vm-startup-details>
<vm-name>testlaysha134567</vm-name>
<order>0</order>
<start-action>powerOn</start-action>
<start-delay>60</start-delay>
<stop-action>powerOff</stop-action>
<stop-delay>60</stop-delay>
</vm-startup-details>
<vm-startup-details>
<vm-name>testlaysha1345678</vm-name>
<order>1</order>
<start-action>powerOn</start-action>
<start-delay>60</start-delay>
<stop-action>powerOff</stop-action>
<stop-delay>60</stop-delay>
</vm-startup-details>
</startup-section>
<lease-setting-section>
<info/>
<deployment-lease-in-seconds>60000</deployment-lease-in-seconds>
<storage-lease-in-seconds>60000</storage-lease-in-seconds>
</lease-setting-section>
</instantiation-params>
<compose-vapp-params>
<compose-vapp-param>
<vm-id>vm-1662797449</vm-id>
<name>testuser</name>
<network-connection-section>
<network-connection>
<network>abcd</network>
<network-connection-index>1</network-connection-index>
<is-connected>true</is-connected>
<ip-address-allocation-mode>DHCP</ip-address-allocation-mode>
</network-connection>
</network-connection-section>
</compose-vapp-param>
<compose-vapp-param>
<vm-id>vm-1662797449</vm-id>
<name>testuser</name>
<network-connection-section>
<network-connection>
<network>abcd</network>
<network-connection-index>1</network-connection-index>
<is-connected>true</is-connected>
<ip-address-allocation-mode>DHCP</ip-address-allocation-mode>
</network-connection>
</network-connection-section>
</compose-vapp-param>
</compose-vapp-params>
<all-eulas-accepted>true</all-eulas-accepted>
</parameters>
</vmware-vcloud-request>
The following figure shows the response for the sample request with <vm-startup-details> and <lease-setting-section> elements:
Sample adapter response for the Compose vApp operation with <vm-startup-details> and <lease-setting-section>
<metadata>
<status>success</status>
</metadata>
<status-line>
<code>201</code>
<reason>Created</reason>
</status-line>
<message-body>
<VApp
deployed = "false"
status = "0"
name = "TestTmpl111"
type = "application/vnd.vmware.vcloud.vApp+xml"
href = "https://10.128.248.112/api/v1.0/vApp/vapp-1234561431">
<Link
rel = "up"
type = "application/vnd.vmware.vcloud.vdc+xml"
href = "https://10.128.248.112/api/v1.0/vdc/1481190991"/>
<Description>This is compose Vapp functionality</Description>
<Tasks>
<Task
status = "running"
startTime = "2011-03-01T15:09:40.364+05:30"
operation = "Composing Virtual Application
TestTmpl118(1234561431)"
expiryTime = "2011-05-30T15:09:40.364+05:30"
endTime = "9999-12-31T23:59:59.999+05:30"
type = "application/vnd.vmware.vcloud.task+xml"
href = "https://10.128.248.112/api/v1.0/task/vcqtlf2eh41x
s5xxho">
<Owner
type = "application/vnd.vmware.vcloud.vApp+xml"
name = "TestTmpl111"
href = "https://10.128.248.112/api/v1.0/vApp/vapp-1234
561431"/>
</Task>
</Tasks>
</VApp>
</message-body>
</vmware-vcloud-response>