Starting a Server with Additional Volume via API
How to start a server with additional volume from the API
This page shows you some basics to interact with the Compute API.
API tokens are unique identifiers associated with your Scaleway account and consist of an Access Key (--o or -organisation in the Scaleway CLI) and a Secret Key (--t or -token in the Scaleway CLI). The Secret key is required to authenticate against our API and will only be displayed when you create the token. Make sure to take a note of it and to keep it secret.
There are five steps to provision and start a server with additional volume from the API.
The API endpoint depends on the location where you want to perform an operation. Currently we provide two avialability zones:
The following request returns the list of available images. In this example we only have one image which is named Ubuntu Trusty (14.04) on SSD 2014.06.04 and has id fe8dfea7-bb8c-490c-a554-1a44a3c4af8c.
Step 2 - Create a new server
To create a server, you have to fill out the following input:
The commercial type (for example: C1, VC1S, C2M, …)
A server name
An Organization ID
An Image ID
The response above returns an HTTP 201 code with the server details.
Step 3 - Create a new volume
To create a volume, you have to fill out the following input:
A volume name
An Organization ID
A size in GB
The volume type - LSSD (Local solid state drive)
You can create and attach additional volumes to an existing server. The server must be stopped.
Let’s create a new volume of type SSD with a size of 50GB.
The response above returns an HTTP 201 code with the volume details.
Step 4 - Attach the volume to the server
To attach an additional volume to an existing server, you have to perform a PUT method requests on the server.
Step 5 - Start a server
To start your server, execute the following request where <YOUR_SERVER_ID> is your server id.