Package: cloud-init
Version: 0.7.6~bzr976-2
Severity: important
Hi Charles,
I've just come across the following bug where if an EC2 instance is
launched with an instance store, cloud-init formats /dev/xvdb as an ext3
filesystem and injects the following line into /etc/fstab
/dev/xvdb /mnt auto defaults,nobootwait,comment=cloudconfig 0 2
However, since the nobootwait option is still unsupported in Debian
(unlike for Ubuntu 14.04), cloud-init will fail when it tries to mount
the newly formatted filesystem
$ grep xvdb /var/log/cloud-init*
/var/log/cloud-init.log:Jun 25 02:56:13 ip-172-31-7-217 [CLOUDINIT]
DataSourceEc2.py[DEBUG]: Remapped device name /dev/sdb => /dev/xvdb
/var/log/cloud-init.log:Jun 25 02:56:13 ip-172-31-7-217 [CLOUDINIT]
cc_mounts.py[DEBUG]: Mapped metadata name ephemeral0 to /dev/xvdb
/var/log/cloud-init.log:Jun 25 02:56:13 ip-172-31-7-217 [CLOUDINIT]
cc_mounts.py[DEBUG]: changed default device ephemeral0 => /dev/xvdb
/var/log/cloud-init.log:Jun 25 02:56:13 ip-172-31-7-217 [CLOUDINIT]
util.py[DEBUG]: Activating mounts via 'mount -a' failed#012Traceback
(most recent call last):#012 File
"/usr/lib/python2.7/dist-packages/cloudinit/config/cc_mounts.py", line
209, in handle#012 util.subp(("mount", "-a"))#012 File
"/usr/lib/python2.7/dist-packages/cloudinit/util.py", line 1539, in
subp#012 cmd=args)#012ProcessExecutionError: Unexpected error while
running command.#012Command: ('mount', '-a')#012Exit code: 32#012Reason:
-#012Stdout: ''#012Stderr: 'mount: wrong fs type, bad option, bad
superblock on /dev/xvdb,\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'
$ grep xvdb /var/log/kern.log
Jun 25 02:56:13 ip-172-31-7-217 kernel: [ 82.574256] EXT4-fs (xvdb):
Unrecognized mount option "nobootwait" or missing value
So when a user next reboots their instance, the instance becomes stuck:
[ OK ] Started File System Check on /dev/xvdb.
Mounting /mnt...
[ FAILED ] Failed to mount /mnt.
See 'systemctl status mnt.mount' for details.
[ DEPEND ] Dependency failed for Local File Systems.
...
Starting Emergency Shell...
[ OK ] Started Emergency Shell.
[ OK ] Reached target Emergency Mode.
Welcome to emergency mode! After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default" to try again
to boot into default mode.
sulogin: root account is locked, starting shell
#
Changing nobootwait to nofail in /etc/fstab fixes this behaviour.
I've reproduced this on both the community and marketplace AMIs listed
at https://wiki.debian.org/Cloud/AmazonEC2Image
More specifically the following in ap-southeast-2
* [community] debian-jessie-amd64-hvm-2015-06-07-12-27-ebs (ami-bbc5bd81)
* [marketplace]
debian-jessie-amd64-hvm-2015-06-07-12-27-ebs-39d3917e-ff4e-4597-848e-4d0fdf8529e6-ami-116d857a.2
(ami-07e3993d)
Regards,
Andrew
--
Andrew Lau | EC2 Support Operations | Amazon Web Services (Sydney)
-- System Information:
Debian Release: 8.1
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.16.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages cloud-init depends on:
ii debconf [debconf-2.0] 1.5.56
ii ifupdown 0.7.53.1
ii lsb-base 4.1+Debian13+nmu1
ii procps 2:3.3.9-9
ii python 2.7.9-1
ii python-boto 2.34.0-2
ii python-cheetah 2.4.4-3
ii python-configobj 5.0.6-1
ii python-jsonpatch 1.3-5
ii python-oauth 1.0.1-4
ii python-prettytable 0.7.2-3
ii python-requests 2.4.3-6
ii python-serial 2.6-1.1
ii python-software-properties 0.92.25debian1
ii python-yaml 3.11-2
cloud-init recommends no packages.
cloud-init suggests no packages.
-- Configuration Files:
/etc/cloud/cloud.cfg changed:
users:
- default
disable_root: true
preserve_hostname: false
cloud_init_modules:
- migrator
- bootcmd
- write-files
- resizefs
- set_hostname
- update_hostname
- update_etc_hosts
- ca-certs
- rsyslog
- users-groups
- ssh
cloud_config_modules:
- emit_upstart
- mounts
- ssh-import-id
- locale
- set-passwords
- grub-dpkg
- apt-pipelining
- apt-configure
- package-update-upgrade-install
- landscape
- timezone
- puppet
- chef
- salt-minion
- mcollective
- disable-ec2-metadata
- runcmd
- byobu
cloud_final_modules:
- rightscale_userdata
- scripts-per-once
- scripts-per-boot
- scripts-per-instance
- scripts-user
- ssh-authkey-fingerprints
- keys-to-console
- phone-home
- final-message
- power-state-change
system_info:
# This will affect which distro class gets used
distro: debian
# Default user name + that default users groups (if added/used)
default_user:
name: admin
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
lock_passwd: True
gecos: Debian
groups: [adm, audio, cdrom, dialout, floppy, video, plugdev, dip]
# Other config here will be given to the distro class and/or path classes
paths:
cloud_dir: /var/lib/cloud/
templates_dir: /etc/cloud/templates/
upstart_dir: /etc/init/
package_mirrors:
- arches: [default]
failsafe:
primary: http://ftp.debian.org/debian
-- debconf information:
* cloud-init/datasources: Ec2
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]