How to prepare an Ubuntu 12.04 LTS Image with Cloud-init
Cloud-init has emerged to the be de-facto multi-distribution package that handles early initialization of a cloud instance. For more information on cloud-init, refer here: https://cloudinit.readthedocs.org/en/latest/
This tutorial describes how to prepare a Ubuntu 12.04 LTS image using cloud-init.
NOTE:
The version of cloud-init specific to Ubuntu 12.04 LTS has several unresolved bugs currently, including the following:
- The static IP allocation through cloud-init fails because the cloud-init process is unable to parse the cloud metadata supplied by OpenStack.
- There are issues with network re-initialization that cause problems with networking configuration.
In this tutorial, we offer a patch specific to the cloud-init version corresponding to 12.04 which addresses these issues.
Step 1 – Get the Prerequisites
Download Ubuntu 12.04 cloud image for your configuration. We recommend using 12.04.4.
NOTE: DO NOT use Ubuntu 12.04.5. Ubuntu 12.04.5 has a missing dependency which causes cloud-init install to fail. If you wish to use 12.04.5, we recommend getting the 12.04.4 version first and then updating it to 12.04.5. Fresh ISO install of 12.04.5 will not work with cloud-init.
Download the attached patch and deb file for Ubuntu 12.04 cloud-init package 0.6.3_1.15.
Step 2 – Prepare Ubuntu 12.04 Image with Cloud-init
Boot the Ubuntu cloud image. (You might want to look at this gist: https://gist.github.com/smoser/4756561)
Copy the attached deb file that we previously download into the instance.
Uninstall existing version of cloud-init, and install the new package just copied.
[code lang=”bash”]# remove existing cloud-initapt-get remove cloud-init
#install the new cloud-init
dpkg -i cloud-init_0.6.3-0ubuntu1.15_all.deb[/code]
Optional – Download Prebuilt Images
Download prebuilt images with cloudinit here: http://images.platform9.com/
NOTE: Be careful with future updates to Ubuntu 12.04 which may bring in new version of cloud-init creating similar issue. You will need to repeat the above process again in that case.