PowerVC deploying AIX with Cloud-Init

Finally, I get round to trying a PowerVC AIX image deploy using the Cloud-Init first boot engine instead of the older Activation Engine originally used with System Director.

First, let me say I am sold on the Cloud-Init way and will be using it from now on but it can be a bit tricky to get started – in this blog I hope to smooth your way so its quick and simple.

There are two hiccups you need to over come:

1) The documentation is not helpful. I do not like manual pages that try to cover installing it on four different operating systems at the same time. This means the manual pages are 75% irrelevant and four times over complex when I am trying to get it done right first time.  I will feedback to the Knowledge Center team my comments hopefully to make it all simpler.

2) The pre-reqs for installing Cloud-Init are massive – which adds complexity and a script supplied assumes you AIX is directly connected to the Internet.  Um! Nope guys that is going to be unlikely in 99% of cases.

 

Part 1 – Information sources

  1. The PowerVC manual pages can be found here: Knowledge Center – PowerVC 1.2.3 Capturing
     
  2. As always Benoit = chmod666 has done it all before. Here is his excellent article but a warning: he was doing PowerVC 1.2.2.2 and explaining new features, Cloud-Init and Chef all in one go. My head nearly exploded trying to follow what he was doing and he was using some early code: chmod666 does Cloud-Init and more

Here I am just going to use:

  1. PowerVC 1.2.3.1
  2. Deploy a brand new AIX 7.1 TL3 service pack 5 captured image using the
  3. official Cloud-Init and try the
  4. PowerVC Activation Input field way of adding a few lines of Korn shell.

Cloud-Init can also run many other languages and tools and hook in to provisioning engines like Chef but NOT HERE guys i.e. KISS for the first time. Then try something fancy once you know the basics work.

Part 2 – Getting the packages for Cloud-Init

Get Cloud-Init from the IBM AIX / Linux Toolbox here: http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/alpha.html#C

where you will find three files:

  1. cloud-init-0.7.5-4.1.aix6.1.ppc.rpm
  2. cloudinit.README – worth a quick look
  3. cloudinst.sh – If your AIX server has direct access to the Internet and you are happy to download 255 MB of install images every time you want to capture the OS image then this script could be useful but I think most people will not have Internet nor want to download every time.  Its a clever script and it took me 20 minutes and I had to “call a friend” to work out how it was trying to do the downloads – there is a “rpm -qip URL” buried in the middle.

The README is useful as it documents all the 33 prerequisite RPMs and where to get them from on the Internet. There are loads because:

  • a) Cloud-Init is in the Python language which comes in many parts / modules and
  • b) Cloud-Init is very powerful and can connect to may other tools.

If however you just want to Deploy and fix the hostname, IP address, DNS and security keys then it is in the “total over kill 16 ton bulldozer to move a house brick 6 inches” territory.

 

So I intend to downloads once to my Internet connected NFS server and install from it.  A quick cut’n’paste and I made a wget script

BULL=http://www.bullfreeware.com/download/bin
OSS4AIX=http://www.oss4aix.org/download/RPMS

# The following packages are needed to install the python package.
wget      $BULL/1439/bzip2-1.0.6-2.aix6.1.ppc.rpm
wget      $BULL/1441/db-4.8.24-4.aix6.1.ppc.rpm
wget      $BULL/1639/expat-2.1.0-1.aix6.1.ppc.rpm
wget      $BULL/2046/gmp-5.1.3-1.aix6.1.ppc.rpm
wget      $BULL/1587/libffi-3.0.11-1.aix6.1.ppc.rpm
wget      $BULL/2076/openssl-1.0.1g-1.aix6.1.ppc.rpm
wget      $BULL/1908/zlib-1.2.5-6.aix6.1.ppc.rpm
wget      $BULL/2013/gettext-0.17-8.aix6.1.ppc.rpm
wget      $BULL/1446/gdbm-1.10-1.aix6.1.ppc.rpm
wget      $BULL/2024/libiconv-1.14-1.aix6.1.ppc.rpm
wget      $BULL/2091/bash-4.2-9.aix6.1.ppc.rpm
wget      $BULL/1918/info-5.0-2.aix6.1.ppc.rpm
wget      $BULL/1464/readline-6.2-3.aix6.1.ppc.rpm
wget      $BULL/1486/ncurses-5.9-3.aix6.1.ppc.rpm
wget      $BULL/1742/sqlite-3.7.15.2-2.aix6.1.ppc.rpm
wget      $BULL/2064/python-2.7.6-1.aix6.1.ppc.rpm

wget      $OSS4AIX/fdupes/fdupes-1.51-1.aix5.1.ppc.rpm

