Skip to content

Spot Market

The Equinix Metalâ„¢ Spot Market allows users to bid on spare server capacity at reduced rates. In exchange, you give Equinix Metal the right to revoke any instance with only a two minute warning. If you have portable workload, the Spot Market is an excellent tool to help you reduce your costs.

How Does the Spot Market Work?

The spot market is a marketplace with constantly changing inventory. You can place bids on this inventory by defining a variety of factors such as the maximum price you are willing to pay for a particular resource, number and type of servers, whether you want all or some of the order filled at any given time, etc.

For example, you can provision five instances with the maximum price you want to pay per hour per instance. If your price is equal to or greater than the current spot price for the given facility and plan, then the instances will be created for you.

These instances are volatile, which means that they can be revoked by Equinix Metal at any time if another user bids with a higher price. If your instance is going to be revoked, it will receive a termination time that is at least two minutes in length. If you still need your instance, you can use the API to convert a revoked instance to list pricing within the two minute termination time.

Spot Market Request Creation - Console

To make a spot market request, click + New Server from the Servers page. Then select Spot Market from the deployment options.

Choose the location and type of server you would like to request from the drop-down menus. The page updates with the Current Market Price and On Demand Price for the location and server you select.

You can then fill in your requirements for Max. Bid/hr, Amount of Servers, and whether you want the request to happen once, stay open until a specific date/time, or to persist the request until you delete it. You can also choose to partially fill requests with some number of servers, or only fill the request if all of the servers are available.

Give your server(s) Hostnames, and select which Operating Systems should be installed. If you need to, click Configure under Options to configure the additional settings on your server(s) at provision time.

Click Deploy Now to place your request.

Current Spot Market requests are then listed in Project Settings on the Spot Market tab.

Spot Market Request Creation - API

To create a spot market request through the Equinix Metal API, send a POST request to the projects/{id}/spot-market-requests endpoint. In the body of the request, define the details of your request.

curl -X POST \
-H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN>" \
"https://api.equinix.com/metal/v1/projects/{id}/spot-market-requests" \
-d '{
  "devices_max": 2,
  "devices_min": 1,
  "max_bid_price": 0.10,
  "instance_parameters": {
    "hostname": "test.server.com-api",
    "plan": "c1.small.x86",
    "operating_system": "centos_8",
    "facility": "ewr1"
  }
}'

The devices_max, devices_min, max_bid_price, and instance_parameters fields are all required. The instance parameters object needs to contain hostname, plan, operating_system, and facility. instance_parameters can also contain any of the other fields used to provision and configure servers through the API. A complete list of those fields is in the API reference for the /projects/{id}/devices endpoint.

If you would like your request to expire after a certain amount of time, be sure to add the end_at field with the date and UTC time of expiration in ISO8601 format.

curl -X POST \
-H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN>" \
"https://api.equinix.com/metal/v1/projects/{id}/spot-market-requests" \
-d '{
  "devices_max": 2,
  "devices_min": 1,
  "max_bid_price": 0.10,
  "end_at": "2020-09-24T05:00:00Z",
  "instance_parameters": {
    "hostname": "test.server.com-api",
    "plan": "c3.small.x86",
    "operating_system": "centos_8",
    "facility": "ewr1"
  }
}'

Deleting a Spot Market Request

If you want you want to delete a spot market request, go to the list of requests in Project Settings on the Spot Market tab. Click MANAGE next to the request you want to delete. If you want to also delete any servers that were provisioned by the request, check the box next to Force termination.

Or, to delete a request in the API, send a DELETE to the /spot-market-requests/{id} endpoint.

curl -X DELETE -H 'X-Auth-Token: <API_TOKEN>' https://api.equinix.com/metal/v1//spot-market-requests/{id}

If you want to also delete the provisioned servers, send force_termination=true as a query parameter.

curl -X DELETE -H 'X-Auth-Token: <API_TOKEN>' https://api.equinix.com/metal/v1/spot-market-requests/{id}?force_termination=true

Spot Market Termination

Termination of spot market servers occurs when your max bid price is below the current spot price max or if demand for servers has increased and your device has the lowest price of all the spot market instances. A server that is marked for termination has 120 seconds before it is removed.

A server that will be terminated has will have a blue indicator next to the server name on your Servers page, but ascertaining when an instance will be terminated is not visible through our customer portal. Termination time is available in the API or from the server's metadata.

To determine a server's termination time send a GET request to the [/devices/{id}](https://metal.equinix.com/developers/api/devices/#devices-findDeviceById) endpoint.

curl -X GET -H 'X-Auth-Token: <API_TOKEN>' https://api.equinix.com/metal/v1/devices/{id}

The field termination_time contains the the UTC time in ISO8601 format when the instance will be terminated. If the response is null, it indicates that no termination time has been set.

You can also grab a list of all devices in a project and their info from the /projects/{id}/devices endpoint.

To query the server itself for termination time, you can cURL it's metadata. From the server itself, run:

curl -s https://metadata.packet.net/metadata

The response will contain a termination date/time or it will be null.

Converting a Spot Market server to On Demand

If your server is marked for termination and you still need to keep it, you can use the API to convert it to on demand. The server will be billed at the on demand price for the rest of its existence.

To convert, send a PUT request to the /devices/{id} endpoint with the body of the request containing the facility where the server lives and "spot_instance": false.

curl -X PUT \
-H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN>" \
"https://api.packet.net/devices/{id}" \
-d '{
  "facility": "ewr1",
  "spot_instance": false
}'

Current and Historical Market Pricing

The current market price reflects the price you need to specify to deploy a single instance at this point in time. If the listed spot market price is 10x the standard price for a server of that type, then we are out of capacity for spot market instances in that location.

The current market price, the on demand price and the price trends from the last 24 hours are displayed on the page if you are placing spot market requests in the Equinix Metal console.

In the API, the /market/spot/prices endpoint will provide the current prices for each Equinix Metal facility and plan.

curl -X GET -H 'X-Auth-Token: <API_TOKEN>' https://api.equinix.com/metal/v1/market/spot/prices

To see price history for a specific location and server, the /market/spot/prices/history?plan&facility endpoint will allow you to check spot market prices for the last 90 days.

curl -X GET -H 'X-Auth-Token: <API_TOKEN>' https://api.equinix.com/metal/v1/market/spot/prices/history?plan&facility

Bidding Strategies

While your specific bidding strategy is obviously entirely up to you, most users adopt one of these bidding strategies based on their use case.

Strictly Optimize Cost - Sacrifice availability for the deepest discount. This is great for long-running workloads that have flexible end dates.

  • Use Case: Research-style tasks
  • Suggested Bid: near minimum

Cost/Availability Balance - Slightly higher price than strictly cost optimized, but allows you to increase the likelihood of getting and keeping an instance for longer periods of time.

  • Use Case: Batch jobs that can handle some amount of reclamation
  • Suggested Bid: 10-20% above minimum

Bid On Demand Price - Receive a discount anytime the spot price is lower than on demand, immediately switching to onmdemand when it goes higher.

  • Use Case: Fully cloud native applications capable of easily moving workloads around
  • Suggested Bid: on demand price

Optimize Continuity - Bid very high to ensure availability and continuity.

  • Use Case: Accept some periods of higher-than-market prices in return for uptime continuity
  • Suggested Bid: 2x-3x on-demand price