Recompose vApp

To recompose a vApp, use the following request:

1
2
PUT /vapps/:id/recompose.xml
PUT /vapps/:id/recompose.json

XML Request Example

1
curl -X PUT -u user:userpass http://onapp.test/vapps/12/recompose.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<vapp><vapp_template_id>1</vapp_template_id><virtual_machines><virtual_machine_0><id>vm-11111111-8885-4276-ac1c-479c724b9d6e</id><name>Example</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><network_id>25</network_id><adapter_type>E1000</adapter_type></nics><vcloud_guest_customization><computer_name>example</computer_name><enabled>1</enabled><admin_password_enabled>1</admin_password_enabled><admin_password_auto>0</admin_password_auto><admin_password>password</admin_password></vcloud_guest_customization><recipe_ids type="array"><recipe_id>4</recipe_id></recipe_ids></virtual_machine_0></virtual_machines></vapp>'

JSON Request Example

1
curl -X PUT -u user:userpass http://onapp.test/vapps/12/recompose.json -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"vapp": {"vapp_template_id": "1", "virtual_machines": {"virtual_machine_0": {"id": "vm-a111111-8885-4276-ac1c-479c724b9d6e", "name": "Example", "cpus": "1", "cores_per_socket": "1", "memory": "1024", "storage_policy": "2", "hard_disks": {"hard_disk_1": {"instance_id": "5","disk_space": "3","storage_policy": "6"}}, "nics": {"network_id": "1","adapter_type":"E1000"}, "vcloud_guest_customization": {"enabled": "1", "admin_password_enabled": "1", "admin_password_auto": "0", "admin_password": "password", "computer_name": "example"}, "recipe_ids": [4, 5], "custom_recipe_variables": {"variable_0": {"name": "xxx", "value": "xy", "enabled": "true"}}, "boot_vm": "1", "disable_guest_customization_after_run": "0"}}}}'

Where:

  • vapp_template_id - the ID of the template on which the vApp will be built
  • virtual_machines - the array of parameters associated with the VSs
    • id - the ID of the VS
    • name - edit the name for the VS
    • cpus - set the number of cores
    • cores_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
      • 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
      • 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
    • vcloud_guest_customization - array of parameters associated with guest customization
      • computer_name - VS’s computer name
      • enabled - set true if guest customization should be enabled for the VS, otherwise, set false
      • admin_password_enabled - set true if the local admin password should be allowed; otherwise, set false
      • admin_password - enter the password of the administrator
      • admin_password_auto - set true if the admin password should be generated automatically; otherwise, set false
        If you set the admin_password_auto parameter to true, Resync vCloud VS after recomposing the vApp to be able to view the password.
    • recipe_ids - the IDs of the recipes that are to be applied to the VS
    • custom_recipe_variables - array of parameters associated with custom variables
      • name - the name of the custom variable
      • value - the value of the custom variable
      • enabled - set to true if the custom variable should be enabled; otherwise, set false
    • disable_guest_customization_after_run - set true if guest customization for this VS should be disabled after vApp deployment; otherwise, set false
    • boot_vm - set true if the VS should be switched on after vApp deployment; otherwise, set false

Page History

v. 5.3

  • Added parameters related to guest customization and recipes

v. 5.2

  • Added the following parameters:
    • virtual_machines
    • id
    • name
    • cpus
    • cores_per_socket
    • memory
    • storage_policy
    • nics, network_id