# The following packages are need to install cloudinit.
wget     $BULL/2065/python-devel-2.7.6-1.aix6.1.ppc.rpm
wget     $BULL/2117/python-xml-0.8.4-1.aix6.1.ppc.rpm
wget     $BULL/2101/python-boto-2.34.0-1.aix6.1.noarch.rpm
wget     $BULL/2099/python-argparse-1.2.1-1.aix6.1.noarch.rpm
wget     $BULL/2102/python-cheetah-2.4.4-2.aix6.1.ppc.rpm
wget     $BULL/2103/python-configobj-5.0.5-1.aix6.1.noarch.rpm
wget     $BULL/2106/python-jsonpointer-1.0.c1ec3df-1.aix6.1.noarch.rpm
wget     $BULL/2105/python-jsonpatch-1.8-1.aix6.1.noarch.rpm
wget     $BULL/2108/python-oauth-1.0.1-1.aix6.1.noarch.rpm
wget     $BULL/2112/python-pyserial-2.7-1.aix6.1.ppc.rpm
wget     $BULL/1858/python-prettytable-0.7.2-1.aix6.1.noarch.rpm
wget     $BULL/2114/python-requests-2.4.3-1.aix6.1.noarch.rpm
wget     $BULL/1632/libyaml-0.1.4-1.aix6.1.ppc.rpm
wget     $BULL/2192/python-PyYAML-3.11-2.aix6.1.ppc.rpm
wget     $BULL/1903/python-six-1.3.0-1.aix6.1.noarch.rpm
wget     $BULL/2115/python-setuptools-0.9.8-2.aix6.1.noarch.rpm

# cloud-init itself
wget     ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/cloudinit/cloud-init-0.7.5-4.1.aix6.1.ppc.rpm

 

You can see most of the software is downloaded from the

  • BULL open source website for AIX software,
  • fdupes comes from Michael Perzl’s oss4aix.org website and
  • the final like gets cloud-init (if you have not already done so).

In total 255 MB or RPMs.

Part 3 – Installing Cloud-Init

I NFS mount this directory of packages on to my AIX OS and  it would be nice to just install the lot but no it includes the RPM from hell that is gettext.

This has a dependency that can never be satisfied – IMHO.

So here is my three part install:

rpm -Uvh gettext-0.17-8.aix6.1.ppc.rpm –nodeps

Output looks like this

gettext                     ##################################################
add libintl.so.1 (32bits) shared member to /opt/freeware/lib/libintl.a
add libintl.so.1 (64bits) shared member to  /opt/freeware/lib/libintl.a

 

 

rpm -Uvh bzip2-1.0.6-2.aix6.1.ppc.rpm
db-4.8.24-4.aix6.1.ppc.rpm
expat-2.1.0-1.aix6.1.ppc.rpm
gmp-5.1.3-1.aix6.1.ppc.rpm
libffi-3.0.11-1.aix6.1.ppc.rpm
openssl-1.0.1g-1.aix6.1.ppc.rpm
zlib-1.2.5-6.aix6.1.ppc.rpm
gdbm-1.10-1.aix6.1.ppc.rpm
libiconv-1.14-1.aix6.1.ppc.rpm
bash-4.2-9.aix6.1.ppc.rpm
info-5.0-2.aix6.1.ppc.rpm
readline-6.2-3.aix6.1.ppc.rpm
ncurses-5.9-3.aix6.1.ppc.rpm
sqlite-3.7.15.2-2.aix6.1.ppc.rpm
fdupes-1.51-1.aix5.1.ppc.rpm
python-devel-2.7.6-1.aix6.1.ppc.rpm
python-2.7.6-1.aix6.1.ppc.rpm
python-xml-0.8.4-1.aix6.1.ppc.rpm
python-boto-2.34.0-1.aix6.1.noarch.rpm
python-argparse-1.2.1-1.aix6.1.noarch.rpm
python-cheetah-2.4.4-2.aix6.1.ppc.rpm
python-configobj-5.0.5-1.aix6.1.noarch.rpm
python-jsonpointer-1.0.c1ec3df-1.aix6.1.noarch.rpm
python-jsonpatch-1.8-1.aix6.1.noarch.rpm
python-oauth-1.0.1-1.aix6.1.noarch.rpm
python-pyserial-2.7-1.aix6.1.ppc.rpm
python-prettytable-0.7.2-1.aix6.1.noarch.rpm
python-requests-2.4.3-1.aix6.1.noarch.rpm
libyaml-0.1.4-1.aix6.1.ppc.rpm
python-PyYAML-3.11-2.aix6.1.ppc.rpm
python-six-1.3.0-1.aix6.1.noarch.rpm
python-setuptools-0.9.8-2.aix6.1.noarch.rpm

 

This fails with a /opt needs 44 MB then I get:

