How to Activate the Protect Server Feature

Protect Server Overview

The Protect Server feature is used to protect your server in a way that it prevents any halt action to be performed on your server. The Protect Server feature only applies to running servers.

For instance, if you server has the protect server option enabled, you will not be able to delete, power off, reboot or use the standby option. A pop up displays server is protected.

This option can become handy to avoid hazardous manipulations (e.g., batch deletion of servers).


Activating the Protect Server Feature via the Console

1 . On you Server Dashboard, select the running server you want to protect

2 . Once the server details are displayed click on the Advanced Settings tab to list advanced settings.

3 . In the Protect Server section, check the box and confirm to enable the feature.


The protected server is easily identifiable as a lock icon appears next to it.


Activating the Protect Server Feature via the API

1 . Generate API Key from your Scaleway console, if you do not have one yet.

2 . Define a SCW_TOKEN variable from your token id

export SCW_TOKEN='token_uuid'

3 . Retrieve your organization ID through the API. Replace the $ACCESS_KEY and $SECRET_KEY values respectively with your generated access key and secret key.

% curl$ACCESS_KEY -H "X-Auth-Token: $SECRET_KEY"

  "token": {
->  "organization_id": "000a115d-2852-4b0a-9ce8-47f1134ba95a",

In the above example, the organization ID is 000a115d-2852-4b0a-9ce8-47f1134ba95a.

4 . Define a variable $SCW_ORG for your organization id

export SCW_ORG=‘organisation_uuid'

5 . Depending on your instance location, you can use the base URL or

6 . Define a variable for your server id

export SCW_SERVER=’server_id'

7 . To protect an existing server, launch

curl \
  -H "X-Auth-Token: $SECRET_KEY" \
  -H "Content-Type: application/json;charset=utf-8" \
  -d '{"protected": true}'

8 . To get a protected server status, launch

Get protected server status:
curl \
-H "X-Auth-Token: $SECRET_KEY" \
-H "Content-Type: application/json;charset=utf-8" \

jq .server.protected

9 . To unprotect an existing server, launch

curl \
-H "X-Auth-Token: $SECRET_KEY" \
-H "Content-Type: application/json;charset=utf-8" \
-d '{"protected": false}'

You can also create new START1-S protected server by default using:

curl \
  -XPOST \
  -H "X-Auth-Token: $SECRET_KEY" \
  -H 'Content-Type: application/json' \ \
  -d \

{\"organization\": \"$SCW_ORG\",       \"name\": \"test-server-post-protected\",       \"image\": \"89457135-d446-41ba-a8df-d53e5bb54710\",       \"commercial_type\": \"START1-S\",       \"tags\": [],       \"boot_type\": \"local\",       \"protected\": true     }

Discover the Cloud That Makes Sense