Build or Rebuild VS

To build or rebuild a VS, use the following methods:

POST /virtual_machines/:virtual_machine_id/build.xml
POST /virtual_machines/:virtual_machine_id/build.json

XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<?xml version="1.0" encoding="UTF-8"?><virtual_machine><template_id>1</template_id><required_startup>1</required_startup></virtual_machine>' --url http://onapp.test/virtual_machines/:virtual_machine_id/build.xml 

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"virtual_machine":{"template_id":"1","required_startup":"1"}}' --url http://onapp.test/virtual_machines/:virtual_machine_id/build.json


Where:

template_id* - the ID of a template from which a VS should be built.

required_startup - set to 1 if you wish to start a VS after it is built. Otherwise set to 0.

Instead of virtual server ID (:virtual_machine_id) you may use virtual server identifier (:virtual_machine_identifier).

initial_root_password_encryption_key -  specify the password encryption passphrase

for Windows templates you should specify the licensing type:

licensing_type - the type of a license: makkms or user own license

licensing_key - the key of a license, required if you have selected OWN licensing type, and not required for MAK and KMS licensing types

licensing_server_id - the ID of a template group where the KMS server details are indicated and to which the template belongs (either directly or through the child group)