Add cloud-init to our base AMIs



Release Engineering
Platform Support
3 years ago
3 years ago


(Reporter: rail, Assigned: rail)


Firefox Tracking Flags

(Not tracked)


We can use cloud-init to simplify our setup and get rid of some scripts.

For example the following user-data would setup the hostsname, resize rootfs for PV instances, etc:

package_update: false
resize_rootfs: true
manage_etc_hosts: true
disable_root: false
Depends on: 1001715
with cloud-utils-growpart installed we can also use the following (it's optional, because those are implicit default varlues) to resize rootfs on HVM instances:

  mode: auto
  devices: ['/']

To make it work on centos /etc/cloud/cloud.cfg is needed to be tweaked to add "- growpart" before "- resizefs".

It works a bit weird on our current centos version. It needs to reboot to make kernel see the changes. Maybe not a big deal because we would reboot after each job.

To make it work we need fresher util-linux with partx which supports --update (and maybe a fresher kernel).

FTR, commands to install all we needed:

 rpm -i
 yum install -y cloud-init cloud-utils-growpart
 # add "- growpart" to /etc/cloud/cloud.cfg
 reboot # emulate first boot
 reboot # second boot

After these I got rootfs on an HVM instance resized. Reboot took ~5mins to resize 250G to 350G.
We have some version conflicts here. Balrog submitter uses an older version of python-requests library and fails to submit using the system wide installed package.

bhearsum │ rail: it's a problem with the dnsless slaves =\
bhearsum │ [ ~]$ rpm -qa | grep requests
bhearsum │ python-requests-1.1.0-4.el6.noarch
    rail │ cloud-init requires that package...
Depends on: 1015934
This is done by script
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.