Scaleway logo
Commands

Documentation for `scw instance`

The CLI documentation pages are currently under construction

The content is up to date. We're making improvements to the site over the next few weeks for a better experience.

This API allows you to manage your CPU and GPU Instances.

Image management commands

Images are backups of your Instances. One image will contain all the volumes of your Instance and can be used to restore your Instance and its data. You can also use it to create a series of Instances with a predefined configuration. To copy not all but only one specified volume of an Instance, you can use the snapshot feature instead.

Create an Instance image

Create an Instance image from the specified snapshot ID.

Usage:

TerminalCode
scw instance image create [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
nameName of the imageDefault: <generated>
snapshot-idUUID of the snapshot that will be used as root volume in the imageRequired
archArchitecture of the imageRequired
One of: unknown_arch, x86_64, arm, arm64
additional-volumes.{index}.idUUID of the snapshot to add
additional-volumes.{index}.nameName of the additional snapshot
additional-volumes.{index}.sizeSize of the additional snapshot
additional-volumes.{index}.volume-typeUnderlying volume type of the additional snapshotOne of: l_ssd, b_ssd, unified, scratch, sbs_volume, sbs_snapshot
additional-volumes.{index}.project-idProject ID that own the additional snapshot
additional-volumes.{index}.organization-idOrganization ID that own the additional snapshotDeprecated
project-idProject ID to use. If none is passed the default project ID will be used
tags.{index}Tags of the image
publicTrue to create a public image
organization-idOrganization ID to use. If none is passed the default organization ID will be used
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Create an image named 'foobar' for x86_64 Instances from the specified snapshot ID

TerminalCode
scw instance server image create name=foobar snapshot-id=11111111-1111-1111-1111-111111111111 arch=x86_64

Delete an Instance image

Delete the image with the specified ID.

Usage:

TerminalCode
scw instance image delete <image-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
image-idUUID of the image you want to deleteRequired
with-snapshotsDelete the snapshots attached to this image
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Delete an image in the default zone with the specified ID

TerminalCode
scw instance image delete 11111111-1111-1111-1111-111111111111

Delete an image in fr-par-1 zone with the specified ID

TerminalCode
scw instance image delete 11111111-1111-1111-1111-111111111111 zone=fr-par-1

Get an Instance image

Get details of an image with the specified ID.

Usage:

TerminalCode
scw instance image get <image-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
image-idUUID of the image you want to getRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Get an image in the default zone with the specified ID

TerminalCode
scw instance image get 11111111-1111-1111-1111-111111111111

Get an image in fr-par-1 zone with the specified ID

TerminalCode
scw instance image get 11111111-1111-1111-1111-111111111111 zone=fr-par-1

List Instance images

List all existing Instance images.

Usage:

TerminalCode
scw instance image list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
name
arch
project-id
tags
organization-id
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1, all

Examples:

List all public images in the default zone

TerminalCode
scw instance image list

Update image

Update the properties of an image.

Usage:

TerminalCode
scw instance image update <image-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
image-idUUID of the imageRequired
nameName of the image
archArchitecture of the imageOne of: unknown_arch, x86_64, arm, arm64
extra-volumes.{key}.idUUID of the snapshot
tags.{index}Tags of the image
publicTrue to set the image as public
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Wait for image to reach a stable state

Wait for image to reach a stable state. This is similar to using --wait flag on other action commands, but without requiring a new action on the image.

Usage:

TerminalCode
scw instance image wait <image-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
image-idID of the image.Required
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1
timeoutTimeout of the waitDefault: 1h0m0s

Examples:

Wait for a image to reach a stable state

TerminalCode
scw instance image wait 11111111-1111-1111-1111-111111111111

IP management commands

A flexible IP address is an IP address which you hold independently of any Instance. You can attach it to any of your Instances and do live migration of the IP address between your Instances.

Note that attaching a flexible IP address to an Instance removes its previous public IP and interrupts any ongoing public connection to the Instance. This does not apply if you have migrated your server to the new Network stack and have at least one flexible IP attached to the Instance.

Attach an IP to a given server

Attach an IP to a given server.

Usage:

TerminalCode
scw instance ip attach <ip ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
ipIP or UUID of the IP.Required
server-idUUID of the server to attach the IP toRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Attach an IP to the given server

TerminalCode
scw instance ip attach 1.2.3.4 server-id=11111111-1111-1111-1111-111111111111

Reserve a flexible IP

Reserve a flexible IP and attach it to the specified Instance.

Usage:

TerminalCode
scw instance ip create [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
project-idProject ID to use. If none is passed the default project ID will be used
tags.{index}Tags of the IP
serverUUID of the Instance you want to attach the IP to
typeIP type to reserve (either 'routed_ipv4' or 'routed_ipv6')One of: unknown_iptype, routed_ipv4, routed_ipv6
organization-idOrganization ID to use. If none is passed the default organization ID will be used
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Create an IP in the default zone

TerminalCode
scw instance ip create

Create an IP in fr-par-1 zone

TerminalCode
scw instance ip create zone=fr-par-1

Create an IP and attach it to the specified Instance

TerminalCode
scw instance ip create server=11111111-1111-1111-1111-111111111111

Delete a flexible IP

Delete the IP with the specified ID.

Usage:

TerminalCode
scw instance ip delete <ip ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
ipID or address of the IP to deleteRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Delete an IP in the default zone with the specified ID

TerminalCode
scw instance ip delete 11111111-1111-1111-1111-111111111111

Delete an IP in fr-par-1 zone with the specified ID

TerminalCode
scw instance ip delete 11111111-1111-1111-1111-111111111111 zone=fr-par-1

Delete an IP using directly the specified IP address

TerminalCode
scw instance ip delete 51.15.253.183

Detach an ip from its server

Detach an ip from its server.

Usage:

TerminalCode
scw instance ip detach <ip ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
ipIP or UUID of the IP.Required
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Detach an IP by using its UUID

TerminalCode
scw instance ip detach 11111111-1111-1111-1111-111111111111

Detach an IP by using its IP address

TerminalCode
scw instance ip detach 1.2.3.4

Get a flexible IP

Get details of an IP with the specified ID or address.

Usage:

TerminalCode
scw instance ip get <ip ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
ipIP ID or address to getRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Get an IP in the default zone with the specified ID

TerminalCode
scw instance ip get 11111111-1111-1111-1111-111111111111

Get an IP in fr-par-1 zone with the specified ID

TerminalCode
scw instance ip get 11111111-1111-1111-1111-111111111111 zone=fr-par-1

Get an IP, directly using the specified IP address

TerminalCode
scw instance ip get 51.15.253.183

List all flexible IPs

List all flexible IPs in a specified zone.

Usage:

TerminalCode
scw instance ip list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
project-idProject ID in which the IPs are reserved
tagsFilter IPs with these exact tags (to filter with several tags, use commas to separate them)
nameFilter on the IP address (Works as a LIKE operation on the IP address)
typeFilter on the IP Mobility IP type (whose value should be either 'routed_ipv4' or 'routed_ipv6')
organization-idOrganization ID in which the IPs are reserved
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1, all

Examples:

List all IPs in the default zone

TerminalCode
scw instance ip list

List all IPs in fr-par-1 zone

TerminalCode
scw instance ip list zone=fr-par-1

Update a flexible IP

Update a flexible IP in the specified zone with the specified ID.

Usage:

TerminalCode
scw instance ip update <ip ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
ipIP ID or IP addressRequired
reverseReverse domain name
typeShould have no effectOne of: unknown_iptype, routed_ipv4, routed_ipv6
tags.{index}An array of keywords you want to tag this IP with
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Update an IP in the default zone with the specified ID

TerminalCode
scw instance ip update 11111111-1111-1111-1111-111111111111 reverse=example.com

Update an IP in fr-par-1 zone with the specified ID

TerminalCode
scw instance ip update 11111111-1111-1111-1111-111111111111 zone=fr-par-1 reverse=example.com

Update an IP using directly the specified IP address

TerminalCode
scw instance ip update 51.15.253.183 reverse=example.com

Placement group management commands

Placement groups allow the user to express a preference regarding the physical position of a group of Instances. The feature lets the user choose to either group Instances on the same physical hardware for best network throughput and low latency, or spread Instances across physically distanced hardware to reduce the risk of physical failure.

The operating mode is selected by a policy_type. Two policy types are available:

  • low_latency will group Instances on the same hypervisors
  • max_availability will spread Instances across physically distanced hypervisors

The policy_type is set to max_availability by default.

Create a placement group

Create a new placement group.

Usage:

TerminalCode
scw instance placement-group create [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
project-idProject ID to use. If none is passed the default project ID will be used
nameName of the placement groupDefault: <generated>
policy-typePolicy type of the placement groupDefault: max_availability
One of: unknown_policy_type, low_latency, max_availability
tags.{index}Tags of the placement group
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Create a max availability placement group with default name

TerminalCode
scw instance placement-group create

Create a max availability placement group with the specified name

TerminalCode
scw instance placement-group create name=foobar

Create a low latency placement group

TerminalCode
scw instance placement-group create policy-type=low_latency

Create a max availability placement group with tags

TerminalCode
scw instance placement-group create tags.0=foo tags.1=bar

Delete a placement group

Delete a specified placement group.

Usage:

TerminalCode
scw instance placement-group delete <placement-group-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
placement-group-idUUID of the placement group you want to deleteRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Delete a placement group in the default zone with the specified ID

TerminalCode
scw instance placement-group delete 11111111-1111-1111-1111-111111111111

Delete a placement group in nl-ams-1 zone with the specified ID

TerminalCode
scw instance placement-group delete 11111111-1111-1111-1111-111111111111 zone=nl-ams-1

Get a placement group

Get a specified placement group.

Usage:

TerminalCode
scw instance placement-group get <placement-group-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
placement-group-idUUID of the placement group you want to getRequired
list-serversWhether to list the servers in the Placement Group or not.Default: true
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Get a placement group with the specified ID

TerminalCode
scw instance placement-group get 6c15f411-3b6f-402d-8eba-ae24ef9254e9

Get placement group servers

Get all Instances belonging to the specified placement group.

Usage:

TerminalCode
scw instance placement-group get-servers <placement-group-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
placement-group-idUUID of the placement group you want to getRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

List placement groups

List all placement groups.

Usage:

TerminalCode
scw instance placement-group list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
page-tokenThe initial pagination token to start from
page-sizeThe maximum number of placement groups to return
order-byThe field by which to order the result listOne of: created_at_desc, created_at_asc, updated_at_desc, updated_at_asc
project-idProject ID to use. If none is passed the default project ID will be used
placement-group-ids.{index}List only placement groups with these IDs
nameFilter placement groups by name
tags.{index}List placement groups with these exact tags
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

List all placement groups in the default zone

TerminalCode
scw instance placement-group list

List placement groups that match a specified name ('cluster1' will return 'cluster100' and 'cluster1' but not 'foo')

TerminalCode
scw instance placement-group list name=cluster1

Set placement group

Set all parameters of the specified placement group.

Usage:

TerminalCode
scw instance placement-group set [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
placement-group-idRequired
name
policy-modeOne of: optional, enforced
policy-typeOne of: max_availability, low_latency
projectProject ID to use. If none is passed the default project ID will be used
tags.{index}
organizationOrganization ID to use. If none is passed the default organization ID will be used
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Set placement group servers

Set all Instances belonging to the specified placement group.

Usage:

TerminalCode
scw instance placement-group set-servers [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
placement-group-idUUID of the placement group you want to setRequired
servers.{index}An array of the Instances' UUIDs you want to configureRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Update the complete set of Instances in a specified placement group (all Instances must be shut down)

TerminalCode
scw instance placement-group set-servers placement-group-id=ced0fd4d-bcf0-4479-85b6-7027e54456e6 servers.0=5a250608-24ec-4c31-9631-b3ded8c861cb servers.1=e54fd249-0787-4794-ab14-af6ee74df274

Update a placement group

Update the properties of a specified placement group.

Usage:

TerminalCode
scw instance placement-group update <placement-group-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
placement-group-idUUID of the placement groupRequired
nameName of the placement group
policy-typePolicy type of the placement groupOne of: unknown_policy_type, low_latency, max_availability
tags.{index}Tags of the placement group
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Update the name of a placement group

TerminalCode
scw instance placement-group update 95053f33-cd3c-4cdc-b2b0-57d2dda97b13 name=foobar

Update the policy type of a placement group (all Instances in your placement group MUST be shutdown)

TerminalCode
scw instance placement-group update 0954ec26-9917-47b6-8c5c-7bc81d7bb9d2 policy-type=low_latency

Update the tags of a placement group

TerminalCode
scw instance placement-group update 1f883434-8c2d-40f0-b686-d0754b3a7bc0 tags.0=update-tag

Update placement group servers

Update all Instances belonging to the specified placement group.

Usage:

TerminalCode
scw instance placement-group update-servers [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
placement-group-idUUID of the placement group you want to updateRequired
servers.{index}An array of the Instances' UUIDs you want to configureRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Private NIC management commands

A Private NIC is the network interface that connects an Instance to a Private Network. An Instance can have multiple private NICs at the same time, but each NIC must belong to a different Private Network.

Create a private NIC connecting an Instance to a Private Network

Create a private NIC connecting an Instance to a Private Network. Some private NICs, such as those in deleting, detaching, or in error state are not listed in v1. Therefore, you may encounter quota limits errors when creating a new private NIC, even if your visible count is below the threshold. We strongly recommend migrating to v2alpha1 to see all private NICs.

Usage:

TerminalCode
scw instance private-nic create [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idUUID of the Instance the private NIC will be attached toRequired
private-network-idUUID of the private network where the private NIC will be attachedRequired
tags.{index}Private NIC tags
ip-ids.{index}Ip_ids defined from IPAMDeprecated
ipam-ip-ids.{index}UUID of IPAM ips, to be attached to the instance in the requested private network
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Delete a private NIC

Delete a private NIC.

Usage:

TerminalCode
scw instance private-nic delete [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idInstance to which the private NIC is attachedRequired
private-nic-idPrivate NIC unique IDRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Get a private NIC

Get private NIC properties.

Usage:

TerminalCode
scw instance private-nic get [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idInstance to which the private NIC is attachedRequired
private-nic-idThe private NIC unique ID or MAC addressRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

List all private NICs

List all private NICs of a specified Instance. Some private NICs, such as those in deleting, detaching, or in error state are not listed. We strongly recommend migrating to v2alpha1 to retrieve all private NICs.

Usage:

TerminalCode
scw instance private-nic list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idInstance to which the private NIC is attachedRequired
tagsPrivate NIC tags
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1, all

Examples:

List all private NICs on a specified server

TerminalCode
scw instance private-nic list

List private NICs of the Instance ID 'my_server_id'

TerminalCode
scw instance private-nic list server-id=my_server_id

Update a private NIC

Update one or more parameter(s) of a specified private NIC.

Usage:

TerminalCode
scw instance private-nic update [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idUUID of the Instance the private NIC will be attached toRequired
private-nic-idPrivate NIC unique IDRequired
tags.{index}Tags used to select private NIC/s
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Update tags of a private NIC

TerminalCode
scw instance private-nic update server-id=11111111-1111-1111-1111-111111111111 private-nic-id=11111111-1111-1111-1111-111111111111 tags.0=foo tags.1=bar

Security group management commands

A security group is a set of firewall rules on a set of Instances. Security groups enable you to create rules that either drop or allow incoming traffic from certain ports of your Instances.

Security groups are stateful by default which means return traffic is automatically allowed, regardless of any rules. As a contrary, you have to switch in a stateless mode to define explicitly allowed.

Remove all rules of a security group

Usage:

TerminalCode
scw instance security-group clear [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
security-group-idID of the security group to reset.Required
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Remove all rules of the given security group

TerminalCode
scw instance security-group clear security-group-id=11111111-1111-1111-1111-111111111111

Create a security group

Create a security group with a specified name and description.

Usage:

TerminalCode
scw instance security-group create [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
nameName of the security groupRequired
Default: <generated>
descriptionDescription of the security group
project-idProject ID to use. If none is passed the default project ID will be used
tags.{index}Tags of the security group
organization-defaultDefines whether this security group becomes the default security group for new InstancesDeprecated
project-defaultWhether this security group becomes the default security group for new Instances
statefulWhether the security group is stateful or notDefault: true
inbound-default-policyDefault policy for inbound rulesDefault: accept
One of: unknown_policy, accept, drop
outbound-default-policyDefault policy for outbound rulesDefault: accept
One of: unknown_policy, accept, drop
enable-default-securityTrue to block SMTP on IPv4 and IPv6. This feature is read only, please open a support ticket if you need to make it configurable
organization-idOrganization ID to use. If none is passed the default organization ID will be used
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Create a security group with a specified name and description

TerminalCode
scw instance security-group create name=foobar description=foobar foobar

Create a security group that will be applied as default on all Instances of this Project

TerminalCode
scw instance security-group create project-default=true

Create a security group that will have a default drop inbound policy (traffic your Instance receives)

TerminalCode
scw instance security-group create inbound-default-policy=drop

Create a security group that will have a default drop outbound policy (traffic your Instance transmits)

TerminalCode
scw instance security-group create outbound-default-policy=drop

Create a stateless security group

TerminalCode
scw instance security-group create

Create rule

Create a rule in the specified security group ID.

Usage:

TerminalCode
scw instance security-group create-rule [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
security-group-idUUID of the security groupRequired
protocolRequired
One of: unknown_protocol, TCP, UDP, ICMP, ANY
directionRequired
One of: unknown_direction, inbound, outbound
actionRequired
One of: unknown_action, accept, drop
ip-rangeRequired
Default: 0.0.0.0/0
dest-port-fromBeginning of the range of ports to apply this rule to (inclusive)
dest-port-toEnd of the range of ports to apply this rule to (inclusive)
positionPosition of this rule in the security group rules list
editableIndicates if this rule is editable (will be ignored)
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Allow incoming SSH

TerminalCode
scw instance security-group create-rule security-group-id=1248283f-17de-464a-b03b-3f975ada3fa8 protocol=TCP direction=inbound action=accept ip-range=<nil> dest-port-from=22

Allow HTTP

TerminalCode
scw instance security-group create-rule security-group-id=e8ba77c1-9ccb-4c0c-b08d-555cfd7f57e4 protocol=TCP direction=inbound action=accept ip-range=<nil> dest-port-from=80

Allow HTTPS

TerminalCode
scw instance security-group create-rule security-group-id=e5906437-8650-4fe2-8ca7-32e1d7320c1b protocol=TCP direction=inbound action=accept ip-range=<nil> dest-port-from=443

Allow a specified IP range

TerminalCode
scw instance security-group create-rule security-group-id=b6a58155-a2f8-48bd-9da9-3ff9783fa0d4 protocol=ANY direction=inbound action=accept ip-range=10.0.0.0/16

Allow FTP

TerminalCode
scw instance security-group create-rule security-group-id=9c46df03-83c2-46fb-936c-16ecb44860e1 protocol=TCP direction=inbound action=accept ip-range=<nil> dest-port-from=20 dest-port-to=21

Delete a security group

Delete a security group with the specified ID.

Usage:

TerminalCode
scw instance security-group delete <security-group-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
security-group-idUUID of the security group you want to deleteRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Delete the security group with the specified ID

TerminalCode
scw instance security-group delete 69e17c83-9945-47ac-8b29-8c1ad050ee83

Delete rule

Delete a security group rule with the specified ID.

Usage:

TerminalCode
scw instance security-group delete-rule [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
security-group-idRequired
security-group-rule-idRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Delete a security group rule with the specified ID

TerminalCode
scw instance security-group delete-rule security-group-id=a01a36e5-5c0c-42c1-ae06-167e587b7ac4 security-group-rule-id=b8c773ef-a6ea-4b50-a7c1-737864290a3f

Edit all rules of a security group

This command starts your default editor to edit a marshaled version of your resource Default editor will be taken from $VISUAL, then $EDITOR or an editor based on your system

Usage:

TerminalCode
scw instance security-group edit <security-group-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
security-group-idID of the security group to reset.Required
modemarshaling used when editing dataDefault: yaml
One of: yaml, json
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Get a security group

Get the details of a security group with the specified ID.

Usage:

TerminalCode
scw instance security-group get <security-group-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
security-group-idUUID of the security group you want to getRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Get a security group with the specified ID

TerminalCode
scw instance security-group get a3244331-5d32-4e36-9bf9-b60233e201c7

Get rule

Get details of a security group rule with the specified ID.

Usage:

TerminalCode
scw instance security-group get-rule [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
security-group-idRequired
security-group-rule-idRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Get details of a security group rule with the specified ID

TerminalCode
scw instance security-group get-rule security-group-id=d900fa38-2f0d-4b09-b6d7-f3e46a13f34c security-group-rule-id=1f9a16a5-7229-4c03-9327-253e257cf38a

List security groups

List all existing security groups.

Usage:

TerminalCode
scw instance security-group list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
nameName of the security group
project-idSecurity group Project ID
tagsList security groups with these exact tags (to filter with several tags, use commas to separate them)
project-defaultFilter security groups with this value for project_default
organization-idSecurity group Organization ID
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1, all

Examples:

List all security groups that match the specified name

TerminalCode
scw instance security-group list name=foobar

Get default rules

Lists the default rules applied to all the security groups.

Usage:

TerminalCode
scw instance security-group list-default-rules [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

List rules

List the rules of the a specified security group ID.

Usage:

TerminalCode
scw instance security-group list-rules [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
security-group-idUUID of the security groupRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1, all

Update all the rules of a security group

Replaces the existing rules of the security group with the rules provided. This endpoint supports the update of existing rules, creation of new rules and deletion of existing rules when they are not passed in the request.

Usage:

TerminalCode
scw instance security-group set-rules [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
security-group-idUUID of the security group to update the rules onRequired
rules.{index}.idUUID of the security rule to update. If no value is provided, a new rule will be created
rules.{index}.actionAction to apply when the rule matches a packetOne of: unknown_action, accept, drop
rules.{index}.protocolProtocol family this rule applies toOne of: unknown_protocol, TCP, UDP, ICMP, ANY
rules.{index}.directionDirection the rule applies toOne of: unknown_direction, inbound, outbound
rules.{index}.ip-rangeRange of IP addresses these rules apply to
rules.{index}.dest-port-fromBeginning of the range of ports this rule applies to (inclusive). This value will be set to null if protocol is ICMP or ANY
rules.{index}.dest-port-toEnd of the range of ports this rule applies to (inclusive). This value will be set to null if protocol is ICMP or ANY, or if it is equal to dest_port_from
rules.{index}.positionPosition of this rule in the security group rules list. If several rules are passed with the same position, the resulting order is undefined
rules.{index}.editableIndicates if this rule is editable. Rules with the value false will be ignored
rules.{index}.zoneZone of the rule. This field is ignored
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Update a security group

Update the properties of security group.

Usage:

TerminalCode
scw instance security-group update <security-group-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
security-group-idUUID of the security groupRequired
nameName of the security group
descriptionDescription of the security group
enable-default-securityTrue to block SMTP on IPv4 and IPv6. This feature is read only, please open a support ticket if you need to make it configurable
inbound-default-policyDefault inbound policyOne of: unknown_policy, accept, drop
tags.{index}Tags of the security group
organization-defaultPlease use project_default insteadDeprecated
project-defaultTrue use this security group for future Instances created in this project
outbound-default-policyDefault outbound policyOne of: unknown_policy, accept, drop
statefulTrue to set the security group as stateful
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Update security group rule

Update the properties of a rule from a specified security group.

Usage:

TerminalCode
scw instance security-group update-rule [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
security-group-idUUID of the security groupRequired
security-group-rule-idUUID of the ruleRequired
protocolProtocol family this rule applies toOne of: unknown_protocol, TCP, UDP, ICMP, ANY
directionDirection the rule applies toOne of: unknown_direction, inbound, outbound
actionAction to apply when the rule matches a packetOne of: unknown_action, accept, drop
ip-rangeRange of IP addresses these rules apply to
dest-port-fromBeginning of the range of ports this rule applies to (inclusive). If 0 is provided, unset the parameter.
dest-port-toEnd of the range of ports this rule applies to (inclusive). If 0 is provided, unset the parameter.
positionPosition of this rule in the security group rules list
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Instance management commands

Instances are computing units providing resources to run your applications on. Scaleway offers various Instance types including Virtual Instances and dedicated GPU Instances. Note: Instances can be referenced as "servers" in API endpoints.

Perform a raw API action on a server

Usage:

TerminalCode
scw instance server action <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
actionThe raw API action to perform, as listed with 'scw instance server list-actions'Required
server-idID of the server affected by the action.Required
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Start a server in the default zone with a given id

TerminalCode
scw instance server action 11111111-1111-1111-1111-111111111111 action=poweron

Attach a filesystem volume to an Instance

Attach a filesystem volume to an Instance.

Usage:

TerminalCode
scw instance server attach-filesystem [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idRequired
filesystem-id
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Attach an IP to a server

Usage:

TerminalCode
scw instance server attach-ip <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idID of the serverRequired
ipUUID of the IP to attach or its UUIDRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Attach an IP to a server

TerminalCode
scw instance server attach-ip 11111111-1111-1111-1111-111111111111 ip=11111111-1111-1111-1111-111111111111

Attach an IP to a server

TerminalCode
scw instance server attach-ip 11111111-1111-1111-1111-111111111111 ip=1.2.3.4

Attach a volume to an Instance

Attach a volume to an Instance.

Usage:

TerminalCode
scw instance server attach-volume [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idRequired
volume-id
volume-typeOne of: unknown_volume_type, l_ssd, b_ssd, sbs_volume
boot
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Backup server

Create a new image based on the server.

This command:

  • creates a snapshot of all attached volumes.
  • creates an image based on all these snapshots.

Once your image is ready you will be able to create a new server based on this image.

Usage:

TerminalCode
scw instance server backup <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idID of the server to backup.Required
nameName of your backup.Default: <generated>
unifiedWhether or not the type of the snapshot is unified.
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Create a new image based on a server

TerminalCode
scw instance server backup 11111111-1111-1111-1111-111111111111

Connect to the serial console of an instance

Usage:

TerminalCode
scw instance server console <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idServer ID to connect toRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1
ws-urlWebSocket URL to connect to (overrides default)

Create server

Create an instance server.

Usage:

TerminalCode
scw instance server create [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
imageImage ID or label of the serverRequired
Default: ubuntu_jammy
typeServer commercial type (help: https://www.scaleway.com/en/docs/compute/instances/reference-content/choosing-instance-type/Open in new context)Required
nameServer nameDefault: <generated>
root-volumeLocal root volume of the server
additional-volumes.{index}Additional local and block volumes attached to your server
ipEither an IP, an IP ID, ('new', 'ipv4', 'ipv6' or 'both') to create new IPs, 'dynamic' to use a dynamic IP or 'none' for no public IP (newipv4
dynamic-ip-requiredDefine if a dynamic IPv4 is required for the Instance. If server has no IPv4, a dynamic one will be allocated.Default: true
tags.{index}Server tags
ipv6Enable IPv6, to be used with routed-ip-enabled=false
stoppedDo not start server after its creation
security-group-idThe security group ID used for this server
placement-group-idThe placement group ID in which the server has to be created
cloud-initThe cloud-init script to use
boot-typeThe boot type to use, if empty the local boot will be used. Will be overwritten to bootscript if bootscript-id is set.Default: local
One of: local, bootscript, rescue
admin-password-encryption-ssh-key-idID of the IAM SSH Key used to encrypt generated admin password. Required when creating a windows server.
project-idProject ID to use. If none is passed the default project ID will be used
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1
organization-idOrganization ID to use. If none is passed the default organization ID will be used

Examples:

Create and start an instance on Ubuntu Focal

TerminalCode
scw instance server create image=ubuntu_focal

Create a GP1-XS instance, give it a name and add tags

TerminalCode
scw instance server create image=ubuntu_focal type=GP1-XS name=foo tags.0=prod tags.1=blue

Create an instance with 2 additional block volumes (50GB and 100GB)

TerminalCode
scw instance server create image=ubuntu_focal additional-volumes.0=block:50GB additional-volumes.1=block:100GB

Create an instance with 2 local volumes (10GB and 10GB)

TerminalCode
scw instance server create image=ubuntu_focal root-volume=local:10GB additional-volumes.0=local:10GB

Create an instance with a SBS root volume (100GB and 15000 iops)

TerminalCode
scw instance server create image=ubuntu_focal root-volume=sbs:100GB:15000

Create an instance with volumes from snapshots

TerminalCode
scw instance server create image=ubuntu_focal root-volume=local:<snapshot_id> additional-volumes.0=block:<snapshot_id>

Create and start an instance from a snapshot

TerminalCode
scw instance server create image=none root-volume=local:<snapshot_id>

Create and start an instance using existing volume

TerminalCode
scw instance server create image=ubuntu_focal additional-volumes.0=<volume_id>

Use an existing IP

TerminalCode
ip=$(scw instance ip create | grep id | awk '{ print $2 }') scw instance server create image=ubuntu_focal ip=$ip

Delete server

Delete a server with the given ID.

Usage:

TerminalCode
scw instance server delete <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idRequired
with-volumesDelete the volumes attached to the serverDefault: all
One of: none, local, block, root, all
with-ipDelete the IP attached to the server
force-shutdownForce shutdown of the instance server before deleting it
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Delete a server in the default zone with a given id

TerminalCode
scw instance server delete 11111111-1111-1111-1111-111111111111

Delete a server in fr-par-1 zone with a given id

TerminalCode
scw instance server delete 11111111-1111-1111-1111-111111111111 zone=fr-par-1

Detach a filesystem volume from an Instance

Detach a filesystem volume from an Instance.

Usage:

TerminalCode
scw instance server detach-filesystem [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idRequired
filesystem-id
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Detach an IP from a server

Usage:

TerminalCode
scw instance server detach-ip <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idUUID of the server.Required
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Detach IP from a given server

TerminalCode
scw instance server detach-ip 11111111-1111-1111-1111-111111111111

Detach a volume from an Instance

Detach a volume from an Instance.

Usage:

TerminalCode
scw instance server detach-volume [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idRequired
volume-id
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Migrate server to IP mobility

Enable routed IP for this server and migrate the nat public IP to routed Server will reboot ! https://www.scaleway.com/en/docs/compute/instances/api-cli/using-ip-mobility/Open in new context

Usage:

TerminalCode
scw instance server enable-routed-ip <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idID of the server affected by the action.Required
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Migrate a server with legacy network to IP mobility

TerminalCode
scw instance server enable-routed-ip 11111111-1111-1111-1111-111111111111

Get an Instance

Get the details of a specified Instance.

Usage:

TerminalCode
scw instance server get <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idUUID of the Instance you want to getRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Get the Instance with its specified ID

TerminalCode
scw instance server get 94ededdf-358d-4019-9886-d754f8a2e78d

Get Instance compatible types

Get compatible commercial types that can be used to update the Instance. The compatibility of an Instance offer is based on:

  • the CPU architecture
  • the OS type
  • the required l_ssd storage size
  • the required scratch storage size If the specified Instance offer is flagged as end of service, the best compatible offer is the first returned.

Usage:

TerminalCode
scw instance server get-compatible-types <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idUUID of the Instance you want to getRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Get your server rdp password and decrypt it using your ssh key

Usage:

TerminalCode
scw instance server get-rdp-password <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idServer ID to connect toRequired
keyPath of the SSH key used to decrypt the rdp passwordDefault: ~/.ssh/id_rsa
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1

List all Instances

List all Instances in a specified Availability Zone, e.g. fr-par-1.

Usage:

TerminalCode
scw instance server list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
project-idList only Instances of this Project ID
nameFilter Instances by name (eg. "server1" will return "server100" and "server1" but not "foo")
private-ipList Instances by private_ipDeprecated
without-ipList Instances that are not attached to a public IP
with-ipList Instances by IP (both private_ip and public_ip are supported)
commercial-typeList Instances of this commercial type
stateList Instances in this stateOne of: running, stopped, stopped in place, starting, stopping, locked
tagsList Instances with these exact tags (to filter with several tags, use commas to separate them)
private-networkList Instances in this Private Network
orderDefine the order of the returned serversOne of: creation_date_desc, creation_date_asc, modification_date_desc, modification_date_asc
private-networksList Instances from the given Private Networks (use commas to separate them)
private-nic-mac-addressList Instances associated with the given private NIC MAC address
serversList Instances from these server ids (use commas to separate them)
organization-idList only Instances of this Organization ID
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1, all

Examples:

List all Instances on your default zone

TerminalCode
scw instance server list

List Instances of this commercial type

TerminalCode
scw instance server list commercial-type=DEV1-S

List Instances that are not attached to a public IP

TerminalCode
scw instance server list without-ip=true

List Instances that match the specified name ('server1' will return 'server100' and 'server1' but not 'foo')

TerminalCode
scw instance server list name=server1

List Instance actions

List all actions (e.g. power on, power off, reboot) that can currently be performed on an Instance.

Usage:

TerminalCode
scw instance server list-actions [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Reboot server

Usage:

TerminalCode
scw instance server reboot <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idID of the server affected by the action.Required
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Reboot a server in the default zone with a given id

TerminalCode
scw instance server reboot 11111111-1111-1111-1111-111111111111

Reboot a server in fr-par-1 zone with a given id

TerminalCode
scw instance server reboot 11111111-1111-1111-1111-111111111111 zone=fr-par-1

SSH into a server

Connect to distant server via the SSH protocol.

Usage:

TerminalCode
scw instance server ssh <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idServer ID to SSH intoRequired
usernameUsername used for the SSH connectionDefault: root
portPort used for the SSH connectionDefault: 22
commandCommand to execute on the remote server
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Put server in standby mode

Usage:

TerminalCode
scw instance server standby <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idID of the server affected by the action.Required
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Put in standby a server in the default zone with a given id

TerminalCode
scw instance server standby 11111111-1111-1111-1111-111111111111

Put in standby a server in fr-par-1 zone with a given id

TerminalCode
scw instance server standby 11111111-1111-1111-1111-111111111111 zone=fr-par-1

Power on server

Usage:

TerminalCode
scw instance server start <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idID of the server affected by the action.Required
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Start a server in the default zone with a given id

TerminalCode
scw instance server start 11111111-1111-1111-1111-111111111111

Start a server in fr-par-1 zone with a given id

TerminalCode
scw instance server start 11111111-1111-1111-1111-111111111111 zone=fr-par-1

Power off server

Usage:

TerminalCode
scw instance server stop <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idID of the server affected by the action.Required
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Stop a server in the default zone with a given id

TerminalCode
scw instance server stop 11111111-1111-1111-1111-111111111111

Stop a server in fr-par-1 zone with a given id

TerminalCode
scw instance server stop 11111111-1111-1111-1111-111111111111 zone=fr-par-1

Terminate server

Terminates a server with the given ID and all of its volumes.

Usage:

TerminalCode
scw instance server terminate <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idRequired
with-ipDelete the IP attached to the server
with-blockDelete the Block Storage volumes attached to the serverDefault: prompt
One of: prompt, true, false
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Terminate a server in the default zone with a given id

TerminalCode
scw instance server terminate 11111111-1111-1111-1111-111111111111

Terminate a server in fr-par-1 zone with a given id

TerminalCode
scw instance server terminate 11111111-1111-1111-1111-111111111111 zone=fr-par-1

Terminate a server and also delete its flexible IPs

TerminalCode
scw instance server terminate 11111111-1111-1111-1111-111111111111 with-ip=true

Update an Instance

Update the Instance information, such as name, boot mode, or tags.

Usage:

TerminalCode
scw instance server update <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idUUID of the InstanceRequired
nameName of the Instance
ipIP that should be attached to the server (use ip=none to detach)
cloud-initThe cloud-init script to use
boot-typeOne of: local, bootscript, rescue
tags.{index}Tags of the Instance
volumes.{key}.bootForce the Instance to boot on this volumeDefault: false
volumes.{key}.base-snapshotID of the snapshot on which this volume will be based
volumes.{key}.projectProject ID of the volume
volumes.{key}.organizationOrganization ID of the volume
dynamic-ip-required
routed-ip-enabledTrue to configure the instance so it uses the new routed IP mode (once this is set to True you cannot set it back to False)Deprecated
public-ips.{index}A list of reserved IP IDs to attach to the Instance
enable-ipv6Deprecated
protectedTrue to activate server protection option
security-group-id
volume-ids.{index}Will update ALL volume IDs at once, including the root volume of the server (use volume-ids=none to detach all volumes)
placement-group-idPlacement group ID if Instance must be part of a placement group
private-nics.{index}Instance private NICs
commercial-typeSet the commercial_type for this Instance.
admin-password-encryption-ssh-key-idUUID of the SSH RSA key that will be used to encrypt the initial admin password for OS requiring it. Mandatory for Windows OS.
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Update the name of a specified Instance

TerminalCode
scw instance server update 11111111-1111-1111-1111-111111111111 name=foobar

Switch a specified Instance to rescue mode (reboot is required to access rescue mode)

TerminalCode
scw instance server update 11111111-1111-1111-1111-111111111111 boot-type=rescue

Overwrite tags of a specified Instance

TerminalCode
scw instance server update 11111111-1111-1111-1111-111111111111 tags.0=foo tags.1=bar

Apply the specified security group to a specified server

TerminalCode
scw instance server server update 11111111-1111-1111-1111-111111111111 security-group-id=11111111-1111-1111-1111-111111111111

Put a specified Instance in the specified placement group. Instance must be off

TerminalCode
scw instance server server update 11111111-1111-1111-1111-111111111111 placement-group-id=11111111-1111-1111-1111-111111111111

Boot an Instance from a specific volume

TerminalCode
scw instance server update 11111111-1111-1111-1111-111111111111 volumes.0.id=11111111-1111-1111-1111-111111111111 volumes.0.boot=true

Wait for server to reach a stable state

Wait for server to reach a stable state. This is similar to using --wait flag on other action commands, but without requiring a new action on the server.

Usage:

TerminalCode
scw instance server wait <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
timeoutTimeout of the waitDefault: 10m0s
server-idID of the server affected by the action.Required
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Wait for a server to reach a stable state

TerminalCode
scw instance server wait 11111111-1111-1111-1111-111111111111

Instance type management commands

All Instance types available in a specified zone. Each type contains all the features of the Instance (CPU, RAM, Storage) as well as their associated pricing.

Get availability

Get availability for all Instance types.

Usage:

TerminalCode
scw instance server-type get [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

List Instance types

List available Instance types and their technical details.

Usage:

TerminalCode
scw instance server-type list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

List all server-types in the default zone

TerminalCode
scw instance server-type list

List all server-types in fr-par-1 zone

TerminalCode
scw instance server-type list zone=fr-par-1

Snapshot management commands

Snapshots contain the data of a specified volume at a particular point in time. The data can include the Instance's operating system, configuration information and/or files stored on the volume.

A snapshot can be done from a specified volume, e.g. you have one Instance with a volume containing the OS and another one containing the application data, and you want to use different snapshot strategies on both volumes.

Volumes can be created from snapshots of their own type.

Migrate a volume and/or snapshots to SBS (Scaleway Block Storage)

To be used, the call to this endpoint must be preceded by a call to the Get a volume or snapshot's migration plan endpoint. To migrate all resources mentioned in the migration plan, the validation_key returned in the plan must be provided.

Usage:

TerminalCode
scw instance snapshot apply-migration <snapshot-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
snapshot-idThe snapshot to migrate, along with potentially other resources, according to the migration plan generated with a call to the Get a volume or snapshot's migration plan endpoint.
validation-keyA value to be retrieved from a call to the Get a volume or snapshot's migration plan endpoint, to confirm that the volume and/or snapshots specified in said plan should be migrated.Required
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Create a snapshot from a specified volume or from a QCOW2 file

Create a snapshot from a specified volume or from a QCOW2 file in a specified Availability Zone.

Usage:

TerminalCode
scw instance snapshot create [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
nameName of the snapshotDefault: <generated>
volume-idUUID of the volume
unifiedWhether a snapshot is unified or not.
tags.{index}Tags of the snapshot
project-idProject ID to use. If none is passed the default project ID will be used
bucketBucket name for snapshot imports
keyObject key for snapshot imports
sizeImported snapshot size, must be a multiple of 512
organization-idOrganization ID to use. If none is passed the default organization ID will be used
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Create a snapshot in the default zone from the specified volume ID

TerminalCode
scw instance snapshot create volume-id=11111111-1111-1111-1111-111111111111

Create a snapshot in fr-par-1 zone from the specified volume ID

TerminalCode
scw instance snapshot create zone=fr-par-1 volume-id=11111111-1111-1111-1111-111111111111

Create a named snapshot from the specified volume ID

TerminalCode
scw instance snapshot create name=foobar volume-id=11111111-1111-1111-1111-111111111111

Import a QCOW file as an Instance snapshot

TerminalCode
scw instance snapshot create zone=fr-par-1 name=my-imported-snapshot volume-type=l_ssd bucket=my-bucket key=my-qcow2-file-name

Delete a snapshot

Delete the snapshot with the specified ID.

Usage:

TerminalCode
scw instance snapshot delete <snapshot-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
snapshot-idUUID of the snapshot you want to deleteRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Delete a snapshot in the default zone with the specified ID

TerminalCode
scw instance snapshot delete 11111111-1111-1111-1111-111111111111

Delete a snapshot in fr-par-1 zone with the specified ID

TerminalCode
scw instance snapshot delete 11111111-1111-1111-1111-111111111111 zone=fr-par-1

Export a snapshot

Export a snapshot to a specified Object Storage bucket in the same region.

Usage:

TerminalCode
scw instance snapshot export [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
bucketObject Storage bucket name
keyObject key
snapshot-idSnapshot IDRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Export a snapshot to an Object Storage bucket

TerminalCode
scw instance snapshot export zone=fr-par-1 snapshot-id=11111111-1111-1111-1111-111111111111 bucket=my-bucket key=my-qcow2-file-name

Get a snapshot

Get details of a snapshot with the specified ID.

Usage:

TerminalCode
scw instance snapshot get <snapshot-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
snapshot-idUUID of the snapshot you want to getRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Get a snapshot in the default zone with the specified ID

TerminalCode
scw instance snapshot get 11111111-1111-1111-1111-111111111111

Get a snapshot in fr-par-1 zone with the specified ID

TerminalCode
scw instance snapshot get 11111111-1111-1111-1111-111111111111 zone=fr-par-1

List snapshots

List all snapshots of an Organization in a specified Availability Zone.

Usage:

TerminalCode
scw instance snapshot list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
project-idList snapshots only for this Project ID
nameList snapshots of the requested name
tagsList snapshots that have the requested tag
base-volume-idList snapshots originating only from this volume
organization-idList snapshots only for this Organization ID
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1, all

Examples:

List all snapshots in the default zone

TerminalCode
scw instance snapshot list

List all snapshots in fr-par-1 zone

TerminalCode
scw instance snapshot list zone=fr-par-1

Get a volume or snapshot's migration plan

Given a volume or snapshot, returns the migration plan but does not perform the actual migration. To perform the migration, you have to call the Migrate a volume and/or snapshots to SBS endpoint afterward. The endpoint returns the resources that should be migrated together:

  • the volume and any snapshots created from the volume, if the call was made to plan a volume migration.
  • the base volume of the snapshot (if the volume is not deleted) and its related snapshots, if the call was made to plan a snapshot migration. The endpoint also returns the validation_key, which must be provided to the Migrate a volume and/or snapshots to SBS endpoint to confirm that all resources listed in the plan should be migrated.

Usage:

TerminalCode
scw instance snapshot plan-migration <snapshot-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
snapshot-idThe snapshot for which the migration plan will be generated.
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Update a snapshot

Update the properties of a snapshot.

Usage:

TerminalCode
scw instance snapshot update <snapshot-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
snapshot-idUUID of the snapshotRequired
nameName of the snapshot
tags.{index}Tags of the snapshot
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Wait for snapshot to reach a stable state

Wait for snapshot to reach a stable state. This is similar to using --wait flag on other action commands, but without requiring a new action on the snapshot.

Usage:

TerminalCode
scw instance snapshot wait <snapshot-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
snapshot-idID of the snapshot.Required
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1
timeoutTimeout of the waitDefault: 1h0m0s

Examples:

Wait for a snapshot to reach a stable state

TerminalCode
scw instance snapshot wait 11111111-1111-1111-1111-111111111111

SSH Utilities

Command utilities around server SSH

  • Manage keys per server
  • Generate ssh config

Add a public key to a server

Key will be added to server's tags and added to root user on next restart. Key is expected in openssh format "(format) (key) (comment)". The comment will be used as key name or generated Lookup /root/.ssh/authorized_keys on your server for more information

Usage:

TerminalCode
scw instance ssh add-key [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idServer to add your key to
public-keyPublic key you want to add to your server
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Fetch SSH keys from the console and install them on multiple servers

Keys registered via the Scaleway Console will be propagated to the selected servers. The command 'ssh -t -l scw-fetch-ssh-keys --upgrade' will be run on the servers matching the zone and project filters. Keep in mind that you need to be able to connect to your server with another key than the one you want to add. Keep in mind that SSH keys are scoped by project.

Usage:

TerminalCode
scw instance ssh fetch-keys [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
project-idFetch the keys on all servers in the given Project
usernameUsername used for the SSH connectionDefault: root
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Install a ssh config with all your servers as host

It generate hosts for instance servers, baremetal, apple-silicon and bastions

Path of the config will be $HOME/.ssh/scaleway.config

Usage:

TerminalCode
scw instance ssh install-config [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
project-idProject ID to use. If none is passed the default project ID will be used
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1, all

List manually added public keys

List only keys added manually to a server using tags. The key comment is used as key name or generated Lookup /root/.ssh/authorized_keys on your server for more information

Usage:

TerminalCode
scw instance ssh list-keys <server-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idServer which keys are to be listedRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Remove a manually added public key from a server

Key will be remove from server's tags and removed from root user on next restart. Keys are identified by their comment as in openssh format. Lookup /root/.ssh/authorized_keys on your server for more information

Usage:

TerminalCode
scw instance ssh remove-key [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idServer to add your key toRequired
nameName of the key you want to remove, has to be the key comment or the index
public-keyPublic key you want to remove
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Template management commands

Templates are blueprints for creating Instances with predefined configurations. A template includes specifications such as Instance type, attached volumes, security groups, placement groups, private networks, and public IP settings. Using templates allows you to standardize and automate Instance deployment across your infrastructure.

Check a template

Validate that a template is usable.

Usage:

TerminalCode
scw instance template check <template-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
template-idUnique ID of the template to checkRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Create a template

Create a new template from an Instance.

Usage:

TerminalCode
scw instance template create [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
project-idProject ID to use. If none is passed the default project ID will be used
nameName of the templateDefault: <generated>
tags.{index}Tags to associate with the template
server-tags.{index}Tags to associate with servers created from the template
server-typeCommercial type of the server defined by the templateRequired
security-group-idSecurity group ID for the template
placement-group-idPlacement group ID for the template
volumes.{index}.volume-typeType of the volumeOne of: unknown_volume_type, l_ssd, sbs, scratch
volumes.{index}.nameName of the volume
volumes.{index}.tags.{index}Tags associated with the volume
volumes.{index}.sizeSize of the volume in bytes
volumes.{index}.base-snapshot-idID of the base snapshot for the volume
volumes.{index}.image-labelLabel of the image used as base for the volume
volumes.{index}.perf-iopsPerformance IOPS for the volume
private-networks.{index}.private-network-idID of the private network
filesystem-ids.{index}List of filesystem IDs to associate with the template
public-ipv4-countNumber of IPv4 public IPs to attach to servers created from this template
public-ipv6-countNumber of IPv6 public IPs to attach to servers created from this template
windows-rdp-ssh-key-idIAM ID of the SSH key used to encrypt the Windows Administrator password for RDP use
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Create a server from a template

Create a new Instance using a specified template.

Usage:

TerminalCode
scw instance template create-server <template-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
template-idUnique ID of the template to useRequired
nameName of the new serverDefault: <generated>
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Delete a template

Delete a specified template.

Usage:

TerminalCode
scw instance template delete <template-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
template-idUnique ID of the template to deleteRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Delete template user data

Delete a specific user data key of a template.

Usage:

TerminalCode
scw instance template delete-user-data <template-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
template-idUnique ID of the templateRequired
keyKey of the user data to deleteRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Get a template

Get details of a specified template.

Usage:

TerminalCode
scw instance template get <template-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
template-idUnique ID of the template to retrieveRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Get template cloud-init

Get the cloud-init configuration of a template.

Usage:

TerminalCode
scw instance template get-cloud-init <template-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
template-idUnique ID of the templateRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Get template user data

Get a specific user data key of a template.

Usage:

TerminalCode
scw instance template get-user-data <template-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
template-idUnique ID of the templateRequired
keyKey of the user data to retrieveRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

List templates

List all available templates.

Usage:

TerminalCode
scw instance template list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
page-tokenToken for pagination
page-sizeNumber of items to return per page
order-byField to sort results byOne of: created_at_desc, created_at_asc, updated_at_desc, updated_at_asc
project-idProject ID to use. If none is passed the default project ID will be used
template-ids.{index}Filter by specific template IDs
nameFilter by template name
tags.{index}Filter by tags
server-tags.{index}Filter by server tags
security-group-ids.{index}Filter by security group IDs
placement-group-ids.{index}Filter by placement group IDs
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

List template user data keys

List all user data keys of a template.

Usage:

TerminalCode
scw instance template list-user-data-keys <template-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
page-tokenToken for pagination
page-sizeNumber of items to return per page
template-idUnique ID of the templateRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Set template cloud-init

Set the cloud-init configuration of a template.

Usage:

TerminalCode
scw instance template set-cloud-init <template-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
template-idUnique ID of the templateRequired
contentCloud-init configuration content
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Set template user data

Set a user data key of a template.

Usage:

TerminalCode
scw instance template set-user-data <template-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
template-idUnique ID of the templateRequired
keyKey of the user data to setRequired
contentContent of the user data
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Update a template

Update the properties of a template.

Usage:

TerminalCode
scw instance template update <template-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
nameNew name for the template
template-idUnique ID of the template to updateRequired
tags.{index}New tags for the template
server-tags.{index}New server tags for the template
server-typeNew server type for the template
security-group-idNew security group ID for the template
placement-group-idNew placement group ID for the template
volumes.{index}.volume-typeType of the volumeOne of: unknown_volume_type, l_ssd, sbs, scratch
volumes.{index}.nameName of the volume
volumes.{index}.tags.{index}Tags associated with the volume
volumes.{index}.sizeSize of the volume in bytes
volumes.{index}.base-snapshot-idID of the base snapshot for the volume
volumes.{index}.image-labelLabel of the image used as base for the volume
volumes.{index}.perf-iopsPerformance IOPS for the volume
private-networks.{index}.private-network-idID of the private network
filesystem-ids.{index}New list of filesystem IDs for the template
public-ipv4-countNew number of IPv4 public IPs to attach to servers
public-ipv6-countNew number of IPv6 public IPs to attach to servers
windows-rdp-ssh-key-idNew IAM ID of the SSH key used to encrypt the Windows Administrator password for RDP use
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

User data management commands

User data is a key/value store you can use to provide your instance with introspective data.

As an example of use, Scaleway images contain the 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_dataOpen in new context (or http://[fd00:42::42]/user_data using IPv6). The scaleway-ecosystem package, installed by default on all OS images provided by Scaleway, ships with the scw-userdata helper 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-port option (e.g. curl --local-port 1-1023 http://169.254.42.42/user_data).
  • From the Instance API by using the methods described below.

Delete user data

Delete the specified key from an Instance's user data.

Usage:

TerminalCode
scw instance user-data delete [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idUUID of the InstanceRequired
keyKey of the user data to deleteRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Get user data

Get the content of a user data with the specified key on an Instance.

Usage:

TerminalCode
scw instance user-data get [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idUUID of the InstanceRequired
keyKey of the user data to getRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

List user data

List all user data keys registered on a specified Instance.

Usage:

TerminalCode
scw instance user-data list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idUUID of the InstanceRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Add/set user data

Add or update a user data with the specified key on an Instance.

Usage:

TerminalCode
scw instance user-data set [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
server-idUUID of the InstanceRequired
keyKey of the user data to setRequired
contentContent of the user dataRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Volume management commands

A volume is where you store your data inside your Instance. It appears as a block device on Linux that you can use to create a filesystem and mount it.

The Instance API only supports local (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/Open in new context).

Minimum and maximum volume sizes for each volume types can be queried from the zone /products/volumes API endpoint. I.e for:

Each type of volume is also subject to a global quota for the sum of all the volumes. This quota depends of the level of support and may be changed on demand.

When using multiple block devices, it's advised to mount them by using their UUID instead of their device name. A device name is subject to change depending on the volumes order. Block devices UUIDs can be found in /dev/disk/by-id/.

Migrate a volume and/or snapshots to SBS (Scaleway Block Storage)

To be used, the call to this endpoint must be preceded by a call to the Get a volume or snapshot's migration plan endpoint. To migrate all resources mentioned in the migration plan, the validation_key returned in the plan must be provided.

Usage:

TerminalCode
scw instance volume apply-migration <volume-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
volume-idThe volume to migrate, along with potentially other resources, according to the migration plan generated with a call to the Get a volume or snapshot's migration plan endpoint.
validation-keyA value to be retrieved from a call to the Get a volume or snapshot's migration plan endpoint, to confirm that the volume and/or snapshots specified in said plan should be migrated.Required
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Create a volume

Create a volume of a specified type in an Availability Zone.

Usage:

TerminalCode
scw instance volume create [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
nameVolume nameDefault: <generated>
project-idProject ID to use. If none is passed the default project ID will be used
tags.{index}Volume tags
volume-typeVolume typeOne of: l_ssd, b_ssd, unified, scratch, sbs_volume, sbs_snapshot
sizeVolume disk size, must be a multiple of 512
base-snapshotID of the snapshot on which this volume will be based
organization-idOrganization ID to use. If none is passed the default organization ID will be used
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Create a volume called 'my-volume'

TerminalCode
scw instance volume create name=my-volume

Create a volume with a size of 50GB

TerminalCode
scw instance volume create size=50GB

Delete a volume

Delete the volume with the specified ID.

Usage:

TerminalCode
scw instance volume delete <volume-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
volume-idUUID of the volume you want to deleteRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Delete a volume with the specified ID

TerminalCode
scw instance volume delete af136619-bc59-4b48-a0ed-ed7dceaad9a6

Get a volume

Get details of a volume with the specified ID.

Usage:

TerminalCode
scw instance volume get <volume-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
volume-idUUID of the volume you want to getRequired
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Get a volume with the specified ID

TerminalCode
scw instance volume get b70e9a0e-28b1-4542-bb9b-06d2d6debc0f

List volumes

List volumes in the specified Availability Zone. You can filter the output by volume type.

Usage:

TerminalCode
scw instance volume list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
volume-typeFilter by volume typeOne of: l_ssd, b_ssd, unified, scratch, sbs_volume, sbs_snapshot
project-idFilter volume by Project ID
tagsFilter volumes with these exact tags (to filter with several tags, use commas to separate them)
nameFilter volume by name (for eg. "vol" will return "myvolume" but not "data")
organization-idFilter volume by Organization ID
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1, all

Examples:

List all volumes

TerminalCode
scw instance volume list

List all volumes that match a name

TerminalCode
scw instance volume list name=foobar

Get a volume or snapshot's migration plan

Given a volume or snapshot, returns the migration plan but does not perform the actual migration. To perform the migration, you have to call the Migrate a volume and/or snapshots to SBS endpoint afterward. The endpoint returns the resources that should be migrated together:

  • the volume and any snapshots created from the volume, if the call was made to plan a volume migration.
  • the base volume of the snapshot (if the volume is not deleted) and its related snapshots, if the call was made to plan a snapshot migration. The endpoint also returns the validation_key, which must be provided to the Migrate a volume and/or snapshots to SBS endpoint to confirm that all resources listed in the plan should be migrated.

Usage:

TerminalCode
scw instance volume plan-migration <volume-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
volume-idThe volume for which the migration plan will be generated.
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Update a volume

Replace the name and/or size properties of a volume specified by its ID, with the specified value(s).

Usage:

TerminalCode
scw instance volume update <volume-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
volume-idUUID of the volumeRequired
nameVolume name
tags.{index}Tags of the volume
sizeVolume disk size, must be a multiple of 512
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Change the volume name

TerminalCode
scw instance volume update 11111111-1111-1111-1111-111111111111 name=my-new-name

Change the volume disk size (bytes)

TerminalCode
scw instance volume update 11111111-1111-1111-1111-111111111111 size=60GB

Change the volume name and disk size

TerminalCode
scw instance volume update 11111111-1111-1111-1111-111111111111 name=a-new-name size=70GB

Wait for volume to reach a stable state

Wait for volume to reach a stable state. This is similar to using --wait flag on other action commands, but without requiring a new action on the volume.

Usage:

TerminalCode
scw instance volume wait <volume-id ...> [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
timeoutTimeout of the waitDefault: 10m0s
volume-idID of the volume affected by the action.Required
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

Wait for a volume to reach a stable state

TerminalCode
scw instance volume wait 11111111-1111-1111-1111-111111111111

Volume type management commands

All volume types available in a specified zone. Each of these types will contains all the capabilities and constraints of the volume (min size, max size, snapshot).

List volume types

List all volume types and their technical details.

Usage:

TerminalCode
scw instance volume-type list [arg=value ...]

Arguments:

NameDescriptionArgument Specifications
zoneZone to target. If none is passed will use default zone from the configDefault: fr-par-1
One of: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2, pl-waw-3, it-mil-1

Examples:

List all volume-types in the default zone

TerminalCode
scw instance volume-type list

List all volume-types in fr-par-1 zone

TerminalCode
scw instance volume-type list zone=fr-par-1