Create and manage Elastic Metal servers with the Scaleway CLI
Scaleway's Elastic Metal servers provide you with dedicated servers on-demand, with all the benefits of the cloud, including flexibility and hourly billing. These servers are great for large workloads, big data, and applications that require increased security and dedicated resources. You can create and manage your Elastic Metal servers from the Scaleway console, via the API or the Scaleway Command Line Interface (CLI).
In this tutorial, you will learn how to use the CLI to create an Elastic Metal server, install an OS, and manage the server lifecycle.
Scaleway Command Line Interface overview
The Scaleway Command Line Interface (CLI) allows you to pilot your Scaleway infrastructure directly from your terminal, providing a faster way to administer and monitor your resources. Scaleway CLI is easy to set up and use, and an essential tool for operating efficiently in your cloud environment. The CLI provides many functionalities, including the ability to create and administer Elastic Metal servers.
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 SSH key
- A valid API key
- Installed and configured the Scaleway CLI
Creating an Elastic Metal server
-
Type the following command in your terminal to create your Elastic Metal server:
scw baremetal server create name=name-of-your-server type=EM-A210R-SATA zone=fr-par-2
An output similar to the following displays:
ID 12345678-1234-1234-1234-123456789123 OrganizationID 12345678-1234-1234-1234-123456789123 ProjectID 12345678-1234-1234-1234-123456789123 Name name-of-your-server Description - UpdatedAt 36 seconds ago CreatedAt 36 seconds ago Status delivering OfferID 12345678-1234-1234-1234-123456789123 Domain - BootType normal Zone fr-par-2 PingStatus unknown
-
Write down the ID of your server, as you will need it in the next steps.
Installing an OS
-
Type the following command in your terminal to see a list of available OSes:
scw baremetal os list zone=fr-par-2
An output with available OSes and their associated IDs displays:
ID NAME 82ed3c56-935c-4012-b01f-69070fce1b1d Ubuntu 0aa99516-52bb-4a7d-b9fe-1adc8478c2e0 Debian 58bf948f-8b9b-45c2-9ad6-582c26133f9e Rocky Linux e8fc12e5-cfcd-434a-a8b0-d5f5141baf91 Ubuntu 03b7f4ba-a6a1-4305-984e-b54fafbf1681 Ubuntu 86fd5e3a-b023-4fa8-a3ae-1a194d8cd68c CentOS f2aeab5d-6015-4b7c-b4ed-d76e89093621 Debian 01d6eef6-6b96-47fd-b9f9-3857321abe4f Ubuntu
-
Write down the ID of the OS you want to install.
-
Type the following command to display the list of your SSH key's ID:
scw iam ssh-key list
You will see an output similar to the following:
ID NAME CREATED AT UPDATED AT your-ssh-key-ID name-of-your-ssh-key 1 week ago 1 week ago
-
Write down your SSH key ID, as you will need it in the next steps.
-
Type the following command to install an OS on your Elastic Metal server:
scw baremetal server install ID-of-your-elastic-metal-server os-id=ID-of-OS-you-want-to-install hostname=hostname-for-your-server ssh-key-ids.0=your-ssh-key-ID zone=fr-par-2
An output similar to the following displays:
ID ID-of-your-Elastic-Metal-Server OrganizationID ID-of-your-organization ProjectID ID-of-your-project Name name-of-your-server Description - UpdatedAt 8 minutes ago CreatedAt 11 minutes ago Status ready OfferID ID-of-the-offer IPs.0.ID 12345678-1234-1234-1234-123456789123 IPs.0.Address 12.345.67.89 IPs.0.Reverse - IPs.0.Version IPv4 IPs.0.ReverseStatus unknown IPs.0.ReverseStatusMessage - IPs.1.ID 12345678-1234-1234-1234-123456789123 IPs.1.Address 1234:123:4567:8:9123:4567:8912:345 IPs.1.Reverse 12345678-1234-1234-1234-123456789123.fr-par-2.baremetal.scw.cloud IPs.1.Version IPv6 IPs.1.ReverseStatus active IPs.1.ReverseStatusMessage - Domain 12345678-1234-1234-1234-123456789123.fr-par-2.baremetal.scw.cloud BootType normal Zone fr-par-2 Install.OsID ID-of-your-OS Install.Hostname hostname-for-your-server Install.SSHKeyIDs.0 your-ssh-key-ID Install.Status to_install PingStatus up
Using other CLI commands
There are many other functionalities you can access for your Elastic Metal server via the Scaleway CLI. In the following examples, replace your-elastic-metal-server-ID
with your server's ID.
Powering on your server
Type the following command in your terminal:
scw baremetal server start your-elastic-metal-server-ID zone=fr-par-2
The following output displays, and you will see "starting" next to the Status
field:
ID 12345678-1234-1234-1234-123456789123
OrganizationID 12345678-1234-1234-1234-123456789123
ProjectID 12345678-1234-1234-1234-123456789123
Name name-of-your-server
Description -
UpdatedAt 3 seconds from now
CreatedAt 3 hours ago
Status starting
OfferID 12345678-1234-1234-1234-123456789123
IPs.0.ID 12345678-1234-1234-1234-123456789123
IPs.0.Address 12.345.67.89
IPs.0.Reverse -
IPs.0.Version IPv4
IPs.0.ReverseStatus unknown
IPs.0.ReverseStatusMessage -
IPs.1.ID 12345678-1234-1234-1234-123456789123
IPs.1.Address IPs.1.Address
IPs.1.Reverse IPs.1.Reverse
IPs.1.Version IPv6
IPs.1.ReverseStatus pending
IPs.1.ReverseStatusMessage -
IPs.2.ID IPs.2.ID
IPs.2.Address 51.159.17.32
IPs.2.Reverse IPs.2.Reverse
IPs.2.Version IPv4
IPs.2.ReverseStatus active
IPs.2.ReverseStatusMessage -
Domain your-domain-name
BootType normal
Zone fr-par-2
Install.OsID 12345678-1234-1234-1234-123456789123
Install.Hostname hostname-for-your-server
Install.SSHKeyIDs.0 12345678-1234-1234-1234-123456789123
Install.Status completed
PingStatus up
Powering off your server
Type the following command in your terminal:
scw baremetal server stop your-elastic-metal-server-ID zone=fr-par-2
The following output displays, and you will see "stopping" next to the Status
field:
ID 12345678-1234-1234-1234-123456789123
OrganizationID 12345678-1234-1234-1234-123456789123
ProjectID 12345678-1234-1234-1234-123456789123
Name name-of-your-server
Description -
UpdatedAt 3 seconds from now
CreatedAt 3 hours ago
Status stopping
OfferID 12345678-1234-1234-1234-123456789123
IPs.0.ID 12345678-1234-1234-1234-123456789123
IPs.0.Address 12.345.67.89
IPs.0.Reverse -
IPs.0.Version IPv4
IPs.0.ReverseStatus unknown
IPs.0.ReverseStatusMessage -
IPs.1.ID 12345678-1234-1234-1234-123456789123
IPs.1.Address IPs.1.Address
IPs.1.Reverse IPs.1.Reverse
IPs.1.Version IPv6
IPs.1.ReverseStatus pending
IPs.1.ReverseStatusMessage -
IPs.2.ID IPs.2.ID
IPs.2.Address 51.159.17.32
IPs.2.Reverse IPs.2.Reverse
IPs.2.Version IPv4
IPs.2.ReverseStatus active
IPs.2.ReverseStatusMessage -
Domain your-domain-name
BootType normal
Zone fr-par-2
Install.OsID 12345678-1234-1234-1234-123456789123
Install.Hostname hostname-for-your-server
Install.SSHKeyIDs.0 12345678-1234-1234-1234-123456789123
Install.Status completed
PingStatus up
Rebooting your Server
Type the following command:
scw baremetal server reboot your-elastic-metal-server-ID zone=fr-par-2
The following output displays, and you will see "down" next to the PingStatus
field:
ID 12345678-1234-1234-1234-123456789123
OrganizationID 12345678-1234-1234-1234-123456789123
ProjectID 12345678-1234-1234-1234-123456789123
Name name-of-your-server
Description -
UpdatedAt 3 seconds from now
CreatedAt 3 hours ago
Status stopping
OfferID 12345678-1234-1234-1234-123456789123
IPs.0.ID 12345678-1234-1234-1234-123456789123
IPs.0.Address 12.345.67.89
IPs.0.Reverse -
IPs.0.Version IPv4
IPs.0.ReverseStatus unknown
IPs.0.ReverseStatusMessage -
IPs.1.ID 12345678-1234-1234-1234-123456789123
IPs.1.Address IPs.1.Address
IPs.1.Reverse IPs.1.Reverse
IPs.1.Version IPv6
IPs.1.ReverseStatus pending
IPs.1.ReverseStatusMessage -
IPs.2.ID IPs.2.ID
IPs.2.Address 51.159.17.32
IPs.2.Reverse IPs.2.Reverse
IPs.2.Version IPv4
IPs.2.ReverseStatus active
IPs.2.ReverseStatusMessage -
Domain your-domain-name
BootType normal
Zone fr-par-2
Install.OsID 12345678-1234-1234-1234-123456789123
Install.Hostname hostname-for-your-server
Install.SSHKeyIDs.0 12345678-1234-1234-1234-123456789123
Install.Status completed
PingStatus down
Deleting your server
Type the following command in your terminal:
scw baremetal server delete your-elastic-metal-server-ID zone=fr-par-2
An output like the following displays, and you will see "deleting" next to the Status
field:
ID your-elastic-metal-server-ID
OrganizationID your-organization-ID
ProjectID your-project-ID
Name name-of-your-server
Description -
UpdatedAt now
CreatedAt 4 hours ago
Status deleting
OfferID your-offer-ID
Tags.0 -
IPs.1.ID 12345678-1234-1234-1234-123456789123
IPs.1.Address 1234:123:4567:8:9123:4567:8912:345
IPs.1.Reverse 12345678-1234-1234-1234-123456789123.fr-par-2.baremetal.scw.cloud
IPs.1.Version IPv6
IPs.1.ReverseStatus active
IPs.1.ReverseStatusMessage -
Domain 12345678-1234-1234-1234-123456789123.fr-par-2.baremetal.scw.cloud
BootType normal
Zone fr-par-2
Install.OsID ID-of-your-OS
Install.Hostname hostname-for-your-server
Install.SSHKeyIDs.0 your-ssh-key-ID
Install.Status completed
PingStatus down
Enter the following command to make sure that your server has been deleted:
scw baremetal server list zone=fr-par-2
An output similar to the following displays:
12345678-1234-1234-1234-123456789123 name-of-your-server EM-A210R-SATA stopped