Closed Bug 1001714 Opened 10 years ago Closed 10 years ago

Add cloud-init to our base AMIs

Categories

(Infrastructure & Operations Graveyard :: CIDuty, task)

x86_64
Linux
task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rail, Assigned: rail)

References

Details

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:

#cloud-config            
                         
fqdn: xyz.mozilla.org
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:

growpart:
  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 http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
 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 │ [cltbld@bld-linux64-spot-1009.build.releng.use1.mozilla.com ~]$ 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 aws_create_instance.py script
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Component: Platform Support → Buildduty
Product: Release Engineering → Infrastructure & Operations
Product: Infrastructure & Operations → Infrastructure & Operations Graveyard
You need to log in before you can comment on or make changes to this bug.