Determine if ephemeral storage is attached to an instance in the Amazon Web Services console?

Short question: How do you know if an app has ephemeral storage? Do I need to ssh and look at mounts using "lsblk" on Linux?

Since ephemeral storage is lost when the instance is stopped, you need to know if ephemeral disks are attached at all. The first thing to check is the "root device type" of the instance, if it's EBS then you don't need to worry about losing data (unless the EBS volume is set to "delete on terminate"). However, if it is a "storage instance", you will lose data on that disk when the instance starts. Then look at "root device" and "lock devices" and see if they are associated with EBS volumes. It's simple. Where it gets cloudy when you attach an ephemeral disk to an instance (at startup time), but the console doesn't present it as it does for an additional EBS volume. Alternatively, you may need to manually install the drive yourself ...how can you easily find out from the AWS console if an ephemeral disk is attached?

+3


source to share


3 answers


Not the answer you want to hear, but you cannot say it from the console. As you noted, there are two things that must happen in order to write data to an ephemeral disk.

1) Actually you need to install this dev. No way to communicate this from the console to any developer 2) You need this developer to be exposed to an instance via block mapping in the AMI.



It can be assumed that most (but not all) public AMIs will have all possible ephemeral disks mapped (although hi1.8xl has 24 of those disks) and so you just need to check if the instance type actually supports ephemeral disks as many do not do.

If you want to avoid using ephemeral disks, you should restrict deployment to the AMIs you created and remove any ephemeral disks from the block device mappings.

0


source


On any ec2 instance, you can call the http service to request the instance data, eg. to display linked device blocks:

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

      

to find out details about a specific device:



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

      

You will get a display of this device, for example: /dev/xvdb

+7


source


Look in /etc/cloud/cloud.cfg - the ephemer should be specified there, for example:

mounts:
 - [ ephemeral0, /media/ephemeral0, auto, "defaults" ]
 - [ swap, none, swap, sw, "0", "0" ]

      

Then in fstab you should see an entry like:

/dev/sda2   /media/ephemeral0   auto    defaults,comment=cloudconfig    0   2

      

+3


source







All Articles