cloud-init resizefs fails when booting with root=PARTUUID=
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
High
|
Chad Smith | ||
cloud-init (Ubuntu) |
Fix Released
|
Medium
|
Chad Smith | ||
Xenial |
Fix Released
|
Medium
|
Unassigned | ||
Zesty |
Fix Released
|
Medium
|
Unassigned | ||
Artful |
Fix Released
|
Medium
|
Chad Smith |
Bug Description
http://
https:/
=== Begin SRU Template ===
[Impact]
Growing the root partition would not resize and leave a Traceback in /var/log/
a.) The device /dev/root did not exist
-- this case only hit xenial only because zesty already had a /dev/root created in the image so resize succeeded.
b.) the kernel command line included PARTUUID=<value>
-- This potential SRU regression occurred because of code restructuring that still discovered (and logged) but didn't use the discovered kernel_cmdline root device path when resizing.
[Test Case]
get-proposed-image is
https:/
It downloads a cloud image of a given release, and then creates a -proposed
image with cloud-init upgraded.
A script 'recreate.sh' will run each of the steps below automated.
https:/
NOTE: By default the images downloaded start off as 2Gig partitions, by requesting a 10G sparse qcow2 image resizefs should find the partition and resize it to the full 10Gig. If resizefs fails, we'd still be stuck with a 2GB response for "df -h /". This is what failed on our previous SRU proposal. The disk stayed at 2G instead of being resized to 10G.
1.) get a (proposed) disk image image.
and convert it to raw so you can read the partuuid with sfdisk
(get-
'qemu-img convert -O raw orig.img orig.raw')
./get-
2.) get the partition uuid of the first partition
# for xenial images that are dos partition table rather than gpt
# we need to convert that with:
# sgdisk --mbrtogpt $raw
$ raw=yakkety-
$ ptuuid=$(sfdisk --part-uuid $raw 1)
3.) create a nocloud seed
$ printf "%s\n%s\n%s\n%s\n" "#cloud-config" "password: passw0rd" \
"chpasswd: {expire: False}" "ssh_pwauth: True" > my-user-data
$ echo "instance-id: $(uuidgen || echo i-abcdefg)" > my-meta-data
$ cloud-localds my-seed.img my-user-data my-meta-data
4.) extract kernel from inside the image
$ sudo mount-image-
5.) boot instance with disk backed by the raw disk above.
$ qemu-img create -f qcow2 -b $raw disk.img 10G
$ qemu-system-x86_64 -enable-kvm \
-drive file=disk.
-net nic -net user,hostfwd=
-snapshot -m 768 -nographic -echr 0x05 \
-kernel kernel \
-append "root=PARTUUID=
6.) log in, verify / has been resized.
log in with 'ubuntu' and password 'passw0rd'
$ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/root 9.6G 1009M 8.6G 11% /
[Regression Potential]
Regressions would surface as the root filesystem not being correctly resized.
The user would find themselves with not as much disk as expected.
[Other Info]
The qemu-system-x86 command above uses ide devices. This is because
the ide device emulated by qemu is built into the -generic kernel,
while the more common virtio-block or virtio-scsi are not. If you
attach those device types, it will fail with 'cant find root'.
Note that this was a regression of changes added in
* bug 1684869: growing root partition does not always work with root=PARTUUID=
* bug 1677376: growing partitions does not work when booted without initramfs
The issue probably is only seen if using the version of cloud-init
in xenial-proposed. Zesty and artful kernels or userspace made the change
actually not regress. However we will verify functionality for the uploaded
version in each of x, z, a.
[Other Info]
Upstream commit at
https:/
=== End SRU Template ===
A freshly built Ubuntu 17.10 image that's configured to boot without initramfs by passing root=PARTUUID=
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.
Looking at the code, I see that there are two separate implementations of rootdev_
>>> from cloudinit.util import rootdev_
>>> rootdev_
'/dev/disk/
>>> from cloudinit.
>>> rootdev_
'/dev/PARTUUID=
>>>
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).
Related bugs:
* bug 1684869: growing root partition does not always work with root=PARTUUID=
* bug 1685291: RFC: virtio and virtio-scsi should be built in
* bug 1677376: growing partitions does not work when booted without initramfs
Related branches
- Server Team CI bot: Approve (continuous-integration)
- cloud-init Commiters: Pending requested
-
Diff: 848 lines (+260/-107)21 files modifiedcloudinit/config/cc_lxd.py (+1/-1)
cloudinit/config/cc_ntp.py (+3/-1)
cloudinit/config/cc_resizefs.py (+13/-30)
cloudinit/config/cc_users_groups.py (+2/-1)
cloudinit/config/schema.py (+1/-1)
debian/changelog (+16/-0)
doc/examples/cloud-config-user-groups.txt (+3/-3)
tests/cloud_tests/testcases/__init__.py (+7/-0)
tests/cloud_tests/testcases/base.py (+8/-4)
tests/cloud_tests/testcases/examples/including_user_groups.py (+6/-0)
tests/cloud_tests/testcases/examples/including_user_groups.yaml (+5/-2)
tests/cloud_tests/testcases/main/command_output_simple.py (+16/-0)
tests/cloud_tests/testcases/modules/ntp.yaml (+2/-2)
tests/cloud_tests/testcases/modules/user_groups.py (+6/-0)
tests/cloud_tests/testcases/modules/user_groups.yaml (+5/-2)
tests/unittests/test_handler/test_handler_lxd.py (+8/-8)
tests/unittests/test_handler/test_handler_ntp.py (+12/-11)
tests/unittests/test_handler/test_handler_resizefs.py (+57/-34)
tests/unittests/test_handler/test_schema.py (+36/-1)
tools/read-dependencies (+36/-5)
tools/run-centos (+17/-1)
- Server Team CI bot: Approve (continuous-integration)
- Scott Moser: Pending requested
-
Diff: 848 lines (+260/-107)21 files modifiedcloudinit/config/cc_lxd.py (+1/-1)
cloudinit/config/cc_ntp.py (+3/-1)
cloudinit/config/cc_resizefs.py (+13/-30)
cloudinit/config/cc_users_groups.py (+2/-1)
cloudinit/config/schema.py (+1/-1)
debian/changelog (+16/-0)
doc/examples/cloud-config-user-groups.txt (+3/-3)
tests/cloud_tests/testcases/__init__.py (+7/-0)
tests/cloud_tests/testcases/base.py (+8/-4)
tests/cloud_tests/testcases/examples/including_user_groups.py (+6/-0)
tests/cloud_tests/testcases/examples/including_user_groups.yaml (+5/-2)
tests/cloud_tests/testcases/main/command_output_simple.py (+16/-0)
tests/cloud_tests/testcases/modules/ntp.yaml (+2/-2)
tests/cloud_tests/testcases/modules/user_groups.py (+6/-0)
tests/cloud_tests/testcases/modules/user_groups.yaml (+5/-2)
tests/unittests/test_handler/test_handler_lxd.py (+8/-8)
tests/unittests/test_handler/test_handler_ntp.py (+12/-11)
tests/unittests/test_handler/test_handler_resizefs.py (+57/-34)
tests/unittests/test_handler/test_schema.py (+36/-1)
tools/read-dependencies (+36/-5)
tools/run-centos (+17/-1)
- Server Team CI bot: Approve (continuous-integration)
- Scott Moser: Pending requested
-
Diff: 1040 lines (+258/-289)23 files modifiedcloudinit/config/cc_lxd.py (+1/-1)
cloudinit/config/cc_ntp.py (+3/-1)
cloudinit/config/cc_resizefs.py (+13/-30)
cloudinit/config/cc_users_groups.py (+2/-1)
cloudinit/config/schema.py (+1/-1)
debian/changelog (+14/-0)
debian/patches/series (+0/-1)
dev/null (+0/-181)
doc/examples/cloud-config-user-groups.txt (+3/-3)
tests/cloud_tests/testcases/__init__.py (+7/-0)
tests/cloud_tests/testcases/base.py (+8/-4)
tests/cloud_tests/testcases/examples/including_user_groups.py (+6/-0)
tests/cloud_tests/testcases/examples/including_user_groups.yaml (+5/-2)
tests/cloud_tests/testcases/main/command_output_simple.py (+16/-0)
tests/cloud_tests/testcases/modules/ntp.yaml (+2/-2)
tests/cloud_tests/testcases/modules/user_groups.py (+6/-0)
tests/cloud_tests/testcases/modules/user_groups.yaml (+5/-2)
tests/unittests/test_handler/test_handler_lxd.py (+8/-8)
tests/unittests/test_handler/test_handler_ntp.py (+12/-11)
tests/unittests/test_handler/test_handler_resizefs.py (+57/-34)
tests/unittests/test_handler/test_schema.py (+36/-1)
tools/read-dependencies (+36/-5)
tools/run-centos (+17/-1)
- Server Team CI bot: Approve (continuous-integration)
- Scott Moser: Pending requested
-
Diff: 1042 lines (+258/-289)23 files modifiedcloudinit/config/cc_lxd.py (+1/-1)
cloudinit/config/cc_ntp.py (+3/-1)
cloudinit/config/cc_resizefs.py (+13/-30)
cloudinit/config/cc_users_groups.py (+2/-1)
cloudinit/config/schema.py (+1/-1)
debian/changelog (+14/-0)
debian/patches/series (+0/-1)
dev/null (+0/-181)
doc/examples/cloud-config-user-groups.txt (+3/-3)
tests/cloud_tests/testcases/__init__.py (+7/-0)
tests/cloud_tests/testcases/base.py (+8/-4)
tests/cloud_tests/testcases/examples/including_user_groups.py (+6/-0)
tests/cloud_tests/testcases/examples/including_user_groups.yaml (+5/-2)
tests/cloud_tests/testcases/main/command_output_simple.py (+16/-0)
tests/cloud_tests/testcases/modules/ntp.yaml (+2/-2)
tests/cloud_tests/testcases/modules/user_groups.py (+6/-0)
tests/cloud_tests/testcases/modules/user_groups.yaml (+5/-2)
tests/unittests/test_handler/test_handler_lxd.py (+8/-8)
tests/unittests/test_handler/test_handler_ntp.py (+12/-11)
tests/unittests/test_handler/test_handler_resizefs.py (+57/-34)
tests/unittests/test_handler/test_schema.py (+36/-1)
tools/read-dependencies (+36/-5)
tools/run-centos (+17/-1)
- Server Team CI bot: Needs Fixing (continuous-integration)
- Scott Moser: Approve
-
Diff: 302 lines (+70/-64)2 files modifiedcloudinit/config/cc_resizefs.py (+13/-30)
tests/unittests/test_handler/test_handler_resizefs.py (+57/-34)
description: | updated |
description: | updated |
Changed in cloud-init: | |
status: | New → Confirmed |
status: | Confirmed → Triaged |
importance: | Undecided → High |
Changed in cloud-init: | |
status: | Triaged → In Progress |
assignee: | nobody → Chad Smith (chad.smith) |
Changed in cloud-init (Ubuntu): | |
status: | Triaged → In Progress |
assignee: | nobody → Chad Smith (chad.smith) |
description: | updated |
description: | updated |
Changed in cloud-init (Ubuntu Xenial): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Zesty): | |
status: | New → Confirmed |
description: | updated |
Changed in cloud-init (Ubuntu Xenial): | |
status: | Confirmed → Fix Committed |
Changed in cloud-init (Ubuntu Zesty): | |
status: | Confirmed → Fix Committed |
Changed in cloud-init: | |
status: | In Progress → Fix Released |
Changed in cloud-init (Ubuntu Artful): | |
status: | In Progress → Fix Committed |
Changed in cloud-init (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Zesty): | |
importance: | Undecided → Medium |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in cloud-init (Ubuntu Artful): | |
status: | Fix Committed → Fix Released |
Actually, cc_resizefs. rootdev_ from_cmdline exists but appears to be unused. I'm not sure why this is failing, then.