Instances
Create instance
Create an instance with specified configuration.
How to get access:
For Linux,
- Use the user_data field to provide a cloud-init script in base64 to apply configurations to the instance.
- Specify the username and password to create a new user.
- When only password is provided, it is set as the password for the default user of the image.
- The user_data is ignored when the password is specified.
For Windows,
- Use the user_data field to provide a cloudbase-init script in base64 to create new users on Windows.
- Use the password field to set the password for the 'Admin' user on Windows.
- The password of the Admin user cannot be updated via user_data.
- The username cannot be specified in the request.
post/cloud/v2/instances/{project_id}/{region_id}
Path parameters
project_idinteger required
Project ID
Example:1
Project ID
region_idinteger required
Region ID
Example:1
Region ID
Request body
Example request
{
"flavor": "g2-standard-32-64",
"interfaces": [
{
"type": "external"
}
],
"name": "my-instance",
"ssh_key_name": "my-ssh-key",
"volumes": [
{
"boot_index": 0,
"image_id": "e460e48c-6836-447e-bc9c-16fc4225d318",
"size": 50,
"source": "image"
}
]
}Response
OK
Example response
{
"tasks": [
"d478ae29-dedc-4869-82f0-96104425f565"
]
}