Installing a new VM via Quattor

From PDP/Grid Wiki
Revision as of 12:35, 16 June 2012 by Davidg@nikhef.nl (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This information is no longer actual, please refer to GSP_Virtualisation_with_Xen for current configuration and install information.

Overview

Many of our grid services are run on virtual machines. When installing a virtual machine for the first time with quattor, a few steps are different than for installing a real physical machine. This guide tells you how to do it. It does so by documenting what was done to create the CREAM CE, 'stremsel'.

You should be familiar with quattor basics before starting, see How_to_work_with_our_Quattor_setup.

Making a template

Note, all directories specified are relative to the trunk of nl.nikhef.ndpf.quattor-config in our SVN repository.

In conf/cfg/clusters/prd/profiles, make a new template. In this case, stremsel.nikhef.nl.tpl.

As specified in the page Xen on CentOS 5, we construct a MAC address for the new machine, which is one of the things that needs to go in this template, via the last three components of the IP address.

IP address : 194.171.97.28 so the last three components are 171, 97, 28

simeto:~> python -c 'print "00:16:3e:%02x:%02x:%02x" % (171,97,28)'
00:16:3e:ab:61:1c

Here is the complete template:

############################################################
#
# OBJECT template stremsel.nikhef.nl
#
# RESPONSIBLE: Jeff Templon@nikhef.nl
#
############################################################

object template stremsel.nikhef.nl;

variable GLITE_VERSION = 'glite-3.2';

include { 'machine-types/cream-ce' };

'/hardware' = hwparams(  nlist( 'eth0', '00:16:3E:AB:61:1C', ) );

include { 'machine-types/post-config' };

Registering the machine in the hardware datbase

Locate the template conf/cfg/sites/ndpf/site/databases.tpl. Make two entries for your new machine. One to define the host name to IPv4 address mapping:

escape("stremsel.nikhef.nl"),"194.171.97.28",

and one to define the hardware type, in this case a Xen virtual machine:

escape("stremsel.nikhef.nl"),"hardware/machine/xen/base",

Tell the system on which physical Xen server your VM will be hosted

Locate the template conf/cfg/sites/ndpf/site/xen/db.tpl. In this file, locate the line for the host on which you wish to run your virtual machine. In our case it is 'bats'. Note that the guests are now addressed by their fully qualified domain name:

   "bats",     list('graszode.nikhef.nl', 'erf.nikhef.nl'),

the name 'stremsel.nikhef.nl' needs to be added to this list, so it becomes

   "bats",     list('graszode.nikhef.nl', 'erf.nikhef.nl', 'stremsel.nikhef.nl'),

Specify the parameters of the virtual machine

Locate the file conf/cfg/sites/ndpf/site/xen/guest-properties.tpl. Here you need to enter the parameters that specify the VM, such as how much disk, RAM, etc. Again, you must use the FQDN of the machine:

   'stremsel.nikhef.nl', nlist(
       'ram', 2048,
       'cpu', 1,
       'mac', '00:16:3E:AB:61:1C',
       'harddisks', nlist('xvda', 20*GB, 'xvdb', 60*GB) ),

Actually installing the VM

First the compiled profile for the VM itself needs to exist; then AII has to be told that it needs to be installed; then the VM host machine needs to be reconfigured so that the VM exists and is created.

The following sequence will do it. From stal as ndpfmgr, in this order:

pushxprof -f prd stremsel
sudo /usr/sbin/aii-shellfe --configure stremsel.nikhef.nl --install stremsel.nikhef.nl
pushxprof -f vmhost bats

Now if you log into the VM host bats (you have to go thru salado!) you can do a

xm list

and if everything has worked, you will see your VM. There is one more step to go: at some point, the VM will hang. You can see this either by doing

xm console stremsel.nikhef.nl

and once you see "rebooting system" it is hung (get out of the console via ctrl-]), or you can see it via 'xm list', the output of which looks like

[root@bats ~]# xm list
Name                                      ID Mem(MiB) VCPUs State   Time(s)
Domain-0                                   0      400     1 r-----    200.0
erf.nikhef.nl                              2     2047     2 -b----    593.0
grasveld.nikhef.nl                         5     1023     1 -b----    227.2
graszode.nikhef.nl                         3     4095     2 -b----   1261.6
hark.nikhef.nl                             4      479     1 -b----    424.8
stremsel.nikhef.nl                         6     2047     1 ---s--     62.3

Note the 's' for stremsel, which means it's hung. Then do

xm destroy stremsel.nikhef.nl
xm create stremsel.nikhef.nl

After waiting a while, it will happen again (the hang), and then you will need to do this sequence again. Then your installation should complete according to whatever you specified in your quattor template.