I'm trying to create an Amazon CloudWatch alarm in the Amazon Elastic Compute Cloud (Amazon EC2) console. I want to recover my EC2 instance if it becomes impaired due to an underlying hardware failure and send a notification when the alarm triggers. However, on the Create Alarm page, the option Recover this instance under Take the action: is grayed out (disabled). The alarm notification options (Topic name and recipients) are also disabled. How do I turn these options back on?

If CloudWatch determines that an EC2 instance uses instance store volumes, the Recover this instance option is disabled. The recover action is not supported for EC2 instances that use instance store volumes, including those launched with block device mappings for instance store volumes. CloudWatch reads the metadata associated with each EC2 instance to verify that it doesn’t use instance store volumes before enabling the recover action.

Note: The Recover action is only supported on certain instance types. Make sure that you launch a supported instance type. For more information, see Recover Your Instance for current details. The EC2 recover alarm action is also only valid for the metric StatusCheckFailed_System.

Before proceeding, see Create Alarms That Stop, Terminate, Reboot, or Recover an Instance. Be sure that you meet all the prerequisites for creating CloudWatch alarms.

Find ephemeral instance store volumes in EC2 Linux instances

1.     Connect to your Linux instance.

2.     Use the following command to retrieve metadata from your instance.

curl http://169.254.169.254/latest/meta-data/block-device-mapping/

3.     Use the output to identify instance store volumes (whose names begin with ephemeral) mapped to the instance. For example, there are two instance store volumes (ephemeral0 and ephemeral2) in this output:

[ec2-user ~]$ curl http://169.254.169.254/latest/meta-data/block-device-mapping/
ami
ephemeral0
ephemeral2
root

Find ephemeral instance store volumes in EC2 Windows instances

If you prefer to use a browser:

1.     Connect to your Windows instance.

2.     Open a browser and connect to:

http://169.254.169.254/latest/meta-data/block-device-mapping/

3.     Use the information returned to identify instance store volumes (whose names begin with ephemeral) mapped to the instance.

If you prefer to use Windows PowerShell:

1.     Connect to your Windows instance in PowerShell.

2.     Run the following command:

PS C:\> Invoke-RestMethod -uri http://169.254.169.254/latest/meta-data/block-device-mapping/

3.     Use the output to identify instance store volumes (whose names begin with ephemeral) mapped to the instance. For example, there is one instance store volume (ephemeral0) in this output:

ami
ephemeral0
root
swap

For more information, see Viewing the Instance Block Device Mapping for Instance Store Volumes.

Find ephemeral instance store volumes in AMIs for EC2 instances

You can also check the block device mappings for the Amazon Machine Image (AMI) for your EC2 instance for any block device instance store volumes (whose Block Devices field includes =ephemeral# where # is an integer from 0-23).

Note: When you use the AWS CLI, an SDK or a service such as AWS CloudFormation to launch an EC2 instance (Windows or Linux), block device mapping can occur even if the instance type doesn’t officially support instance store volumes. When you use the Amazon EC2 console to launch an instance type that doesn’t support instance store volumes, EC2 simply ignores modified block device mappings.

See Viewing the EBS Volumes in an AMI Block Device Mapping for how to enumerate the EBS volumes in an AMI’s block device mapping using the Amazon EC2 console or the AWS Command Line Interface (AWS CLI).

For example, the following AWS CLI command describe-images returns the BlockDeviceMapping for the AMI:

aws ec2 describe-images --image-ids ami-xxxxxxxx

Example output with instance store volumes whose VirtualName begins with ephemeral:

aws ec2 describe-images --image-ids ami-11112222

"BlockDeviceMappings": [
   {
      "DeviceName": "/dev/xvda",
      "Ebs": {
         "DeleteOnTermination": true,
         "SnapshotId": "snap-        ",
         "VolumeSize": 8,
         "VolumeType": "gp2",
         "Encrypted": false
      }
   },
   {
      "DeviceName": "/dev/sdb",
      "VirtualName": "ep0hemeral0"
   },
   {
      "DeviceName": "/dev/sdc",
      "VirtualName": "ephemeral2"
   }
],

Remove or override any references to instance store volumes in the AMI

After you’ve confirmed that your EC2 instance uses instance store volume(s), you must remove or override any references to instance store volumes in the AMI. Then, you must relaunch the instance because instance store volumes can’t be added or removed from an existing EC2 instance.

Use one of the following methods to remove or override references to instance store volumes:

  • Remove references to instance store volumes from the AMI. Then, relaunch the instance.
  • Launch the EC2 instance from the EC2 console to override the AMI for instance types that don’t support instance volume stores.
  • Launch the EC2 instance from the AWS CLI and manually override each device in the AMI that references an instance store volume. For example, if you have devices /dev/sdb and /dev/sdc that map to instance store volumes, launch your EC2 instance using the run-instances command:
aws ec2 run-instances --image-id ami-11112222 --subnet-id subnet-11112222 --instance-type t2.medium
 --key-name my_key --associate-public-ip-address --block-device-mappings 
 '[{"DeviceName": "/dev/sdb","NoDevice": ""},{"DeviceName": "/dev/sdc","NoDevice": ""}]'
  • For an EC2 instance launched by CloudFormation, create a CloudFormation template to override mapping of any devices to instance store volumes. For example:
{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Resources": {
   "I4EY8I": {
    "Type": "AWS::EC2::Instance",
    "Properties": {
     "ImageId" : "ami-11112222",
     "InstanceType" : "t2.medium",
     "SubnetId" : "subnet-11112222",
     "KeyName" : "my_key",
   "BlockDeviceMappings" : [
     {
       "DeviceName":"/dev/sdb",
       "NoDevice": {}
     },
     {
       "DeviceName":"/dev/sdc",
       "NoDevice": {}
     }
  ]
   }
  }
 }
}
  • For an EC2 instance launched by an SDK, check the relevant SDK documentation for how to override mapping devices to instance store volumes.

Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2016-02-30

Updated: 2018-12-12