canonical / cloud-init

Official upstream for the cloud-init: cloud instance initialization
https://cloud-init.io/
Other
2.99k stars 883 forks source link

Ephemeral w/o FS gets added to fstab #2594

Open ubuntu-server-builder opened 1 year ago

ubuntu-server-builder commented 1 year ago

This bug was originally filed in Launchpad as LP: #1513109

Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = None
date_created = 2015-11-04T15:23:39.414961+00:00
date_fix_committed = None
date_fix_released = None
id = 1513109
importance = medium
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1513109
milestone = None
owner = nhouse
owner_name = Nate House
private = False
status = confirmed
submitter = nhouse
submitter_name = Nate House
tags = []
duplicates = []

Launchpad user Nate House(nhouse) wrote on 2015-11-04T15:23:39.414961+00:00

Using a DS that includes ec2 metadata with an ephemeral disk, even if the ephemeral disk is not formatted with a filesystem, cc_mounts adds an fstab entry that is likely invalid and potentially breaking reboot in some cases. I've seen this affect Debian based images and if needing to reproduce, Rax OnMetal I/O flavor is a good candidate. We are adjusting the base images cloud config to avoid hitting this but, any other cloud providers that provision non-formatted ephemeral disks would likely have similar issues.

ubuntu-server-builder commented 1 year ago

Launchpad user Nate House(nhouse) wrote on 2015-11-04T15:51:19.453084+00:00

Here is some relevant log data and shows mounts attempting to mount the block dev instead of a valid partition:

Nov 3 21:53:25 debian [CLOUDINIT] openstack.py[DEBUG]: Mapped ephemeral0 to device /dev/sdb Nov 3 21:53:25 debian [CLOUDINIT] cc_mounts.py[DEBUG]: Mapped metadata name ephemeral0 to /dev/sdb Nov 3 21:53:25 debian [CLOUDINIT] cc_mounts.py[DEBUG]: changed default device ephemeral0 => /dev/sdb Nov 3 21:53:25 debian [CLOUDINIT] util.py[DEBUG]: Activating mounts via 'mount -a' failed#012Traceback (most recent call last):#012 File "/usr/lib/python3/dist-packages/cloudinit/config/cc_mounts.py", line 366, in handle#012 util.subp(("mount", "-a"))#012 File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 1687, in subp#012 cmd=args)#012cloudinit.util.ProcessExecutionError: Unexpected error while running command.#012Command: ('mount', '-a')#012Exit code: 32#012Reason: -#012Stdout: ''#012Stderr: 'mount: /dev/sdb is write-protected, mounting read-only\nmount: wrong fs type, bad option, bad superblock on /dev/sdb,\n missing codepage or helper program, or other error\n\n In some cases useful info is found in syslog - try\n dmesg | tail or so.\n'