- Newest
- Most votes
- Most comments
Hello,
Amazon Linux 2023 uses the following cloud-init version by default:
$ rpm-q cloud-init
cloud-init-22.2.2-1.amzn2023.1.7.noarch
Looking over the version's documentation, https://cloudinit.readthedocs.io/en/22.2.2/topics/modules.html#mounts it states:
When specifying the fs_spec, if the device name starts with one of xvd, sd, hd, or vd, the leading /dev may be omitted.
Any mounts that do not appear to either an attached block device or network resource will be skipped with a log like “Ignoring nonexistent mount …”.
This indicates that cloud-init is most likely not going to see/use labels. I was able to test and confirm this by running multiple variations of the configuration snippet you provided, each variation resulted in the same "Ignoring nonexistent mount …" error. When using the device name/path as mentioned within the guide though:
fs_setup:
- label: data01
filesystem: ext4
device: /dev/nvme1n1
partition: auto
mounts:
- [ /dev/nvme1n1, /app, "auto", "defaults,nofail", "0", "0" ]
This mounted with no issues. If you would still like to mount a freshly formatted volume (within cloud-init) using the label, you will need to use a different method to mount the volume, such as running a follow up command within the runcmd module (as seen below):
#cloud-config
fs_setup:
- label: data01
filesystem: ext4
device: /dev/nvme1n1
partition: auto
runcmd:
- [ mount, -L, data01, /app ]
Should you require further assistance regarding your specific situation/use-case, please feel free to create an AWS Support case to get in touch with an engineer to assist you further.
https://docs.aws.amazon.com/awssupport/latest/user/case-management.html
Relevant content
asked a year ago
asked 3 years ago
- AWS OFFICIALUpdated a year ago
