Stateful property of ComputeGroups can be enabled if you are running stateful workloads on ComputeGroups. For a stateful ComputeGroup, Lightwing will periodically take snapshots of the root volume of the instance. When instances are recovered from spot interruption, they will be launched on the last known snapshot.
This enables users to run stateful workloads on Spot instances without worrying about data loss.
Create a stateful ComputeGroup
To create a stateful ComputeGroup, check the Stateful checkbox in the Configuration and storage section.
Note: A stateful ComputeGroup can’t be changed to a stateless one. You will have to create a new ComputeGroup to make it stateless
When one of the instances in the group gets interrupted, ComputeGroups takes the following steps.
- Deregister the instance from the cluster it belongs
- Take one final snapshot
- Instance will be taken down
- A replacement spot instance is obtained and uses the last known snapshot
- Instance starts and joins back the cluster
Stateful ComputeGroups are good for running a variety of clusters. Few examples includes:
- Elastic search cluster
- Jenkins slave machines