Quinta Usage

From Navigators

(Difference between revisions)
Jump to: navigation, search
(The quinta script)
Line 1: Line 1:
=== Instructions to Use Quinta, the Navigators Farm ===
=== Instructions to Use Quinta, the Navigators Farm ===
-
1) Access via SSH the front-end machine with your username:
+
1) Access the front-end machine with your username using SSH:
  $ ssh '''user'''@quinta.navigators.di.fc.ul.pt
  $ ssh '''user'''@quinta.navigators.di.fc.ul.pt
Line 38: Line 38:
  s19      on      user5            ubuntu-base      May 23, 2012    deployed
  s19      on      user5            ubuntu-base      May 23, 2012    deployed
-
3) Create a file containing all the nodes that you want to use (one node per line):
+
3) Create a file containing all nodes you want to use (one node per line):
  $ echo r1 > '''nodefile'''
  $ echo r1 > '''nodefile'''
Line 44: Line 44:
  $ echo s10 >> '''nodefile'''
  $ echo s10 >> '''nodefile'''
-
4) Verify which operating system images are available to deploy on the farm (see [[#Kaenv|kaenv3]]):
+
4) Verify which images of operating systems are available to deploy in the farm (see [[#Kaenv|kaenv3]]):
  $ kaenv3 -l -u '''user'''
  $ kaenv3 -l -u '''user'''
-
5) Deploy the image chosen on the selected machines (see [[#Kadeploy|kadeploy3]]):
+
5) Deploy the chosen image in those selected machines (see [[#Kadeploy|kadeploy3]]):
  $ kadeploy3 -e '''os-image-name''' -f '''nodefile'''
  $ kadeploy3 -e '''os-image-name''' -f '''nodefile'''
Line 58: Line 58:
  s10 (BootNewEnvClassical-umount_deploy_part: 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.
+
If you want to launch a new deployment only with the incorrect nodes, change your node file and reexecute the '''kadeploy3''' command.
6) Login into your machines:
6) Login into your machines:
  $ ssh root@s10
  $ ssh root@s10
-
7) When you have finish your experiments, turn off your machines:
+
7) Once you have finished your experiments, turn off your machines:
  $ quinta off r1 s7 s10
  $ quinta off r1 s7 s10
=== Allocation Rules ===
=== Allocation Rules ===
-
For now, there is neither scheduler nor reservation tool in the farm, therefore we ask users to follow some deployment 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.
* 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.
* 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).
* Copy everything important to your home in the front-end machine before turning off your nodes (via SCP or NFS).
 +
* Turn off all your machines after using them.
=== The quinta script ===
=== The quinta script ===
Line 96: Line 96:
==== Kaconsole ====
==== 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:
+
Kaconsole provides user 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
  $ kaconsole3 -m r1
Line 102: Line 102:
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:
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'''
  $ kadeploy3 -e '''os-image-name''' -f '''nodefile'''
 +
If you intend to deploy only one machine, you can specify it instead of providing a file with nodes:
 +
$ kadeploy3 -e '''os-image-name''' -m '''node'''
 +
If you intend to deploy a non-registered image, you can specify it as follows:
 +
$ kadeploy3 -a '''os-image-name-descriptor.dsc3''' -f '''nodefile'''
Besides the basic usage, Kadeploy allow users to run passive jobs, through a script passed as an argument:
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'''
  $ kadeploy3 -e '''os-image-name''' -f '''nodefile''' -s '''scriptfile'''
Line 108: Line 112:
==== Kaenv ====
==== Kaenv ====
-
Kaenv is designed to manage the users environments. In Quinta's case, for the time being, there are just four images:
+
Kaenv manages users' environments. In Quinta's case, for the time being, there are just five images:
  $ kaenv3 -l
  $ kaenv3 -l
  Name                Version    User      Description
  Name                Version    User      Description
Line 114: Line 118:
  debian-base        1          root      Basic Debian Lenny image.               
  debian-base        1          root      Basic Debian Lenny image.               
  debian-xen          1          root      Xen image based on Debian Lenny.         
  debian-xen          1          root      Xen image based on Debian Lenny.         
 +
ubuntu-12.04        1          root      Ubuntu 12.04 LTS image.
  ubuntu-base        1          root      Basic Ubuntu Lucid Lynx (10.04) image.
  ubuntu-base        1          root      Basic Ubuntu Lucid Lynx (10.04) image.
  ubuntu-java        1          root      Ubuntu Lucid Lynx image with Sun Java installed.
  ubuntu-java        1          root      Ubuntu Lucid Lynx image with Sun Java installed.
Kaenv allows users register their own images ([[#How to Create Your Own Images|see how to create your own image]]) to use with Ka-Tools through the following command:
Kaenv allows users register their own images ([[#How to Create Your Own Images|see how to create your own image]]) to use with Ka-Tools through the following command:
-
  $ kaenv3 -a '''descriptorfile'''
+
  $ kaenv3 -a '''descriptorfile.dsc3'''
In the same way, Kaenv allow users to delete their images, for instance:
In the same way, Kaenv allow users to delete their images, for instance:
  $ kaenv3 -d '''os-image-name'''
  $ kaenv3 -d '''os-image-name'''
==== Kanodes ====
==== 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.
+
Kanodes presents the current deployment state of nodes.
  $ kanodes3 -d
  $ kanodes3 -d
  r1,  aborted,  user, lenny-base, 1, root
  r1,  aborted,  user, lenny-base, 1, root
Line 150: Line 155:
==== Kastat ====
==== Kastat ====
-
Kastat is designed to show several statistics about the deployments.
+
Kastat shows several statistics about the deployments.
  $ kastat3 -d
  $ kastat3 -d
=== How to Create Your Own Images ===
=== 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.
+
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 Quinta cluster. The second one consists in deploying an existent environment, improving its installation or configuration and creating a new "snapshot" of this environment. In both cases it's suggested to use the TGZ-G5K script to create the snapshots.
==== The TGZ-G5K Command ====
==== 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:
+
TGZ-G5K is a script 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 there are two steps at the end:
1. Clean the interfaces rules file, to the image work in any node:
1. Clean the interfaces rules file, to the image work in any node:
Line 165: Line 170:
  $ tgz-g5k '''user'''@frontal:/.../'''os-image'''.tgz
  $ 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.
+
This command is executed inside the node 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 ====
==== The Environment Descriptor File ====

Revision as of 16:40, 12 August 2013

Contents

Instructions to Use Quinta, the Navigators Farm

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

$ 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-12.04     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      off      user1            ubuntu-base      May 23, 2012     deployed
s16      on       user1            ubuntu-12.04     May 23, 2012     deployed
s17      off      user6            ubuntu-base      May 23, 2012     deployed
s18      on       user3            ubuntu-12.04     May 23, 2012     deployed
s19      on       user5            ubuntu-base      May 23, 2012     deployed

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

$ echo r1 > nodefile
$ echo s7 >> nodefile
$ echo s10 >> nodefile

4) Verify which images of operating systems are available to deploy in the farm (see kaenv3):

$ kaenv3 -l -u user

5) Deploy the chosen image in those selected machines (see kadeploy3):

$ 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
s7 (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 reexecute the kadeploy3 command.

6) Login into your machines:

$ ssh root@s10

7) Once you have finished your experiments, turn off your machines:

$ quinta off r1 s7 s10

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.
  • Copy everything important to your home in the front-end machine before turning off your nodes (via SCP or NFS).
  • Turn off all your machines after using them.

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 command [ options ] [ hostname ... ]

commands:

  status     Show current machine power status
  update     Update the ownership of one or more machines (use with -u <username> in options)
  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 provides user 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

If you intend to deploy only one machine, you can specify it instead of providing a file with nodes:

$ kadeploy3 -e os-image-name -m node

If you intend to deploy a non-registered image, you can specify it as follows:

$ kadeploy3 -a os-image-name-descriptor.dsc3 -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 manages users' environments. In Quinta's case, for the time being, there are just five 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-12.04        1           root       Ubuntu 12.04 LTS image.
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.dsc3

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

$ kaenv3 -d os-image-name

Kanodes

Kanodes presents the current deployment state of nodes.

$ 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 shows 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 Quinta cluster. The second one consists in deploying an existent environment, improving its installation or configuration and creating a new "snapshot" of this environment. In both cases it's suggested to use the TGZ-G5K script to create the snapshots.

The TGZ-G5K Command

TGZ-G5K is a script 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 there are two steps at the end:

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 executed inside the node 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 : Author Name (Author e-mail)
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 : private

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
Navigators toolbox