Instance API
Scaleway Instances are virtual machines in the cloud. Different Instance typesOpen in new context offer different technical specifications in terms of vCPU, RAM, bandwidth, and storage. Once you have created your Instance and installed your image of choice (e.g. an operating system), you can connect to your Instance via SSHOpen in new context to use it as you wish. When you are done using the Instance, you can delete it from your account.
(switchcolumn)
Tip
To retrieve information about the different available to install on Scaleway Instances, check out our .
Concepts
Refer to our dedicated concepts pageOpen in new context to find definitions of all concepts and terminology related to Instances.
(switchcolumn) (switchcolumn)
Quickstart
-
Configure your environment variables:
Note
This is an optional step that seeks to simplify your usage of the Instances API. See Availability Zones below for help choosing an Availability Zone. You can find your Project ID in the Scaleway consoleOpen in new context.
Code -
Create an Instance: Run the following command to create an Instance. You can customize the details in the payload (name, description, type, tags etc) to your needs: use the information below to adjust the payload as necessary.
CodeCode| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
name| A name of your choice for the Instance (string) | Any string containing only alphanumeric characters, dots, spaces and dashes, e.g."my-new-instance". | |project_id| The Project in which the Instance should be created (string) | Any valid Scaleway Project ID (see above), e.g."b4bd99e0-b389-11ed-afa1-0242ac120002"| |server_type| The commercial Instance type to create (string) | Any valid ID of a Scaleway commercial Instance type, e.g."GP1-S","PRO2-M". Use the List Instance Types endpoint to get a list of all valid Instance types and their IDs. | |public_network_interface| A list that specifies the IPs to attach to the Instance. | A list where each item is a dictionary containing either"ipam_ip_id"with the IP ID as its value, or"new_ip"containing"type"(values:"zonal_ipv4", or"zonal_ipv6"). | |volumes| A list that specifies the storage volumes to attach to the Instance. | A list where each item is a dictionary containing the key"volume_type"(values:"l_ssd","sbs", or"scratch") and either the key"volume_id"or"new_volume"."volume_id"is used to attach a volume with the volume ID as its value."new_volume"is used to create a volume from a Scaleway image ("image_label") or a snapshot ("base_snapshot_id"). Further parameters are available. | -
List your Instances: Run the following command to get a list of all the Instances in your account, with their details:
Code -
Delete an Instance: Run the following command to delete an Instance, specified by its Instance ID:
CodeThe expected successful response is empty.
(switchcolumn)
Requirement
- You have a Scaleway accountOpen in new context
- You have created an API keyOpen in new context and the API key has sufficient IAM permissionsOpen in new context to perform the actions described on this page
- You have installed
curlOpen in new context
(switchcolumn)
Technical information
Availability Zones
You can deploy Instances in the following Availability Zones:
| Name | API ID |
|---|---|
| Paris | fr-par-1 fr-par-2 fr-par-3 |
| Amsterdam | nl-ams-1 nl-ams-2 nl-ams-3 |
| Warsaw | pl-waw-1 pl-waw-2 pl-waw-3 |
| Milan | it-mil-1 |
(switchcolumn) (switchcolumn)
Pagination
The listing requests receive a paginated response. They accept two query arguments:
page_token, a string representing the wanted page. If it's not provided the first page will be returned.page_size, a positive integer lower or equal to 100 to select the number of items to return per page. The default value is100.
Paginated endpoints usually also accept filters to search and sort results. These filters are documented along each endpoint documentation.
The listing response contain the next_page_token, the token to retrieve the next page.
(switchcolumn) (switchcolumn)
Going further
For more help using Scaleway Instances, check out the following resources:
- Our main documentationOpen in new context
- The #instance channel on our Slack CommunityOpen in new context
- Our support ticketing systemOpen in new context.
policy_type. Two policy
types are available:
low_latencywill group Instances on the same hypervisorsmax_availabilitywill spread Instances across physically distanced hypervisors
policy_type is set to max_availability by default.- From within a running Instance, by requesting the Metadata API at http://169.254.42.42/user_data (or http://[fd00:42::42]/user_data using IPv6).
The
scaleway-ecosystempackage, installed by default on all OS images provided by Scaleway, ships with thescw-userdatahelper command that allows you to easily query the user data from the Instance. For security reasons, viewing and editing user data is only allowed to queries originating from a port below 1024 (by default, only the super-user can bind to ports below 1024). To specify the source port with cURL, use the--local-portoption (e.g.curl --local-port 1-1023 http://169.254.42.42/user_data). - From the Instance API by using the methods described below.