ServerMania logo

Reset VS Root Password

To reset the VS root password, use the following request:

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

XML Request Example

curl -i -X POST -u user:userpass --url http://test/virtual_machines/12/reset_password.xml -d '<virtual_machine><initial_root_password>qwaszx321</initial_root_password><initial_root_password_encryption_key>property321</initial_root_password_encryption_key></virtual_machine>' -H 'Accept:application/xml' -H 'Content-type:application/xml'

JSON Request Example

curl -i -X POST -u user:userpass --url http://test/virtual_machines/12/reset_password.json -d '{"virtual_machine":{"initial_root_password":"qwaszx123", "initial_root_password_encryption_key":"property"}}' -H 'Accept:application/json' -H 'Content-type:application/json'

Where:

virtual_machine_id * - id of the VS, for which you want to reset password.

initial_root_password - the new root password for a VS. It can consist of 6-32 characters, letters [A-Za-z], digits [0-9], dash [ - ] and lower dash [ _ ]. You can use both lowercase and uppercase letters.

The following characters are not allowed for Windows-based virtual servers:

  • percent sign [%]
  • double quotation marks [“]
  • brackets [<,>]
  • vertical bar [|]
  • caret [^]
  • ampersand [&]
  • parentheses [(,)]

initial_root_password_encryption_key - specify the password encryption passphrase.

You can also reset a VS password using the 2.3.2 API request:

XML Request example

curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://test/virtual_machines/12/reset_password 

JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass --url http://test/virtual_machines/12/reset_password* 

Where:

virtual_machine_id * - id of the VS, for which you want to reset password.