Clone Virtual Server

You can clone virtual servers that run on KVM or VMware compute resources, including virtual servers built from OVA and ISO templates.

To clone a virtual server, run the following request: 

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

XML Request Example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:password -d '<virtual_machine><label>xmlclone</label><hostname>xmlclone</hostname><initial_root_password>123456</initial_root_password><encrypt_password>true</encrypt_password><initial_root_password_encryption_key>key</initial_root_password_encryption_key></virtual_machine>' --url http://onapp/virtual_machines/:id/clone.xml

JSON Request Example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:password -d '
{
  "virtual_machine": {
    "label": "Clone - vm",
    "hostname": "clonedvm",
    "initial_root_password": "123123",
    "initial_root_password_confirmation": "123123",
    "encrypt_password": true,
    "initial_root_password_encryption_key": "key",
    "initial_root_password_encryption_key_confirmation": "key"
  }
}'
--url http://onapp.test/virtual_machines/12/clone.json

Where:

label - the label of cloned VS

hostname - hostname of cloned VS

initial_root_password - password for cloned VS

initial_root_password_confirmation - confirmation of a password for cloned VS

encrypt_password - true is password is encrypted, otherwise false

initial_root_password_encryption_key - keyword to be used to decrypt the password

initial_root_password_encryption_key_confirmation - confirmation of a keyword to be used to decrypt the password

Please note that if you do not specify the parameters above, they will remain the same as the origin virtual server's (but with Clone in the label; for example, Clone Origin Label), with an exception of initial_root_password. If the password is not specified, the cloned VS is created with a new auto-generated password.

Page History

v. 6.6 Edge 4

Added the following parameters: label, hostname, initial_root_passwordencrypt_password, initial_root_password_encryption_key.