Comment 6 for bug 1877491

Revision history for this message
Matthew Ruffell (mruffell) wrote :

The fix is currently being SRU'd in cloud-init version 20.2-45-g5f7825e2-0ubuntu1, which is currently sitting in -proposed.

I have validated the packages on Xenial, Bionic, Eoan, Focal and Groovy on a t2.micro and cd5.large instance each on AWS, and everything looks good.

To aid in your testing, I have written some instructions to make testing straightforward.

Instructions to install:

1) sudo -s
2) cat <<EOF >/etc/apt/sources.list.d/ubuntu-$(lsb_release -cs)-proposed.list
# Enable Ubuntu proposed archive
deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-proposed restricted main multiverse universe
EOF
3) sudo apt update
4) sudo apt install cloud-init
5) sudo apt-cache policy cloud-init | grep Installed
Installed: 20.2-45-g5f7825e2-0ubuntu1~18.04.1

The cc_grub_dpkg module only runs once, at instance creation. To get it to run again, we will clear some configuration and instruct cloud-init to reconfigure the system again from scratch.

We need to clear out pre-exisiting debconf variables in the database

6) echo reset grub-pc/install_devices | sudo debconf-communicate grub-pc
7) echo reset grub-pc/install_devices_empty | sudo debconf-communicate grub-pc

cloud-init needs the hostname changed to fully reset to fresh state
8) sudo hostname test1
9) sudo cloud-init clean --logs --reboot

The machine will now reboot. Once the machine comes up again, you can attempt to trigger the interactive dialog box by removing and installing grub packages:

10) sudo apt remove grub-common grub-gfxpayload-lists grub-legacy-ec2 grub-pc grub-pc-bin grub2-common
11) sudo apt install grub-common grub-gfxpayload-lists grub-legacy-ec2 grub-pc grub-pc-bin grub2-common

This will now complete without any problems with the cloud-init package from -proposed.

You can also see if the debconf database entries have been set to the correct values:

12) echo get grub-pc/install_devices | sudo debconf-communicate grub-pc

On Xen instances, you will see something like "0 /dev/xvda", and on Nitro instances, you will see something like "0 /dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_vol07ea2e1d719941167".

The new cc_grub_dpkg module in cloud-init 20.2-45-g5f7825e2-0ubuntu1 fixes the grub interactive dialog box problems, and I am happy to mark this as verified.