Volumes and Deletion Policies
By default, EBS volumes have names in the following format:
But you can specify a custom name using the
When you’re starting an instance:
- Spotty is looking for existing EBS volumes using their names. If a volume exists, it will be attached to the instance.
- If not - Spotty will be looking for a snapshot with the same name. If the snapshot exists, the volume will be restored from that snapshot.
- If neither snapshot nor volume with this name exists, new EBS volume will be created.
When you’re stopping the instance Spotty applies deletion policies for the volumes. There are 4 deletion policies that
can be specified using the
create_snapshot: this is the default deletion policy. Spotty will create a new snapshot every time you’re stopping an instance, the old snapshot will be renamed. AWS uses incremental snapshots, so each new snapshot keeps only the data that was changed since the last snapshot made (see: How Incremental Snapshots Work).
update_snapshot: a new snapshot will be created and the old one will be deleted.
retain: the volume will not be deleted and a snapshot will not be created.
delete: the volume will be deleted without creating a snapshot. All data on this volume will be lost.