Comment 0 for bug 1725067

Steve Langasek (vorlon) wrote :

A freshly build Ubuntu 17.10 image that's configured to boot without initramfs by passing root=PARTUUID=<uuid> on the kernel commandline comes up degraded because cloud-init fails to resize the root partition.

Oct 20 00:07:30 ubuntu cloud-init[493]: 2017-10-20 00:07:30,656 - util.py[WARNING]: Failed to resize filesystem (cmd=('resize2fs', '/dev/root'))
Oct 20 00:07:30 ubuntu cloud-init[493]: 2017-10-20 00:07:30,662 - util.py[WARNING]: Running module resizefs (<module 'cloudinit.config.cc_resizefs' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_resizefs.py'>) failed

Looking at the code, I see that there are two separate implementations of rootdev_from_cmdline, one in cloudinit/util.py and one in cloudinit/config/cc_resizefs.py; and the second does not handle partuuid.

>>> from cloudinit.util import rootdev_from_cmdline
>>> rootdev_from_cmdline('BOOT_IMAGE=/boot/vmlinuz-4.4.0-1007-kvm root=PARTUUID=f122607f-3631-4411-bd34-de4bed76e0f7 ro console=tty1 console=ttyS0 systemd.log_level=debug')
'/dev/disk/by-partuuid/f122607f-3631-4411-bd34-de4bed76e0f7'
>>> from cloudinit.config.cc_resizefs import rootdev_from_cmdline
>>> rootdev_from_cmdline('OT_IMAGE=/boot/vmlinuz-4.4.0-1007-kvm root=PARTUUID=f122607f-3631-4411-bd34-de4bed76e0f7 ro console=tty1 console=ttyS0 systemd.log_level=debug')
'/dev/PARTUUID=f122607f-3631-4411-bd34-de4bed76e0f7'
>>>

This is related to bug #1684869; I'm not sure if it's the same bug reintroduced or if was never fixed properly on trunk (17.1).