bzip2                       ##################################################
db                          ##################################################
expat                       ##################################################
gmp                         ##################################################
libffi                      ##################################################
warning: /var/ssl/openssl.cnf saved as /var/ssl/openssl.cnf.rpmorig
openssl                     ##################################################
zlib                        ##################################################
gdbm                        ##################################################
libiconv                    ##################################################
add shr4.o shared members from /usr/lib/libiconv.a to  /opt/freeware/lib/libiconv.a
add shr.o shared members from /usr/lib/libiconv.a to  /opt/freeware/lib/libiconv.a
add shr4_64.o shared members from /usr/lib/libiconv.a to  /opt/freeware/lib/libiconv.a
/
bash                        ##################################################

        ## Binary “bash” is avaible on 32bit and 64bit ##

        The default used is 64bit

        Please change symbolic link
        from “bash” into /bin directory
        To do that tape:
                # rm -f /bin/bash
                # ln -sf /opt/freeware/bin/bash_32 /bin/bash
warning: /opt/freeware/info/dir created as /opt/freeware/info/dir.rpmnew
info                        ##################################################
Please check that /etc/info-dir does exist.
You might have to rename it from /etc/info-dir.rpmsave to /etc/info-dir.
readline                    ##################################################
ncurses                     ##################################################
sqlite                      ##################################################
fdupes                      ##################################################
python-devel                ##################################################
python                      ##################################################
python-xml                  ##################################################
python-boto                 ##################################################
python-argparse             ##################################################
python-cheetah              ##################################################
python-configobj            ##################################################
python-jsonpointer          ##################################################
python-jsonpatch            ##################################################
python-oauth                ##################################################
python-pyserial             ##################################################
python-prettytable          ##################################################
python-requests             ##################################################
libyaml                     ##################################################
python-PyYAML               ##################################################
python-six                  ##################################################
python-setuptools           ##################################################

 

This is all pretty confusing but I make the assumption this is all perfectly OK !!!

Then install clout-init

 

rpm -Uvh cloud-init-0.7.5-4.1.aix6.1.ppc.rpm

 

and get

cloud-init                  ##################################################

 

Part 4 – Check Cloud-Init was installed

Check they are all installed

# rpm -qa
AIX-rpm-7.1.3.45-1
tcl-8.4.7-3
tk-8.4.7-3
expect-5.42.1-3
gettext-0.17-8
bzip2-1.0.6-2
db-4.8.24-4
expat-2.1.0-1
gmp-5.1.3-1
libffi-3.0.11-1
openssl-1.0.1g-1
zlib-1.2.5-6
gdbm-1.10-1
libiconv-1.14-1
bash-4.2-9
info-5.0-2
readline-6.2-3
ncurses-5.9-3
sqlite-3.7.15.2-2
fdupes-1.51-1
python-devel-2.7.6-1
python-2.7.6-1
python-xml-0.8.4-1
python-boto-2.34.0-1
python-argparse-1.2.1-1
python-cheetah-2.4.4-2
python-configobj-5.0.5-1
python-jsonpointer-1.0.c1ec3df-1
python-jsonpatch-1.8-1
python-oauth-1.0.1-1
python-pyserial-2.7-1
python-prettytable-0.7.2-1
python-requests-2.4.3-1
libyaml-0.1.4-1
python-PyYAML-3.11-2
python-six-1.3.0-1
python-setuptools-0.9.8-2
cloud-init-0.7.5-4.1

Part 5 – Configuring Cloud-Init

On AIX the config file is here /opt/freeware/etc/cloud/cloud.cfg

This is were you start to see the power of the many Cloud-Init options and features.

The manual pages have lots of stuff that needs changing for Linux (Red Hat RHEL and SUSE SLES but nothing for Ubuntu (yet)) and its easy to miss the AIX parts.

For a Virtual Machine (LPAR) that you create any might want to later change the hostname you have to remove one line.  If you don’t you can change the hostname but it will revert back every time you reboot which would drive most people nuts!

Delete the line

  • – update_hostname

From the paragraph:

cloud_init_modules:
 – migrator
 – seed_random
 – bootcmd
 – write-files
 – set_hostname
 – update_hostname
 – update_etc_hosts
 – ca-certs
 – rsyslog
 – users-groups
 – ssh
 – restore-volume-groups
 – set-multipath-hcheck-interval
 – update-bootlist
 – reset-rmc

That is all you need to do – phew!

Part 6 – Ready your AIX for capture = good housekeeping

This is my personal PowerVC Pre-Capture Check List

  • Check the date, time & timezone
  • Check IP address & full hostname and DNS look up is working
  • Remove junk files from /tmp, /usr/tmp etc. & old or large logs & command history files
  • Set filesystem to sensible sizes like / = 1GB, /tmp=1GB
  • Remove old user accounts or unused apps / tools
  • ulimit set
  • Installed OS updates/fixes
  • Installed generally useful tools
  • Very important you know the root password
  • Very important the AIX cleanly reboots

Part 7 – Activate Cloud-Init Ready for capture

Unlike the old Activation Engine you do not need to run a command – so just orderly shutdown AIX: shutdown -Fh

The manual pages are spookily silent on this point!

 

Part 8 – Go to PowerVC and

 

 – – – The End – – –

The post PowerVC deploying AIX with Cloud-Init is fed from ReadySpace Cloud Servers. Contents strictly belongs to ReadySpace and its respective partners.

Comments are closed.