Skip to content

cloud-init Unable to convert ephemeral0 to a device

0
  • Desired outcome: I'd like the ephemeral drive to be mounted at boot. Ideally before userdata execution begins.
  • Instance type: g4dn.xlarge
  • AMI: custom AMI made with ImageBuilder, based on ami-09f85944838b438c5 which is based on Amazon Linux 2

EC2 documentation says "All the NVMe instance store volumes supported by an instance type are automatically enumerated and assigned a device name on instance launch; including them in the block device mapping for the AMI or the instance has no effect. "

cloud-init.log...

Dec 17 15:35:02 cloud-init[4081]: cc_mounts.py[DEBUG]: mounts configuration is [['ephemeral0', '/media/ephemeral0'], ['swap', 'none', 'swap', 'sw', '0', '0']]
Dec 17 15:35:02 cloud-init[4081]: util.py[DEBUG]: Reading from /etc/fstab (quiet=False)
Dec 17 15:35:02 cloud-init[4081]: util.py[DEBUG]: Read 91 bytes from /etc/fstab
Dec 17 15:35:02 cloud-init[4081]: cc_mounts.py[DEBUG]: Attempting to determine the real name of ephemeral0
Dec 17 15:35:02 cloud-init[4081]: DataSourceEc2.py[DEBUG]: Unable to convert ephemeral0 to a device
Dec 17 15:35:02 cloud-init[4081]: cc_mounts.py[DEBUG]: changed ephemeral0 => None
Dec 17 15:35:02 cloud-init[4081]: cc_mounts.py[DEBUG]: Ignoring nonexistent named mount ephemeral0
Dec 17 15:35:02 cloud-init[4081]: cc_mounts.py[DEBUG]: Attempting to determine the real name of swap
Dec 17 15:35:02 cloud-init[4081]: DataSourceEc2.py[DEBUG]: Unable to convert swap to a device
Dec 17 15:35:02 cloud-init[4081]: cc_mounts.py[DEBUG]: changed swap => None
Dec 17 15:35:02 cloud-init[4081]: cc_mounts.py[DEBUG]: Ignoring nonexistent named mount swap
Dec 17 15:35:02 cloud-init[4081]: cc_mounts.py[DEBUG]: Attempting to determine the real name of ephemeral0
Dec 17 15:35:02 cloud-init[4081]: DataSourceEc2.py[DEBUG]: Unable to convert ephemeral0 to a device
Dec 17 15:35:02 cloud-init[4081]: cc_mounts.py[DEBUG]: changed default device ephemeral0 => None
Dec 17 15:35:02 cloud-init[4081]: cc_mounts.py[DEBUG]: Ignoring nonexistent default named mount ephemeral0
Dec 17 15:35:02 cloud-init[4081]: cc_mounts.py[DEBUG]: Attempting to determine the real name of swap
Dec 17 15:35:02 cloud-init[4081]: DataSourceEc2.py[DEBUG]: Unable to convert swap to a device
Dec 17 15:35:02 cloud-init[4081]: cc_mounts.py[DEBUG]: changed default device swap => None
Dec 17 15:35:02 cloud-init[4081]: cc_mounts.py[DEBUG]: Ignoring nonexistent default named mount swap
Dec 17 15:35:02 cloud-init[4081]: cc_mounts.py[DEBUG]: Skipping nonexistent device named None
Dec 17 15:35:02 cloud-init[4081]: cc_mounts.py[DEBUG]: Skipping nonexistent device named None
Dec 17 15:35:02 cloud-init[4081]: cc_mounts.py[DEBUG]: no need to setup swap
Dec 17 15:35:02 cloud-init[4081]: cc_mounts.py[DEBUG]: No modifications to fstab needed
Dec 17 15:35:02 cloud-init[4081]: handlers.py[DEBUG]: finish: modules-config/config-mounts: SUCCESS: config-mounts ran successfully

cloud-init-output.log does not include the terms "mount" or "ephemeral"

asked 4 years ago694 views

1 Answer
0
Accepted Answer

"Enumerated" doesn't mean "mounted". And in the documentation page you've linked it talks about how to prepare instance store volumes for use. Note that you may need to create a partition and create a filesystem on it. Again, that page talks to how to do that.

To find the device name, you can run lsblk -f- more detail is available in the documentation.

To mount a volume at boot, you'll need to add the device information to /etc/fstab. On first boot (in userdata), you should prepare the volume (the documentation above has the instructions), mount it and then modify fstab for future reboots.

Note that instance store volumes are ephemeral. It is possible that during a reboot we will move the instance to a new physical host; and it's highly likely that your instance will be on a new host if it is shut down and then restarted: In this case you should have a script that runs at boot to check the health of the filesystem; and if it isn't properly prepare to run mkfs again. Put another way: You should not count on data stored on an ephemeral volume to survive a restart. It might but it might not.

EXPERT

answered 4 years ago

AWS
EXPERT

reviewed 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.