-
Notifications
You must be signed in to change notification settings - Fork 1
TUTORIAL: OpenStack Ready Image CentOS6
#Building OpenStack Ready Images: CentOS6 ##Prerequisites
##Using build machine to craft image To begin creating the OpenStack-ready-image, SSH to the previously created build machine with X forwarding enabled:
$ ssh -X user@floatingip
##Building a base CentOS6 image To prepare a base CentOS6 image, we will use libvirt virtualization API together with KVM, installing from public mirrors with default known-working settings. To begin the installation process, run:
virt-install --connect=qemu:///system \
--network=bridge:virbr0 \
--name=centos6.6 \
--disk path=/var/lib/libvirt/images/centos6.6.qcow2,format=qcow2,size=10,cache=none \
--ram 1024 \
--vcpus 1 \
--check-cpu \
--accelerate \
--os-type linux \
--location=http://mirror.i3d.net/pub/centos/6/os/x86_64/
Note: some distributions (e.g. Ubuntu 14) require the disk image to exist, an image can be allocated using:
qemu-img create -f qcow2 /path/to/store/vm.qcow2 8G

The installation process will begin and provide the user with a virt-viewer window providing the graphical installation method. Follow the installation procedure in the virt-viewer window, our default recommended settings are:
| Option | Recommended setting |
|---|---|
| 1. Language settings | Users preference |
| 2. Keyboard type | Users preference |
| 3. Configure TCP/IP |
Enable IPv4 support -> Dynamic IP configuration (DHCP), Enable IPv6 support -> Automatic
|
| 4. Storage devices | Basic Storage Devices |
| 5. Storage device warning | Yes, discard any data |
| 6. Hostname | Default, hostname is changed via cloud-init |
| 7. Time zone | User preference, or default setting |
| 8. Root password | User preference |
| 9. Storage partitions | Use all space |
| 10. Storage warning | Write changes to disk |
| 11. Installation type | Basic Server |
| 12. Completion | Reboot |
####Post-installation
Once installation is complete, the console will provide a login prompt - log in using either the root account or the previously made user account and set password.
#####Configuration tasks ######Install required packages To prepare the image for use in a Cloud environment, we will need to install several packages:
$ yum install -y epel-release
$ yum install -y cloud-init git cloud-utils-growpart
######Configure console
CentOS-6.X images require a change to the /boot/grub/menu.lst file to enable console access through the Horizon GUI. Append the following to the kernel line:
console=tty0 console=ttyS0,115200n8

######Enable growpart
During the libvirt installation process, we created a QCOW2 disk file with 10GB allocated. To enable automatic resizing of the root partition when using OpenStack Nova flavors with a lower or higher ephemeral disk size, we need to adjust the /etc/cloud/cloud.cfg configuration file. Append the following to the /etc/cloud/cloud.cfg to use the cloud-init growpart utility:
growpart:
mode: auto
devices: ['/']
ignore_growroot_disabled: false
To ensure correct resizing of root partition on boot, install the following:
$ cd /tmp/
$ git clone https://github.com/flegmatik/linux-rootfs-resize.git
$ cd linux-rootfs-resize
$ ./install
#####Image customisation Once the appropriate configuration tasks have been completed - any customisations to the image can be performed including package and application installations or data transfers and storage of datasets for later use by fellow researchers.
######Clusterware application installation
Alces provide free use of the Clusterware set of Linux tools for installation of applications using our Gridware project, hosting hundreds of Linux module files ready for use. To get started using the Alces Clusterware tools and install an application, run the following:
$ curl -sL http://git.io/clusterware-installer | sudo alces_OS=el6 /bin/bash
$ alces gridware list # view available packages
$ alces gridware inst apps/memtester/4.3.0 # install the memtester application
Once the installation is complete, verify successful installation of your application - for example:
$ module load apps/memtester
$ memtester 4096 4
#Image preparation Following any required customizations, please continue to the image preparation tasks section.
Copyright (c) 2008-2015 Alces Software Ltd