Compose vApp

To compose a vApp, use the following request:

1
2
POST /vapps/compose.xml
POST /vapps/compose.json

XML Request Example

1
curl -i -X POST http://onapp.test/vapps/compose.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<vapp><blank_vapp>0</blank_vapp><name>vapp_name</name><description>This is a description of the vApp</description><vdc_id>9</vdc_id><vapp_template_ids><vapp_template_id>1</vapp_template_id></vapp_template_ids><vapp_ids><vapp_id>3</vapp_id></vapp_ids><virtual_machines><id>vs_1</id><name>Name</name><cpus>1</cpus><cores_per_socket>1</cores_per_socket><memory>512</memory><storage_policy>2</storage_policy><hard_disks><hard_disk_1><instance_id>5</instance_id><disk_space>3</disk_space><storage_policy>4</storage_policy></hard_disk_1></hard_disks><nics><nic_0><id>4</id><network_id>19</network_id><adapter_type>VMXNET3</adapter_type></nic_0></nics><boot_vm>1</boot_vm></virtual_machines></vapp>'

JSON Request Example

1
curl -i -X POST http://onapp.test/vapps/compose.json -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"vapp":{"blank_vapp":"0", "name":"vApp_Name", "description":"This is a description of the vApp", "vdc_id":"421", "vapp_template_ids":["374"], "vapp_ids":["1256","1989"], "virtual_machines":{"virtual_machine_0":{"id":"vm-10d686fca", "name":"CentOS7_vm", "cpus":"1", "cores_per_socket":"1", "memory":"512", "storage_policy":"845", "hard_disks":{"hard_disk_1":{"instance_id":"2000", "bus_sub_type":"lsilogic", "disk_space":"3", "storage_policy":"845"}}, "nics":{"nic_0":{"id":"0", "network_id":"", "adapter_type":"VMXNET3"}}, "boot_vm":"1"}, "virtual_machine_1":{"id":"vm-314738fr", "name":"CentOS7_vs", "cpus":"1", "cores_per_socket":"1", "memory":"512", "storage_policy":"845", "hard_disks":{"hard_disk_1":{"instance_id":"2000", "bus_sub_type":"lsilogic", "disk_space":"3", "storage_policy":"845"}}, "nics":{"nic_0":{"id":"2", "network_id":"56", "adapter_type":"VMXNET3"}}, "boot_vm":"1"}}}}'

Where:

  • vapp - the array of parameters to compose a vApp
  • blank_vapp - set 1 to create a blank vApp; otherwise, set 0
  • name - the vApp label
  • description - the description of the vApp
  • vdc_id - the virtual data center ID
  • vapp_template_ids - the array of vApp templates IDs. All VSs that are built on these templates will be copied to your new vApp.
  • vapp_template_id - the vApp template ID
  • vapp_ids - the array of vApps IDs. All VSs within the specified vApps will be copied to your new vApp.
  • vapp_id - the vApp ID
  • image virtual_machines - the array of parameters associated with the VS
    • id - the ID of the VS
    • name - edit the name of the VS
    • cpus - set the number of cores
    • core_per_socket - set the number of cores per socket
    • memory - the amount of RAM allocated to this VS in Mb
    • storage_policy - the virtual server’s storage policy that is a default data store ID. If Fast Provisioning is not enabled for the previously selected VDC, you can select a different data store for the VS’s disks.
    • hard_disks - the array of parameters associated with the VS disks
      • instance_id - the ID of the corresponding disk that is available via the Get List of vApp Templates request
      • disk_space - set the disk size in Gb
      • bus_sub_type - the bus sub type of the disk
      • storage_policy - the disk storage policy that is a data store ID. This option is available only if the selected VDC has Fast Provisioning disabled. If you do not select a data store, the disk is built on the default data store.
    • nics - the array of parameters associated with the NICs
      • id - the ID of the NIC
      • network_id - the ID of the network to which the NIC will be connected
      • adapter_type - the network adapter type provided for the VS that can be one of the following values:
        • Vlance
        • E1000
        • E1000E
        • VMXNET
        • VMXNET2
        • VMXNET3
        • FLEXIBLE
    • image boot_vm - set 1 if the VS should be switched on after the vApp deployment; otherwise, set 0

Page History

v. 6.1

  • Added the following parameters:
    • virtual_machines array
    • boot_vm

v. 6.0

  • Added the description parameter