Spot instances on CloudFerro Cloud
Spot instances let you run jobs on spare cloud capacity at a lower price than regular instances. CloudFerro can terminate them when that capacity is needed, so use them for work that can save progress and resume or be repeated.
What We Are Going To Cover
When to use spot instances
Understanding spot flavor names
How to choose a spot flavor in your cloud
How to create spot instances
Additional configuration via tags
What is the expected behaviour
When to use spot instances
Use spot instances for work that can stop and resume on another VM. Typical examples include:
Processing independent files or images in batches.
Running automated builds and tests that can be repeated.
Adding temporary workers to a queue while keeping the queue and job records on regular instances.
For example, a worker can process one file, save its result to object storage and record that the file is complete. If the worker is deleted, a replacement can continue with unfinished files. Save results and checkpoints outside the spot VM while the job runs; do not wait for a termination notification.
Use regular instances for a primary database, the only copy of important data, or a service that must remain available. A long-running job also needs a way to save and restore progress before it is suitable for spot instances. Compare the price of the selected spot flavor with a suitable regular flavor, allowing for work that may need to be repeated after an interruption.
Understanding spot flavor names
A name such as spot.eo2a.medium combines the spot prefix, a hardware family and a size label. The parts used in the spot flavors listed below mean:
Part of the name |
What it means |
|---|---|
spot. |
An interruptible VM using spare cloud capacity. It can be terminated when that capacity is needed for regular instances. |
eo2 in eo2 and eo2a |
The general-purpose CPU family, suitable for restartable scripts, batch processing and worker jobs. |
hm in hma |
The high-memory family, intended for jobs that need more RAM per vCPU. For spot instances, the job must still tolerate interruption. |
a in eo2a and hma |
The AMD processor variant: eo2a is the general-purpose AMD family, and hma is the high-memory AMD family. |
medium, large, xlarge, 2xlarge, etc. |
A size label within the selected family. It does not specify a fixed amount of RAM or a fixed vCPU count across families and clouds. For example, 2xlarge does not mean two vCPUs. |
For example, spot.eo2a.medium selects an interruptible VM from the general-purpose AMD family, while spot.hma.medium selects one from the high-memory AMD family. Compare the actual resource values in the cloud tabs below before choosing between them.
RAM and disk sizes below are shown in GiB. RAM values from openstack flavor list are converted from MiB to GiB by dividing by 1024 and rounded to two decimal places where needed. Disk values are already in GiB.
Flavor |
vCPUs |
RAM (GiB) |
Disk (GiB) |
|---|---|---|---|
spot.eo2.medium |
1 |
4 |
16 |
spot.eo2.large |
2 |
8 |
32 |
spot.eo2.xlarge |
4 |
16 |
64 |
spot.eo2.2xlarge |
8 |
32 |
128 |
spot.eo2.3xlarge |
16 |
64 |
256 |
spot.eo2.4xlarge |
32 |
128 |
512 |
Flavor |
vCPUs |
RAM (GiB) |
Disk (GiB) |
|---|---|---|---|
spot.hma.small |
1 |
3.73 |
16 |
spot.hma.medium |
2 |
14.9 |
32 |
spot.hma.large |
4 |
29.8 |
64 |
spot.hma.xlarge |
8 |
59.61 |
128 |
spot.hma.2xlarge |
16 |
119.22 |
256 |
spot.hma.3xlarge |
32 |
238.44 |
384 |
spot.hma.4xlarge |
64 |
450.76 |
384 |
Flavor |
vCPUs |
RAM (GiB) |
Disk (GiB) |
|---|---|---|---|
spot.eo2a.medium |
1 |
4 |
16 |
spot.eo2a.large |
2 |
8 |
32 |
spot.eo2a.xlarge |
4 |
16 |
64 |
spot.eo2a.2xlarge |
8 |
32 |
128 |
spot.eo2a.3xlarge |
16 |
64 |
256 |
spot.eo2a.4xlarge |
32 |
128 |
512 |
spot.eo2a.5xlarge |
64 |
236 |
1024 |
Flavor |
vCPUs |
RAM (GiB) |
Disk (GiB) |
|---|---|---|---|
spot.eo2a.medium |
1 |
4 |
16 |
spot.eo2a.large |
2 |
8 |
32 |
spot.eo2a.xlarge |
4 |
16 |
64 |
spot.eo2a.2xlarge |
8 |
32 |
128 |
spot.eo2a.3xlarge |
16 |
64 |
256 |
spot.eo2a.4xlarge |
32 |
128 |
512 |
spot.eo2a.5xlarge |
64 |
236 |
1024 |
Flavor |
vCPUs |
RAM (GiB) |
Disk (GiB) |
|---|---|---|---|
spot.eo2a.medium |
1 |
4 |
16 |
spot.eo2a.large |
2 |
8 |
32 |
spot.eo2a.xlarge |
4 |
16 |
64 |
spot.eo2a.2xlarge |
8 |
32 |
128 |
spot.eo2a.3xlarge |
16 |
64 |
256 |
spot.eo2a.4xlarge |
32 |
128 |
512 |
spot.eo2a.5xlarge |
64 |
236 |
512 |
spot.eo2a.6xlarge |
128 |
512 |
1536 |
Flavor |
vCPUs |
RAM (GiB) |
Disk (GiB) |
|---|---|---|---|
spot.eo2a.medium |
1 |
4 |
16 |
spot.eo2a.large |
2 |
8 |
32 |
spot.eo2a.xlarge |
4 |
16 |
64 |
spot.eo2a.2xlarge |
8 |
32 |
128 |
spot.eo2a.3xlarge |
16 |
64 |
256 |
spot.eo2a.4xlarge |
32 |
128 |
512 |
spot.eo2a.5xlarge |
64 |
236 |
1024 |
Prerequisites
No. 1 Account
You need a CloudFerro Cloud hosting account with access to the Horizon interface: https://horizon.cloudferro.com/auth/login/?next=/
No. 2 Select a cloud and project
Spot flavors are listed in all six clouds. In Horizon, select the project and cloud where you want to create the VM.
The screenshots below use WAW3-2 as an example. Select your chosen cloud in the same control:
A flavor appearing in the list does not guarantee that there is spare capacity to create a spot VM at that moment.
No. 3 Using quotas and flavors
For quotas, see this article: Dashboard Overview – Project Quotas And Flavors Limits on CloudFerro Cloud
No. 4 OpenStack CLI client (optional)
If you want to interact with CloudFerro Cloud cloud using OpenStack CLI client, you need to have it installed. Check one of these articles:
How to install OpenStackClient for Linux on CloudFerro Cloud
How to install OpenStackClient GitBash for Windows on CloudFerro Cloud
Once you have installed this piece of software, you need to authenticate to start using it: How to activate OpenStack CLI access to CloudFerro Cloud cloud using one- or two-factor authentication
To test whether the openstack command is working, list flavors:
openstack flavor list
In the output, look for names beginning with spot..
No. 5 VM creation procedure
Use the guide for your preferred method to prepare the image, network, key pair and other VM settings:
How to create spot instances
Step 1. Check the flavor
Choose a flavor whose name begins with spot. in Horizon or OpenStack CLI.
Warning
Similar or identical flavor names can have different specifications in different clouds. A spot flavor can also differ from a similarly named regular flavor. Before creating the VM, verify its exact vCPU count, RAM and disk size in the selected cloud and project, using Horizon or openstack flavor show.
For CLI users, run this command in the terminal authenticated to the selected cloud and project:
openstack flavor show SPOT_FLAVOR_NAME
Replace SPOT_FLAVOR_NAME with a complete name from that cloud’s flavor list. For example, use spot.eo2.medium on WAW3-1, spot.hma.medium on WAW3-2, or spot.eo2a.medium on WAW4-1, FRA1-2, FRA1-3 and LCJ1-1. Check the displayed resource sizes. The properties field should contain cf:spot.instance set to True.
The following screenshot shows that property for a WAW3-2 flavor:
Step 2. Create the instance
Follow the VM creation procedure from Prerequisite No. 5. In Horizon, choose the spot. flavor you checked in Step 1. The example below uses WAW3-2:
If you use OpenStack CLI, set –flavor to the same checked flavor name in your openstack server create command.
After creation, check that the instance has the flavor you selected:
The expected behaviour of spot instances
Currently, spot instances use the same project quota as on-demand instances and, under normal circumstances, behave identically to their non-ephemeral counterparts. When resources in the cloud become tight, the behaviour changes as well – scheduling an on-demand instance might still be possible but scheduling a spot instance may become unavailable. This is to make sure that on-demand user’s experience is prioritized.
You can temporarily shelve spot instances. While they are shelved, you pay for the persistent storage they retain.
How to convert spot instance to on-demand instance
To continue on a regular instance, choose a compatible non-spot flavor and request a resize. This requires sufficient quota and capacity in the cloud. After conversion, the regular flavor’s price applies. Keep saving progress outside the VM; do not depend on completing a resize during a termination notice.
You can resize instance through Horizon:
With CLI, you can use a command like this:
openstack server resize --flavor FLAVOR_NAME INSTANCE_NAME
Replace INSTANCE_NAME with your VM name or ID and FLAVOR_NAME with the selected regular flavor. Check the resize status:
openstack server show INSTANCE_NAME
When the status is VERIFY_RESIZE, check that the VM and application work, then confirm the resize:
openstack server resize confirm INSTANCE_NAME
If the resized VM does not work as expected, revert instead of confirming:
openstack server resize revert INSTANCE_NAME
What to do next
Prepare storage for the worker’s results using How to use Object Storage on CloudFerro Cloud. For the full Horizon resize procedure, follow Resizing a virtual machine using OpenStack Horizon on CloudFerro Cloud.
For service behaviour and billing information, see Spot Virtual Machines.