April 18th, 2018

Persistent Spot Market Bid

The Packet spot market is a popular cost-saving tool as it allows you to bid on our spare server capacity at reduced rates - up to 80% off on-demand rates. Until now, only one-time bids could be placed which means instances provisioned can be terminated at anytime if the current market price exceeds the maximum bid price.

We have now released an additional bid option: persistent bid. This new option allows you to create single or batch spot instances automatically, whenever the market price drops below a certain threshold - without having to query the API and issue individual device creation requests.

Through the API (the client portal will follow soon) you can create a new spot market request that persists indefinitely or until the specified end date was reached.

With the below available parameters the request can be specified:

  • devices_min = 5
  • devices_max = 10
  • facilities = array of facility codes or ids
  • max_bid_price
  • end_at
  • instance_parameters:
    • plan (required)
    • operating system (required)
    • operating_system (required)
    • userdata (optional)
    • public_ipv4_subnet_size (optional)
    • ssh_keys (optional)
    • hostnames (optional)

The request will get placed automatically every 5 minutes. 

Just like in the one-time bid option we cannot assure any kind of duration for a spot instance before it gets deleted, however the devices_min parameter slightly changes how we handle termination. Here’s an example:

curl \
  -H "Content-Type: application/json" \
  -H "X-Auth-Token: <api-token>" \
  -d '{
  "devices_min": 5,
  "devices_max": 10,
  "max_bid_price": 0.02,
  "facility_ids": ["ewr1", "nrt1"],
  "instance_parameters": {
    "hostname": "test.smr.{{index}}",
    "plan": "baremetal_0",
    "operating_system": "ubuntu_16_04"
}' \

The API will always ensure that there are at least 5 devices running, and if we cannot fulfill at least 5, we will not create any instances. Similarly, if we need to reclaim instances such that there would be less than 5 instances, all 5 devices will be destroyed.

You can also specify end_at, when reached the request will no longer be processed and all associated instances will be destroyed. This parameter is optional and is useful if you want to control how long the instances live. If not included, the request will last indefinitely and instances will continue to be created and deleted automatically as the spot market price fluctuates.

More information about the Spot Market in general, API details, and bidding strategies are available in this doc. As always, feel free to reach out via email if you have any questions.