Deploy vApp

To deploy a vApp, use the following request:

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

XML Request Example

1
curl -i -X POST -u 'user:userpass' -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://onapp.test/vapps.xml -d '<vapp><name>APIvApp</name><description>This is a description of the vApp</description><vdc_id>64</vdc_id><vapp_template_id>390</vapp_template_id><virtual_machines><virtual_machine_0><id>vm-7sa7228c-94f6-470c-8798-c20c0bdd1c90</id><name>CentOS7</name><cpus>1</cpus><cores_per_socket>1</cores_per_socket><memory>512</memory><storage_policy>387</storage_policy><hard_disks><hard_disk_1><instance_id>5</instance_id><disk_space>3</disk_space></hard_disk_1></hard_disks><nics><nic_0><id>0</id><network_id>12</network_id></nic_0></nics></virtual_machine_0></virtual_machines></vapp>'

JSON Request Example

1
curl -i -X POST -u 'user:userpass' -H 'Accept: application/json' -H 'Content-Type: application/json' http://onapp.test/vapps.json -d '{"vapp":{"name":"APIvApp","description":"This is a description of the vApp","vdc_id":"64","vapp_template_id":"390","virtual_machines":{"virtual_machine_0":{"id":"vm-7sa7228c-94f6-470c-8798-c20c0bdd1c90","name":"CentOS7","cpus":"1","cores_per_socket":"1","memory":"512","storage_policy":"387","hard_disks":{"hard_disk_1":{"instance_id":"5", "disk_space":"3"}},"nics":{"nic_0":{"id":"0", "network_id":"12"}}}}}}'

Where:

  • name - name of the vApp
  • image description - the description of the vApp
  • vdc_id - ID of the datacenter on which the vApp will be created
  • vapp_template_id - ID of the template on which the vApp will be built
  • virtual_machines - array of parameters associated with the VS
    • id - ID of the VS
    • name - choose a name for 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
    • hard_disks - array of parameters associated with the VS disks
      • image instance_id - the ID of the corresponding disk that is available via the Get List of vApp Templates request
      • disk_space - set the disk’s size
      • storage_policy - the didsk’s storage policy
    • nics - array of parameters associated with the NICs
      • nic - the sequence number of NIC
      • id -the ID of NIC
      • network_id - the ID of the network to which the NIC will be connected

Page History

v. 6.0

  • Added the description and instance_id parameters.
  • Added the nic and id parameters to the array of parameters associated with the NICs.