ReleaseEngineering/PuppetAgain/Base Images

< ReleaseEngineering‎ | PuppetAgain
Revision as of 14:47, 31 July 2012 by Djmitche (talk | contribs) (undo move)

Base images are OS/hardware-specific. In some cases, we can leverage existing installers; in others, we must use snapshots of installed systems. In either case, the idea is to get a minimal system set up to run puppetize.sh, which will take care of getting a certificate and running puppet in a loop until it succeeds.

See Puppetization Process for how a base image becomes a running instance.

CentOS 6.2 on Ganeti KVM

Install a minimal config with CentOS-6.2 install media:

First, create a new OS type if necessary - add

IMAGE_NAME="centos-62"
ARCH=x86_64
IMAGE_TYPE=dump
CDINSTALL=no

to /etc/ganeti/instance-image/variants/centos-62.conf, and add it to /etc/ganeti/instance-image/variants.list.

Send it everywhere:

gnt-cluster copyfile /etc/ganeti/instance-image/variants/centos-62.conf
gnt-cluster copyfile /etc/ganeti/instance-image/variants.list

modify your test VM to use this new image type:

gnt-instance modify -o image+centos-62 relabs-buildbot-master

and then start the install. I'm using a CD:

gnt-instance modify -H boot_order=cdrom,cdrom_image_path=/tmp/CentOS-6.2-x86_64-netinstall.iso relabs-buildbot-master
gnt-instance reboot relabs-buildbot-master

A few hints: /dev/vda1 = boot, /dev/vda2 = swap, /dev/vda3 = root; use ext3/4; *no* LVM! Do a minimal install.

Halt this and dump it:

/usr/lib/ganeti/os/image/tools/make-dump relabs-buildbot-master
saved in kvm-relabs as image+centos-62

reinstall, to get the ganeti-instance-image networking, console, etc. set up

gnt-instance reinstall relabs-buildbot-master

On another system, run 'make' in the setup subdirectory of http://hg.mozilla.org/build/puppet, to get a copy of base-image-centos6.sh. Copy this and paste it into /root/base-image-centos6.sh on the destination machine:

cat >base-image-centos6.sh <<EOF
[[paste it here]]
EOF
sh base-image-centos6.sh

After some action, and after asking for the deploy password, the system halts, ready to be imaged.

gnt-instance modify -o image+releng-base-centos-62 relabs-buildbot-master
/usr/lib/ganeti/os/image/tools/make-dump relabs-buildbot-master
saved in kvm-relabs as image+releng-base-centos-62

CentOS 6 with Kickstart

The bulk of a kickstart script is available in centos6-kickstart.cfg. The top section will need a few site-specific modifications. Most of the action is in the %post section, which:

  • looks for PUPPET_PASS on the kernel command line, and stores it in /root/deploypass
  • installs minimal packages
    • Uses a possibly site-specific yum-repo location (under http://repos/repos/)
  • installs puppetize.sh and sets it to run on boot.