Lab 3 Stateful Spot Interruption

In this Lab we will be connecting to our stateful instance, creating a file and then immediately simulating a Spot interruption.

Follow the URL to download a pem key file: Key

Navigate to the stateful nodes category and click into your managed instance. Navigate to the overview tab and note your DNS name as shown below.

  1. Open an SSH client.
  2. Locate your key file that you just downloaded
  3. Run this command to ensure your key is not publically viewable:
chmod 400 elastigroup-workshop.pem

  1. SSH into your machine using the example below
ssh -i "elastigroup-workshop.pem" ec2-user@YOUR DNS NAME

Once you log into the machine, let’s create a quick file and verify it exists.

[ec2-user@ip-172-31-43-83 ~]$ touch statefultest.text
[ec2-user@ip-172-31-43-83 ~]$ ls
statefultest.text

Now we will proceed with simulating a spot interruption immediately after creating the text file and seeing if it persists after being interrupted. Let’s go back to the Spot console for our stateful node.

Take note of the Instance ID and the Private IP Address

Click Actions –> Recycle

This process will take about 10 minutes to demo. Feel free to grab a coffee or bathroom break.

End Results

Notice how the Instance ID has changed and the Private IP has remained the same

Now let’s verify our file was not lost. Note your public EC2 DNS name will have changed and you will need to reference that when connecting back to the machine:

SSH into your new machine using the example below

ssh -i "elastigroup-workshop.pem" ec2-user@YOUR DNS NAME

Once you log into the machine, let’s list the file to make sure it is stil there:

[ec2-user@ip-172-31-43-83 ~]$ ls
statefultest.text

That’s it! We are going to take a quick break now before moving onto our final lab (Intelligent traffic flow).