Public:Using Quinta

From CloudFit

Jump to: navigation, search

Contents

Instructions to Use Quinta, the Navigators Farm

1) Access via SSH the front-end machine with your username:

$ ssh user@quinta.navigators.di.fc.ul.pt

2) Verify the power status of all machines in the farm:

$ quinta status -a
HOST     POWER    OWNER            IMAGE            SINCE            DEPLOY
r1       off      user1            ubuntu-base      May 23, 2012     deployed 
r2       on       user2            ubuntu-base      May 23, 2012     deployed 
r3       off      user1            ubuntu-java      May 04, 2012     deployed 
r4       on       user5            ubuntu-java      May 04, 2012     deployed 
r5       off      user5            ubuntu-java      May 04, 2012     deployed 
r6       on       user5            ubuntu-java      May 04, 2012     deployed 
r7       on       user1            debian-base      May 04, 2012     deployed 
r8       on       user3            ubuntu-java      May 04, 2012     deployed 
r9       on       user3            ubuntu-java      May 04, 2012     deployed  
r10      on       user1            ubuntu-java      May 04, 2012     deployed 
r12      on       user9            debian-xen       May 04, 2012     aborted  
s1       on       user8            ubuntu-java      May 04, 2012     deployed 
s2       on       user1            ubuntu-java      May 04, 2012     deployed 
s3       on       user8            ubuntu-java      May 04, 2012     deployed 
s4       on       user1            ubuntu-java      May 04, 2012     deployed 
s5       on       user9            ubuntu-java      May 04, 2012     deployed 
s6       on       user1            debian-xen       May 30, 2012     deploying 
s7       off      user7            debian-xen       May 04, 2012     deployed 
s8       off      user1            ubuntu-java      May 04, 2012     deployed 
s9       off      user3            ubuntu-java      May 04, 2012     deployed 
s10      off      user5            ubuntu-base      May 23, 2012     deployed 
s11      on       user2            ubuntu-java      May 04, 2012     deployed 
s12      on       user6            ubuntu-java      May 04, 2012     deployed 
s13      on       user7            ubuntu-java      May 04, 2012     deployed 
s14      on       user7            ubuntu-java      May 04, 2012     deployed 
s15      on       user6            ubuntu-base      May 23, 2012     deployed

3) Create a file containing all the nodes that you want to use (one node per line):

$ echo r1 > nodefile
$ echo s5 >> nodefile
$ echo s10 >> nodefile

4) Verify which operating system images are available to deploy on the farm:

$ kaenv3 -l -u user

5) Deploy the image chosen on the selected machines:

$ kadeploy3 -e os-image-name -f nodefile

At the end of the deployment, kadeploy will present which nodes were correctly deployed and which weren't. For example:

Nodes correctly deployed on cluster r
r1
Nodes not correctly deployed on cluster s
s5 (BroadcastEnvChain-send_environment: Unreachable)
s10 (BootNewEnvClassical-umount_deploy_part: Unreachable)

If you want to launch a new deployment only with the incorrect nodes, change your node file and execute kadeploy again.

Allocation Rules

For now, there is neither scheduler nor reservation tool in the farm, therefore we ask users to follow some deployment rules.

  • Only use machines that are turned off. Chances are that nobody is using them.
  • Above all, don't deploy an image on machines with the power status on. It is very likely that someone is using them.
  • Turn off all your machines after using them.
  • Copy everything important to your home in the front-end machine before turning off your nodes (via SCP or NFS).

The quinta script

We developed quinta, a simple front-end script to the ipmitool, that is used to control the computers in a cluster via IPMI (if you have any comments on the script, please tell us). The quinta script has the following usage:

  quinta [ options ] command [ hostname ... ]

commands:

  status     Show current machine power status
  reboot     Perform a soft reset of OS via ACPI
  hard       Perform a hard reset
  on         Power up the machine
  off        Power down the machine
  pxe        Set PXE as boot device
  hd         Set hard disk as boot device
  cd         Set optical driver as boot device
  wait       Wait the machine answer a ping

options:

  -a: all hosts
  -v: verbose

The Ka-Tools Commands

Kaconsole

Kaconsole is design to provide a user to access to the consoles of the nodes on which the user has deployment rights. In Quinta's case, it's just a connection via SSH to the node:

$ kaconsole3 -m r1

Kadeploy

Kadeploy is the main tool of Ka-Tools set. It's responsible by deploy a registered environment in a list of nodes chosen by users:

$ kadeploy3 -e os-image-name -f nodefile

