cloud-init team mailing list archive
Mailing list archive
Re: cloud-init + overlayfs: after ubuntu trusty -> xenial upgrade, missing 'workdir'
On Wed, May 31, 2017 at 12:02 PM, Graham Leggett <minfrin@xxxxxxxx> wrote:
> Hi all,
> I have a cloud-init template that deploys an Ubuntu Trusty 14.04 machine
> that mounts an overlayfs at /var/spool/postfix, and this works great:
> - label: postfix
> device: /dev/xvde
> filesystem: ext4
> - [ /dev/xvde, /mnt/postfix-overlay ]
> - [ overlayfs, /var/spool/postfix, "overlayfs",
> "0", "2" ]
> mount_default_fields: [ None, None, "auto", "defaults,nobootwait", "0",
> "2” ]
> Upgrading the system image to Xenial 16.04 causes the overlayfs to fail to
> mount with the error “missing ‘workdir’”.
> Turns out, between Trusty and Xenial, the “workdir” directory in overlayfs
> went from optional to mandatory, and now the system no longer deploys.
Yes, the overlay module doesn't seem to have a way to find a default
workdir value by itself. =(
> What needs to happen is that after the fs_setup step that creates
> /mnt/postfix-overlay, but before the mounts section where the overlayfs is
> created, the workdir and upperdir directories need to be created on the
> /mnt/postfix-overlay disk as /mnt/postfix-overlay/upperdir and
> /mnt/postfix-overlay/workdir (or something) respectively.
> Is there something that can be done in cloud-init to make this possible?
Surely it can; I think it's a matter of module timing: you need the
directory to be created prior to the mounts module running.
Looking at /etc/cloud/cloud.cfg, the cloud_init_modules list, shows that
'bootcmd' will run before the 'mounts' stage, so
it should be possible to include a command like this:
- mkdir -p /mnt/postfix-overlay-workdir
And to update the overlayfs mount command to specify the workdir path.
That's untested, but I think should do what you need.
> Mailing list: https://launchpad.net/~cloud-init
> Post to : cloud-init@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~cloud-init
> More help : https://help.launchpad.net/ListHelp