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.
Tip
To retrieve information about the different images available to install on Scaleway Instances, check out our Marketplace APIOpen in new context.
Concepts
Refer to our dedicated concepts pageOpen in new context to find definitions of all concepts and terminology related to Instances.
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.
CodeParameter Description Valid values nameA name of your choice for the Instance (string) Any string containing only alphanumeric characters, dots, spaces and dashes, e.g. "my-new-instance".projectThe Project in which the Instance should be created (string) Any valid Scaleway Project ID (see above), e.g. "b4bd99e0-b389-11ed-afa1-0242ac120002"commercial-typeThe 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.imageThe image to install on the Instance, e.g. a particular OS (string) Any Scaleway image label, e.g. "ubuntu_noble", or any valid Scaleway image ID, e.g."6fc0ade6-d6a3-4fb9-87ab-2444ac71e5c0"which is the ID for theUbuntu 24.04 Noble Numbatimage. Use the List Instance Images endpoint to get a list of all available images with their IDs and labels, or check out the Scaleway Marketplace APIOpen in new context.enable_ipv6Whether to enable IPv6 on the Instance (boolean) trueorfalsevolumesAn object that specifies the storage volumes to attach to the Instance. For more information, see Creating an Instance: the volumes object in the Technical information section of this quickstart. A (dictionary) object with a minimum of one key ( "0") whose value is another object containing the parameters"name"(a name for the volume),"size"(the size for the volume, in bytes), and"volume_type"("l_ssd"). Additional keys for additional volumes should increment by 1 each time (the second volume would have a key of1.) Further parameters are available, and it is possible to attach existing volumes rather than creating a new one, or create a volume from a snapshot. -
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.
Requirement
- You have a Scaleway accountOpen in new context
- You have created an API keyOpen in new context and that 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
Technical information
Availability Zones
Instances can be deployed 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 |
Pagination
Most listing requests receive a paginated response. Requests against paginated endpoints accept two query arguments:
page, a positive integer to choose which page to return.per_page, an positive integer lower or equal to 100 to select the number of items to return per page. The default value is50.
Paginated endpoints usually also accept filters to search and sort results.These filters are documented along each endpoint documentation.
The X-Total-Count header contains the total number of items returned.
Creating an Instance: the volumes object
When creating an Instance using the Scaleway API, the volumes object is not strictly required. However, the defaults vary depending on certain conditions:
-
If an image label is used:
- The default will be an
sbs_volumevolume. - The size of this volume will be the OS size (typically 10GB in most cases).
- The default will be an
-
If an image ID from the marketplace is used:
- If the Instance supports local storage:
- The default will be an
l_ssdvolume. - The size of this volume will be the instance's maximum local storage capacity.
- The default will be an
- Else, the volume created will depend on the marketplace's local_image type:
- SBS volume for instance_sbs type.
- l_ssd volume for instance_local type.
- If the Instance supports local storage:
If you want to customize the storage configuration or add additional volumes, you will need to include the volumes object in your API request. This object should contain at least one (dictionary) object with a minimum of one key ("0") whose value is another object containing the parameters "name" (a name for the volume), "size" (the size for the volume, in bytes), and "volume_type" ("sbs_volume" or "l_ssd"). Additional keys for additional volumes should increment by 1 each time (the second volume would have a key of "1".)
Note that volume size must respect the volume constraints of the Instance's commercial_type: for each type of Instance, a minimum amount of storage is required, and there is also a maximum that cannot be exceeded. All Instance types support Block Storage (sbs_volume), some also support local storage (l_ssd). Read more about these constraints in the List Instance types documentation, specifically the volume_constraints parameter for each type listed in the response
You can use the volumes object in different ways. The table below shows which parameters are required for each of the following use cases:
| Use case | Required params | Optional params | Notes |
|---|---|---|---|
Create a volume (l_ssd, sbs_volume) from a snapshot of an image | volume_type, size, boot | If the size parameter is not set, the size of the volume will equal the size of the corresponding snapshot of the image. The image snapshot type should be compatible with the volume_type. | |
Create a volume (l_ssd) from a snapshot | base_snapshot, name, volume_type | boot | |
Create a volume of type sbs_volume from a snapshot | base_snapshot, name, volume_type | size, boot | |
| Create an empty volume | name, volume_type, size | boot | |
Attach an existing volume (l_ssd) | id | boot | |
Attach an existing volume of type sbs_volume | id, volume_type | boot |
Note
This information is designed to help you correctly configure the volumes object when using the Create an Instance or Update an Instance methods.
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.
scw-generate-ssh-keys script, which generates the SSH server’s host keys, then stores their fingerprints as user data under the ssh-host-fingerprints key.
This way, before connecting to the instance using SSH, one can query the fingerprints to ensure that the remote host is the expected one, thus avoiding any man-in-the-middle attack.
There are two ways of accessing user data:
- 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.
l_ssd) and scratch volume types.
Block storage volumes can also be attached to Instances, these volumes are
managed by the SBS API (https://www.scaleway.com/en/developers/api/block/).
Minimum and maximum volume sizes for each volume types can be queried
from the zone /products/volumes API endpoint. I.e for:
fr-par-1use https://api.scaleway.com/instance/v1/zones/fr-par-1/products/volumesnl-ams-1use https://api.scaleway.com/instance/v1/zones/nl-ams-1/products/volumes
/dev/disk/by-id/.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.
For each policy types, one of the two policy_mode may be selected:
optionalwill start your Instances even if the constraint is not respectedenforcedguarantees that if the Instance starts, the constraint is respected
policy_mode is set by default to optional.