Server Actions¶
To make managing your servers a little bit easier, Equinix Metal™ provides some basic commands and functionality through the console, CLI, and API.
Reboot¶
Sometimes you may have to reboot a server to install updates or after configuring the operating system. And if you need to; you can send the reboot command from the Equinix Metal console, CLI, or API.
Click the Actions drop down menu and click Reboot. When you confirm the server reboot, you should get a "Server Action Succeeded" message.
Reboot a server with the metal device reboot
command.
metal device reboot --id <device_uuid>
You can reboot a server with a POST
request to the /devices/{id}/actions
endpoint and specify the type of action as "reboot"
.
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN>" \
"https://api.equinix.com/metal/v1/devices/{id}/actions" \
-d '{
"type": "reboot"
}'
While rebooting the server will be unavailable, but should come back after a few minutes, or however long the reboot process takes. Reboot actions initiated from the console, CLI, and API are logged and listed on the server's Timeline tab.
Power Off and Power On¶
You can keep a server provisioned in your Project, but in a powered off state.
Note: Powering off a server does NOT stop its billing. You have to de-provision a server in order to stop it from accruing charges.
To Power Off a server, click the Actions drop down menu and click Power Off.
When you confirm that you would like to power off the server, you should get a "Server Action Succeeded" message and the server status is updated to Stopped.
To Power On a server, click the Actions menu and click Power On.
Once you have confirmed that that you would like to power on the server, you should get a "Server Action Succeeded" message and the server status will update first to Starting and then to Running.
To power off a server, use the metal device stop
command.
metal device stop --id <device_uuid>
To power on a server, use the metal device start
command.
metal device start --id <device_uuid>
You can power off a server with a POST
request to the /devices/{id}/actions
endpoint and specify the type of action as "power_off"
.
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN>" \
"https://api.equinix.com/metal/v1/devices/{id}/actions" \
-d '{
"type": "power_off"
}'
Similarly, you can power on a server with a POST
request to the /devices/{id}/actions
endpoint and specify the type of action as "power_on"
.
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN>" \
"https://api.equinix.com/metal/v1/devices/{id}/actions" \
-d '{
"type": "power_on"
}'
Power off and Power on actions initiated from the console, CLI, and API are logged and listed on the server's Timeline tab.
Lock Device and Unlock Device¶
You can lock a device to prevent destructive changes on a provisioned server. Locking a device prevents:
- Deleting or Deprovisioning the device.
- Initiating a Reinstall of the the device.
- Deleting or Deprovisioning of an instance with a
"termination time"
set, even if the termination time is reached. A Spot Market server's termination time cannot be overridden by locking the device.
Locking and Unlocking actions are logged and listed on the server's Timeline tab.
To lock or unlock a server, click the lock icon next to the server Actions drop down menu.
To lock or unlock a device, use the metal device update
command and use the --locked
flag.
To lock:
metal device update -i <device_id> --locked true
To unlock:
metal device update -i <device_id> --locked false
To lock or unlock a server, send a PUT
request to the /devices/{id}
endpoint with the state of the "locked"
field specified in the body of the request.
To lock:
curl -X PUT \
-H "Content-Type: application/json" \
-H "X-Auth-Token: $API_TOKEN" \
"https://api.equinix.com/metal/v1/devices/{id}" \
-d '{
"locked": true
}'
To unlock:
curl -X PUT \
-H "Content-Type: application/json" \
-H "X-Auth-Token: $API_TOKEN" \
"https://api.equinix.com/metal/v1/devices/{id}" \
-d '{
"locked": false
}'
Rescue, Reinstall, and OOB Console¶
The other items in the Server's Actions menu each have their own docs pages explaining their usage with examples in the Recovery section.