I've been using the Amazon ECS AMI on m5 EC2 instances, and I noticed that there's a new m5d instance type which is similar but comes with a 70 GB local SSD. Since these are throwaway instances, faster semi-cheap SSD's seem perfect, but I can't figure out how to actually use this local storage.
I initially tried to replace the /dev/xvda or /dev/xvdcz device with ephemeral0 in the block device mapping:
BlockDeviceMappings: - DeviceName: /dev/xvdcz VirtualName: ephemeral0
.. but this doesn't seem to do anything (the logs on the box say something about ephemeral0 not existing), and I found in the documentation that:
[NVMe instance store volumes] These volumes are automatically enumerated and assigned a device name; including them in your block device mapping has no effect.
Since the ECS AMI uses an LVM partition, I could potentially create a small EBS volume for /dev/xvdcz and then add the local partition (which is visible in
lsblk) to the LVM store, but the fact that NVMe partitions have arbitrary names makes this hard to do in a safe way.
So this is the point I'm stuck at. How do you actually use the local storage if you can't use it in a block device mapping and the device names are semi-random? Does Amazon expect you to manually log in and edit the fstab every time you boot one of these instances? I feel like I must be missing something.
I realize there's probably special rules that prevent me from replacing the root device with an ephemeral device, but I can't figure out how I'm supposed to use this thing if it can't even replace the data volume.