I'm using cloud-init to automatically prepare an AWS image (AMI) for use in a production environment - that way I can have the environment setup process tracked in a source control system, but I can skip that lengthy process when I need a new production server.
So the process is as follows:
- use a cloud-init file to boot a new base image (Ubuntu 14.04 cloud-image)
- wait for cloud-init to complete, then create an image from the running instance, and terminate it
- to launch a new production server, I use a small cloud-init to boot from the AMI and perform the final configuration (setting up the correct hostname, deploying software, etc).
The problem I'm having is that the first cloud-init config file uses disk_setup
, and mounts
modules to mount an EBS volume. Once that is done, the instance has /etc/fstab
updated and everything is fine. After doing step 3, though, the resulting instance has the EBS volume (actually a copy of it) attached and mounted properly, but /etc/fstab
does not contain the mounts for the volume. Luckily I don't restart after step 3, but I might and that will break the server.
Any idea what is going on? I don't use mounts
in step 3's cloud-init config, but why does it not retain the fstab
setup from the image?