Difference between revisions of "Installing a new VM via Quattor"
Line 41: | Line 41: | ||
Note the variable NODE_VM_GUEST. | Note the variable NODE_VM_GUEST. | ||
+ | == 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) ), |
Revision as of 15:34, 19 January 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; include { 'site/hwdb' }; "/hardware" = hwinstance("xen_i686", nlist( "eth0","00:16:3E:AB:61:1C", ) ); variable NODE_VM_GUEST = "xen"; include { 'machine-types/cream-ce' }; # where to get all RPMs, must be last include { 'repository/config' };
Note the variable NODE_VM_GUEST.
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) ),