Ubuntu 18.4 With Root ZFS on AWS

Last year, I posted about how to build Ubuntu 16.04 AMIs using HashiCorp Packer‘s ebs-surrogate builder. Since then Ubuntu 18.04 has been released, and the process has changed a little.

I’ve updated the repository with a new builder for Ubuntu 18.04 (“Bionic Beaver”) which works in the same manner. There are a few notable changes compared to the 16.04 builder described in the last post:

  • It no longer is necessary to install the zfs-dkms or zfs-zed packages on either the surrogate or inside the chroot, which makes the build proceed substantially faster.
  • Netplan is now used to configure eth0 for DHCP instead of an entry in /etc/network/interfaces. net.ifnames=0 is still set via GRUB as recommended by the AWS ENA Guide.
  • CloudInit is no longer pinned to a specific revision - this was done in the 16.04 builder to work around a regression which prevented key pairs from being populated correctly with some versions of CloudInit.

As before, the bionic template builds using a spot instance in the us-west-2 region, and copies the resulting AMI to the regions specified in the template.

I’ve also cleaned up some aspects of the xenial template to make it compatible with newer versions of Packer, and improved the bash hygiene throughout, which may be interesting for those choosing not to upgrade.

If you use any of these templates, please feel free to open issues or pull-requests on the jen20/packer-ubuntu-zfs repository!

zfs  aws  packer  linux