Introducing Elastigroup’s Root Volume Persistence

Root Volume Persistence maintains the data stored in your root volume, such as OS and configuration data, during Spot instance replacements. This way you can start the application exactly where you left off. By default, the root device volume is deleted when the instance terminates. To change the default behavior, enable the Root Volume Persistence feature.

How Root Volume Persistence Works

Periodic snapshots of the root volume are taken continuously while the instance is running. When a Spot interruption occurs, a “final” snapshot is taken only after the original instance is terminated and the root volume changes to an “available” state. Once the original instance is terminated, an image is registered using the final snapshot and the new instance is launched from this image.

Enabling Root Volume Persistence

Enter the Elastigroup Creation Wizard. Under the Compute tab open Stateful and select Persist Root Volume.

Changing the Image of Existing Stateful Instances
 Note: Changing the image in an Elastigroup only affects Stateful instances with root persistence that were created after the change.To change the image of an existing Stateful instance use the steps below.

Changing the image of existing Stateful instances:

  • Remove the root persistence and update the Elastigroup with the new image.
  • Recycle the Stateful instance.
  • Re-enable the root persistence in the Elastigroup configuration.
Backend actions

Elastigroup automatically performs various backend actions for different states of the Stateful instance to ensure root volume persistency.

  • Paused: Images (AMI) are created each time the Stateful instance is Paused using the latest root volume snapshot which was taken after the instance termination. Elastigroup only keeps the latest Snapshot for each volume.
  • Running: While the instance is running, a Snapshot is taken for the root volume every 5 minutes and the latest 3 Snapshots are kept (incremental backup).
  • Deallocated: The data (Images, Volumes and Snapshots) are kept for 4 days by default. Note: Data storage can be configured on an hourly basis.
Persist Root on Windows Platform

When using the persist root volume with Windows images, images created from snapshots as part of the stateful process, will have a Platform: Other Linux (default behavior of AWS). This behavior can cause issues while trying to connect to the instance.

The following user data script can be added to the group configuration to create a new user and password as the machine boots up, which will later be used to connect to the instance:

$Username = "SpotinstAdmin"
$Password = "Spot@dmin1"
$group = "Administrators"
$adsi = [ADSI]"WinNT://$env:COMPUTERNAME"
$existing = $adsi.Children | where {$_.SchemaClassName -eq 'user' -and $_.Name -eq $Username }
if ($existing -eq $null) {
 NET USER $Username $Password /add /y /expires:never
 NET LOCALGROUP $group $Username /add
else {a
WMIC USERACCOUNT WHERE "Name='$Username'" SET PasswordExpires=FALSE

Caution: For the updated user data to take effect the instance must be Recycled.