Difference between revisions of "Installing a new VM via Quattor"

From PDP/Grid Wiki
Jump to navigationJump to search
Line 28: Line 28:
 
  object template stremsel.nikhef.nl;
 
  object template stremsel.nikhef.nl;
 
   
 
   
  include { 'site/hwdb' };
+
  variable GLITE_VERSION = 'glite-3.2';
"/hardware" = hwinstance("xen_i686", nlist(
 
                                "eth0","00:16:3E:AB:61:1C",
 
                ) );
 
 
   
 
   
 
variable NODE_VM_GUEST  = "xen";
 
 
  include { 'machine-types/cream-ce' };
 
  include { 'machine-types/cream-ce' };
 
   
 
   
  # where to get all RPMs, must be last
+
  '/hardware' = hwparams(  nlist( 'eth0', '00:16:3E:AB:61:1C', ) );
  include { 'repository/config' };
+
 
 +
  include { 'machine-types/post-config' };
  
Note the variable NODE_VM_GUEST.
 
 
== Registering the machine in the hardware datbase ==
 
== Registering the machine in the hardware datbase ==
 
Locate the template conf/cfg/sites/ndpf/site/hwdb.tpl.
 
Locate the template conf/cfg/sites/ndpf/site/hwdb.tpl.

Revision as of 11:02, 19 August 2010

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/hwdb.tpl. Make an entry for your new machine:

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

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':

   "bats",     list('hark', 'grasveld', 'graszode', 'erf'),

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

   "bats",     list('hark', 'grasveld', 'graszode', 'erf', 'stremsel'),

Specify the parameters of the virtual machine

Locate the file conf/cfg/sites/ndpf/site/xen.tpl. Here you need to enter the parameters that specify the VM, such as how much disk, RAM, etc.

   'stremsel', 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

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                                        2     2047     2 -b----    593.0
grasveld                                   5     1023     1 -b----    227.2
graszode                                   3     4095     2 -b----   1261.6
hark                                       4      479     1 -b----    424.8
stremsel                                   6     2047     1 ---s--     62.3

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

xm destroy stremsel
xm create stremsel

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.