You can find the ID of your Instance on it’s overview page in the Scaleway console or using the CLI by running the following command: scw instance server list
.
Changing the commercial type of an Instance with the API or CLI
It is possible to change the commercial type of an Instance by using the Scaleway CLI tool or the Instances API. To do so, you need the Instance’s ID and a valid API key.
Before you start
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- An Instance, which must be stopped and not be in a placement group
-
Stop the Instance.
scw instance server stop <instance_id> zone=<zone>Replace
<zone>
with the Availability Zone of your Instance. For example, if your Instance is located in Paris-1, the zone would befr-par-1
. Replace<instance_id>
with the ID of your Instance.Tip -
Update the commercial type of the Instance
scw instance server update <instance_id> commercial-type=<NEW_INSTANCE_TYPE> zone=<zone>Replace
<new_instance_type>
with the desired new commercial type.TipYou can retrieve a list of all available Instance types using the command
scw instance server-type list
.ImportantEnsure that Local Storage constraints are respected. For example, downgrading from a larger Instance type to a smaller one may not be possible if the smaller Instance type cannot support the existing Local Storage. Check the Scaleway documentation for specific constraints.
-
Power on the Instance.
scw instance server start <instance_id> zone=<zone>
You have successfully changed the commercial type of your Scaleway Instance using the Scaleway CLI. For further information, refer to the Instance CLI documentation.
-
Stop the Instance. Replace
{zone}
with the Availability Zone of your Instance. This value can befr-par-1
for Instances located in Paris, for example. Replace{server_id}
with the ID of your Instance.Request:
curl -X POST -H "X-Auth-Token: $SCW_SECRET_KEY" -H "Content-Type: application/json" -d '{"action" : "poweroff"}' "https://api.scaleway.com/instance/v1/zones/{zone}/servers/{server_id}/action"Output:
{"task":{"id":"cd1cf3da-6dee-4c96-bc86-f4fe848f36d4","description":"server_poweroff","status":"pending","href_from":"/servers/85bde2188-1657-11ee-be56-0242ac120002/action","href_result":"/servers/85bde2188-1657-11ee-be56-0242ac120002","started_at":"2023-06-29T08:20:36.927830+00:00","terminated_at":null}} -
Update the
commercial_type
of your Instance.Request:
curl -X PATCH -H "X-Auth-Token: $SCW_SECRET_KEY" -H "Content-Type: application/json" -d '{"commercial_type" : "<NEW_INSTANCE_TYPE>"}' "https://api.scaleway.com/instance/v1/zones/{zone}/servers/{server_id}"ImportantLocal Storage constraints must be respected. For example, downgrading a DEV1-L Instance with 80 GB of local SSD storage to a DEV1-S Instance is not possible because the DEV1-S offer only supports a maximum of 20 GB. However, if the DEV1-L Instance is only using Block Storage (
b_ssd
) without relying on local SSD storage, the downgrade can be performed without any issues.Output:
{"server":{"id":"85bde2188-1657-11ee-be56-0242ac120002","name":"scw-agitated-banach","arch":"x86_64","commercial_type":"PLAY2-MICRO", # New commercial type of the Instance"boot_type":"local","organization":"a6a05c73-fa53-46a4-9ea1-e53b4f625527","project":"a6a05c73-fa53-46a4-9ea1-e53b4f625527","hostname":"scw-agitated-banach","image":{"id":"ce453858-557c-4f1c-a7a9-70026e67d054","name":"Ubuntu 22.04 Jammy Jellyfish","organization":"4ce7eb1c-1659-11ee-be56-0242ac120002","project":"4ce7eb1c-1659-11ee-be56-0242ac120002","root_volume":{"id":"30e9c843-1cdb-4bd4-96f7-cac26051eeaf","name":"Ubuntu 22.04 Jammy Jellyfish","volume_type":"b_ssd","size":10000000000},[...] -
Power on the Instance.
Request:
curl -X POST -H "X-Auth-Token: $SCW_SECRET_KEY" -H "Content-Type: application/json" -d '{"action" : "poweron"}' "https://api.scaleway.com/instance/v1/{zone}/servers/{server_id}/action"Output:
{"task":{"id":"aca94c37-86b0-4c9a-8df0-3bc13cd568ac","description":"server_batch_poweron","status":"pending","href_from":"/servers/85bde2188-1657-11ee-be56-0242ac120002/action","href_result":"/servers/85bde2188-1657-11ee-be56-0242ac120002","started_at":"2023-06-29T08:27:49.409220+00:00","terminated_at":null}}For more information on using the API, refer to the complete API documentation.