Besides the basic usage, Kadeploy allow users to run passive jobs, through a script passed as an argument:

$ kadeploy3 -e os-image-name -f nodefile -s scriptfile

In addition, it's possible to specify a SSH-Key to be used in image's root authorized_keys, which allows users execute privileged tasks in +assive jobs:

$ kadeploy3 -e os-image-name -f nodefile -s scriptfile -k ssh-key-file

Kaenv

Kaenv is designed to manage the users environments. In Quinta's case, for the time being, there are just four images:

$ kaenv3 -l
Name                Version     User       Description
####                #######     ####       ###########
debian-base         1           root       Basic Debian Lenny image.               
debian-xen          1           root       Xen image based on Debian Lenny.        
ubuntu-base         1           root       Basic Ubuntu Lucid Lynx (10.04) image.
ubuntu-java         1           root       Ubuntu Lucid Lynx image with Sun Java installed.

Kaenv allows users register their own images (see how to create your own image) to use with Ka-Tools through the following command:

$ kaenv3 -a descriptorfile

In the same way, Kaenv allow users to delete their images, for instance:

$ kaenv3 -d os-image-name

Kanodes

Kanodes is designed to show the current deployment state of the nodes. In Quinta's case, this tool is important to know who is or was using which machine and, in proper case, ask permission to use it.

$ kanodes3 -d
r1,  aborted,   user, lenny-base, 1, root
r2,  aborted,   user, lenny-base, 1, root
r3,  aborted,   user, lenny-base, 1, root
r4,  aborted,   user, lenny-base, 1, root
r5,  aborted,   user, lenny-xen,  1, root
r6,  deployed,  user, lenny-xen,  1, root
r7,  deployed,  user, lenny-xen,  1, root
r8,  deployed,  user, lenny-base, 1, root
r9,  deployed,  user, lenny-base, 1, root
r10, deployed,  user, lenny-base, 1, root
r12, deployed,  user, lenny-base, 1, root
s1,  deploying, user, lenny-xen,  1, root
s2,  deploying, user, lenny-xen,  1, root
s3,  deploying, user, lenny-xen,  1, root
s4,  deploying, user, lenny-xen,  1, root
s5,  aborted,   user, lenny-base, 1, root
s6,  deployed,  user, lenny-base, 1, root
s7,  deployed,  user, lenny-base, 1, root
s8,  deployed,  user, lenny-base, 1, root
s9,  deployed,  user, lenny-base, 1, root
s10, deployed,  user, lenny-base, 1, root
s11, aborted,   user, lenny-base, 1, root

Kastat

Kastat is designed to show several statistics about the deployments.

$ kastat3 -d

How to Create Your Own Images

There are two main ways to create your own images in Quinta: creating a new one from scratch or improving an existent environment. In the first case you will need physical access to one Quinta machine. The second one consists in deploy an existent environment, improve its installation or configuration and create a new "snapshot" of this environment. In both cases its suggested to use the TGZ-G5K script to create the snapshots.

The TGZ-G5K Command

TGZ-G5K is a script intended to create system deployment images that don't posses site-flavours. In Quinta's case you can deploy any existent image in one machine, install new software, configure others and at the end, there are two steps:

1. Clean the interfaces rules file, to the image work in any node:

$ echo "" > /etc/udev/rules.d/70-persistent-net.rules

2. Create your own image with tgz-g5k command:

$ tgz-g5k user@frontal:/.../os-image.tgz

This command is called inside of the node that you want to make the "snapshot" and will create a TGZ file with your environment on your home in front-end machine.

The Environment Descriptor File

To register your new environment and make it deployable, do you need an image descriptor file, which can be similar to:

name : debian-base
version : 1
description : Basic Debian Lenny image.
author : Vinicius Vielmo Cogo (vielmo@lasige.di.fc.ul.pt)
tarball : /home/deploy/images/debian-base.tgz|tgz
postinstall : /home/deploy/postinstalls/post4all.tgz|tgz|traitement.ash
kernel : /boot/vmlinuz-2.6.32-bpo.2-amd64
initrd : /boot/initrd.img-2.6.32-bpo.2-amd64
fdisktype : 83
filesystem : ext3
environment_kind : linux
visibility : public

Further Information

For further information about the tools used in this tutorial, please visit their sites or their documentations:

Ka-Tools: oficial installation, configuration and use guide.

TGZ-G5K documentation in Grid'5000 Wiki

Download TGZ-G5K files

Personal tools