OpenStack Lab — Part 1: xCAT

Before I start, the contents of all files mentioned in this blog are available at (https://gitlab.arif-ali.co.uk/arif/openstack-lab). Also my assumption is that you would have some knowledge of most of the components in OpenStack. Finally, this will be in a few parts so that there’s not as much to take on

Over the past few months, I have been evaluating OpenStack, and trying a few things in a Proof of Concept(PoC) environment, to see how we can use this in the future. I came through many challenges and hurdles, but finally I got the core components working recently.

I first started working OpenStack in October 2013, evaluating at the time the Havana release, and decided that I would go through the manual process of defining the OpenStack environment. This proved very challenging to say the least, although I managed to get it working mostly as a 2 node Controller/Nova setup

With work getting busy, the PoC got distracted, and therefore having a 6 month gap. I then discovered RDO, and decided to use this for my new environment with CentOS 7 and 9 physical machines.

My environment includes the first physical machine (stackmaster) to be my provisioning machine, which uses xCAT 2.8.5, which is an OpenSource provisioning system developed and maintained by IBM. I will assume, that a basic installation of xCAT is done as per the Quick Start Guide

The hostnames/IPs I will be using are listed below

[table id=1 /]

So the initial stage was to synchronise the repositories that I was going to need, for example my environment being CentOS 7, I needed the following repositories downloaded

The base repository for CentOS 7 was done automatically by the `copycds` command in xCAT, so we didn’t need to worry about that one, this is usually found in `/install/centos7.0/x86_64`

A new directory was created on stackmaster in `/install/post/otherpkgs/repos`. We synchronised the repositories, using the `reposync` command, this required `.repo` files located in an arbitrary directory. We decided that to be `/etc/reposync.repos.d`. We need yum.conf that points to new directory, so copying `/etc/yum.conf` to `/etc/reposync.repos.d/yum.conf`, with the relevant  changes, i.e. the `reposdir` variable to be changed to `/etc/reposync.repos.d`

A new script in `/install/post/otherpkgs/repos/createrepo.sh` was created that synchronised the repos, and runs the `createrepo` command to create yum repositories. *Note* if you don’t have the bandwidth, and the space, don’t do this, as this may take a few hours to days, depending on your connection. The total space required for this is approx 17G.

For the purpose of xCAT, we created the following symlinks in `/install/post/otherpkgs/el7`

cd /install/post/otherpkgs/el7
ln -s ../repos/epel-7 epel
ln -s ../repos/extras-7 extra
ln -s ../repos/puppet-7 puppet
ln -s ../repos/rdo-openstack-epel-7 rdo-openstack
ln -s ../repos/rdo-openstack-juno-epel-7 rdo-openstack-juno
cd /install/centos7.0/updates/
ln -s ../../post/otherpkgs/repos/updates-7 x86_64

The osimages from the repo can be downloaded, which in turn can be added to xCAT by using the following command.

cat c7-os.osimage | chdef -z

To confirm that the osimage has been imported correctly, you can run the following command

[root@stackmaster ~]# lsdef -t osimage c7-os
Object name: c7-os
    imagetype=linux
    osarch=x86_64
    osname=Linux
    osvers=centos7.0
    otherpkgdir=/install/post/otherpkgs/el7
    otherpkglist=/install/templates/c7-os/controller.otherpkgs.pkglist
    partitionfile=/install/templates/c7-os/controller.partfile
    pkgdir=/install/centos7.0/x86_64,/install/centos7.0/updates/x86_64
    pkglist=/install/templates/c7-os/controller.pkglist
    postbootscripts=setup_extnw -n stack_pub,configOvsBridge bridgeprereq enp2s1f1:br-ex,packstack-openstack,add_glance_images
    postscripts=confignics,hardeths
    profile=controller
    provmethod=install
    synclists=/install/templates/c7-os/controller.synclist
    template=/install/templates/c7-os/common.tmpl

Then we create the directory required for the templates

mkdir /install/templates

then copy the contents of the xcat directory to `/install/templates`, the contents looking like below

./c6-os
./c6-os/controller.pkglist
./c6-os/controller.partfile
./c6-os/nova.pkglist
./c6-os/nova.otherpkgs.pkglist
./c6-os/nova.partfile
./c6-os/controller.otherpkgs.pkglist
./c7-os
./c7-os/nova.juno.otherpkgs.pkglist
./c7-os/common.tmpl
./c7-os/controller.pkglist
./c7-os/controller.partfile
./c7-os/nova.pkglist
./c7-os/nova.otherpkgs.pkglist
./c7-os/controller.juno.otherpkgs.pkglist
./c7-os/nova.partfile
./c7-os/controller.otherpkgs.pkglist

Once the files have been synchronised, we can install the controller node, by running the following command

rinstall stack01 -O c7-os

The node should take approximately 20 mins to install. This should install the base OS with all the updates for the OS, and then finally after boot it will install all the openstack packages defined in the `controller.otherpkgs.pkglist`.

We will look at installing and configuration of Packstack in the next part. Stay Tuned.

If you have any questions or comments, then you can contact me on IRC arif-ali at freenode

Leave a Reply

Your email address will not be published.