Comment 11 for bug 1712680

Revision history for this message
Scott Moser (smoser) wrote :

If you're plagued by this bug, there are at least 2 workarounds and one
long term solution. 'A' and probably the easiest and most effective
workaround.

A.) set 'manual_cache_clean' to true

After first boot, do this:
  $ echo "manual_cache_clean: true" > /etc/cloud/cloud.cfg.d/99-manual.cfg
  $ touch /var/lib/cloud/instance/manual-clean

The above could also be done with 'in-target' during installation
via 'late_command' or some other mechanism.
In the install environment, only the writing of 99-manual.cfg is necessary.
If you do it after first boot (before a reboot) then you must also
touch the manual-clean file.

the 'manual_cache_clean' setting tells cloud-init that it should not search
for a datasource if there is one already present from a previous boot.
Setting this to 'true' means that the user must remove
/var/lib/cloud/instance/ manually before capturing an image to make new
instances from.

For MAAS, this is a fairly reasonable solution as "capturing" an image and
re-deploying it is not common.

B.) disable cloud-init networking *after* first boot.
To make cloud-init not render networking config on subsequent boots:

 $ echo "network: {config: disabled}" > /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg

curtin feeds the networking information it received from MAAS through
to cloud-init in etc/cloud/cloud.cfg.d/50-curtin-networking.cfg .
Above, 99-disable-network-config.cfg filename is provided as it will take
precedence over other curtin's provided network information.

This solution *cannot* be done from the installation environment, as
doing so would make cloud-init not render networking on first boot, and
thus no networking information would be done in the machine at all.

c.) upgrade your cloud-init inside the image.
MAAS's centos images are built with cloud-init/el-stable repo [1].
That currently contains a version of cloud-init (0.7.9+224.g681baff-1) that
does not have a fix for this bug.

We also maintain 2 other repos:
  cloud-init/el-testing
  cloud-init/cloud-init-dev

Ultimately we'll want to get cloud-init at 18.1 into the el-testing repo
and then even get those into the maas images.