Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1...

43

Transcript of Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1...

Page 1: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

Kadeploy 3: Installation, con�guration and use

October 11, 2010

Page 2: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

1

Copyright c©by INRIA, Emmanuel Jeanvoine, [email protected] 2008-2010KADEPLOY 3.1, CECILL 2.0 license, All rights reserved.

Page 3: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

Contents

1 Installation 31.1 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.1.1 Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.1.2 DHCP and TFTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.1.3 HTTP server (optional) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.1.4 MySql . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.2 Kadeploy installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.2.1 Basic installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.2.2 Debian packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.2.3 Fedora packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.3 Launching the Kadeploy server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.3.1 Automatic launch on a Debian and a Fedora based distribution . . . . . . . . 6

2 Server side con�guration 72.1 General con�guration �le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.1.1 Example of a general con�guration �le . . . . . . . . . . . . . . . . . . . . . . 72.1.2 Explanation of the �elds used in the general con�guration �le . . . . . . . . . 8

2.2 Cluster-speci�c con�guration �les . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2.1 Example of a cluster-speci�c con�guration �le . . . . . . . . . . . . . . . . . . 112.2.2 Explanation of the �elds used in the cluster-speci�c con�guration �le . . . . . 12

2.3 Clusters �le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.4 Partition map �les . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.5 Nodes con�guration �les . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.6 Speci�c commands con�guration �les . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.7 Deployment environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2.7.1 Con�guration of the production environment . . . . . . . . . . . . . . . . . . 182.7.2 Creation of the dedicated environment . . . . . . . . . . . . . . . . . . . . . . 182.7.3 Creation of the NFSRoot environment . . . . . . . . . . . . . . . . . . . . . . 19

2.8 Con�guration of the deploy user . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3 Client side con�guration 20

2

Page 4: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CONTENTS 3

4 User guide 214.1 Overview of the Kadeploy tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

4.1.1 Kadeploy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.1.2 Kareboot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.1.3 Kaenv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.1.4 Kaconsole . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.1.5 Kastat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.1.6 Kanodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.1.7 Kapower . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.1.8 Karights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

4.2 Use the Kadeploy tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224.2.1 Kadeploy server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224.2.2 Kadeploy client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224.2.3 Kareboot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264.2.4 Kaenv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284.2.5 Kaconsole . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324.2.6 Kastat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324.2.7 Kanodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344.2.8 Kapower . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354.2.9 Karights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

4.3 What you should know if you want to do kernel development on deployed nodes . . 374.3.1 Kadeploy 3 behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374.3.2 Tips to simply use your new kernel . . . . . . . . . . . . . . . . . . . . . . . . 38

4.4 Migrate your Kadeploy 2.1.x environment . . . . . . . . . . . . . . . . . . . . . . . . 394.5 Environment variables in the pre- and post-install context . . . . . . . . . . . . . . . 404.6 Build a custom pre-install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

Page 5: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

Chapter 1

Installation

1.1 Requirements

1.1.1 Packages

Kadeploy requires the following softwares (the Debian packages available in the Lenny �avor aregiven):

• ruby1.8

• mysql-ruby1.8

• bittorrent

• ctorrent

• taktuk >= 3.6

1.1.2 DHCP and TFTP

A DHCP server (dhcp3-server on Debian for instance) must be con�gured to provide a static IPaddress to the set of nodes that must be deployed. Furthermore, the DHCP response must containsthe hostname of the node (see the use-host-decl-names on; option in dhcpd.conf).

A TFTP server (tftpd-hpa on Debian for instance) must be installed.To allow the network booting, you must specify in the DHCP con�guration �le the �le name

option that de�ne the �le retrieve by a client. This �le name can be pxelinux.0 or gpxelinux.0.Finally, the TFTP repository (see 2.1 part) must contain the following �les: pxelinux.0 (or

gpxelinux.0), chain.c32, and mboot.c32. These �les can be found in the Syslinux software (http://syslinux.zytor.com), the 3.73 version is at least required.

1.1.3 HTTP server (optional)

In order to use the HTTP fetching capabilities of gpxelinux, an HTTP server must be con�g-ured and must contain the production environment kernel/initrtd and the deployment environmentkernel/initrd (see 2.2 part).

4

Page 6: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 1. INSTALLATION 5

1.1.4 MySql

A MySql server must be con�gured with a database and a user dedicated to Kadeploy. The rightson this database must be granted to the chosen user, from the Kadeploy server. The server usedto host the database, the database name, the dedicated user and its password must be speci�ed inthe general Kadeploy con�guration (see 2.1 part).

Just provided as an example, let's see a way to create the database deploy3 and to give thesuitable rights to the deploy user.

mysql> CREATE DATABASE deploy3;

mysql> GRANT select, insert, update, delete, create, drop, alter, \

create temporary tables, lock tables ON deploy3.* \

TO 'deploy'@'frontale.site.grid5000.fr';

Once the database is created and the user granted, you can use the SQL script provided in thedistribution (db/db_creation.sql) to create the tables in the database.

1.2 Kadeploy installation

Since Kadeploy is based on a client/server architecture, you must perform the install on both theserver and the client if it is not the same machine.

Two ways are provided to install Kadeploy, a basic installer and packages (for Debian andFedora). In both cases, you had to ensure that a user deploy is existing on your system. Thisuser is used to execute the Kadeploy server. Furthermore, all the installation operations must beperformed with root rights.

1.2.1 Basic installation

First of all , you have to uncompress the Kadeploy tarball.

> tar xzf kadeploy-3.1-3.tar.gz -C DESTINATION_DIR

Then, if you want to install the server part, just execute:

> make install_common

> make install_server

If you want to install the client part, execute:

> make install_common

> make install_client

If you want to install the server part and the client part on the same host, execute:

> make install_all

If you want to install the rc script, you can add the DISTRIB �ag. Currently, only Debian (itincludes Ubuntu at least) and Fedora (it should include CentOS and RHEL) values are supported.For instance, you cans execute:

> make install_all DISTRIB=fedora

Page 7: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 1. INSTALLATION 6

or if you do not install the server side on the same machine than the client side:

> make install_server DISTRIB=fedora

In order to preserve a previous con�guration, the con�guration directory /etc/kadeploy3 is saved,if existing, to a directory named /etc/kadeploy3-save-TIMESTAMP where TIMESTAMP is the momentof the new installation launch.Finally, Kadeploy can be simply uninstalled by executing:

> make uninstall

In case of uninstallation, the con�guration directory /etc/kadeploy3 is not removed.

1.2.2 Debian packages

The following installation method works only an Debian based distribution.

Build

First, you have to uncompress the Kadeploy tarball.

> tar xzf kadeploy-3.1-3.tar.gz -C DESTINATION_DIR

Then you must generate the packages. So you have to execute:

> make deb

This will generate three Debian package: kadeploy-common-3.1-3.deb,kadeploy-client-3.1-3.deb, and kadeploy-server-3.1-3.deb.

Installation

On the server side, you have to install the kadeploy-common-3.1-3.deb andkadeploy-server-3.1-3.deb packages.

> dpkg -i kadeploy-common-3.1-3.deb

> dpkg -i kadeploy-server-3.1-3.deb

On the client side, you have to install the kadeploy-common-3.1-3.deb andkadeploy-client-3.1-3.deb packages.

> dpkg -i kadeploy-common-3.1-3.deb

> dpkg -i kadeploy-client-3.1-3.deb

In the want to use the same host for the client and the server part, just install the three packages:

> dpkg -i kadeploy-common-3.1-3.deb

> dpkg -i kadeploy-client-3.1-3.deb

> dpkg -i kadeploy-server-3.1-3.deb

Warning In order to preserve your con�guration �les, the removal of a Kadeploy package willpreserve the con�guration �les (unless you specify the �purge tag).

Page 8: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 1. INSTALLATION 7

1.2.3 Fedora packages

The following installation method works only an Fedora based distribution. We assume that youhave a con�gured rpm build environment. Furthermore, Taktuk must be installed on the serverside.

Build

First, you have to uncompress the Kadeploy tarball.

> tar xzf kadeploy-3.1-3.tar.gz -C DESTINATION_DIR

Then you must generate the packages. So you have to execute with root rights:

> make rpm

This will generate three rpm package in the RPMS package of your build environment,for instance: kadeploy-client-3.1-3.noarch.rpm, kadeploy-server-3.1-3.noarch.rpm, andkadeploy-common-3.1-3.noarch.rpm.

Installation

On the server side, you have to install the kadeploy-common-3.1-3.noarch.rpm andkadeploy-server-3.1-3.noarch.rpm packages.

> rpm -i kadeploy-common-3.1-3.noarch.rpm

> rpm -i kadeploy-server-3.1-3.noarch.rpm

On the client side, you have to install the kadeploy-common-3.1-3.noarch.rpm andkadeploy-client-3.1-3.noarch.rpm packages.

> rpm -i kadeploy-common-3.1-3.noarch.rpm

> rpm -i kadeploy-client-3.1-3.noarch.rpm

In the want to use the same host for the client and the server part, just install the three packages:

> rpm -i kadeploy-common-3.1-3.noarch.rpm

> rpm -i kadeploy-server-3.1-3.noarch.rpm

> rpm -i kadeploy-client-3.1-3.noarch.rpm

1.3 Launching the Kadeploy server

After being installed and con�gured, the Kadeploy server can be run either interactively:

> /usr/sbin/kadeploy3d

or in background using the rc script:

> /etc/init.d/kadeploy3d start

1.3.1 Automatic launch on a Debian and a Fedora based distribution

On a these distributions, if you use the provided packages, the rc script will be automaticallylaunched at the startup.

Page 9: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

Chapter 2

Server side con�guration

Normally, the con�guration of Kadeploy is located in /etc/kadeploy3 but it can be located any-where else if you set the KADEPLOY_CONFIG_DIR variable in the environment.

The �le load_kadeploy_env in the con�guration directory contains the KADEPLOY_INSTALL_DIRvariable. You should probably �ll this variable with the Kadeploy installation directory you used.This directory can be anywhere in the �lesystem.

2.1 General con�guration �le

The general con�guration �le is named conf and is located in the Kadeploy con�guration directory.

2.1.1 Example of a general con�guration �le

verbose_level = 3

tftp_repository = /var/lib/tftpboot/PXEClient

tftp_images_path = images

tftp_images_max_size = 4000

tftp_cfg = pxelinux.cfg

db_kind = mysql

deploy_db_host = mysql

deploy_db_name = deploy3

deploy_db_login = deploy_user

deploy_db_passwd = deploy_password

rights_kind = db

taktuk_connector = ssh -q -o StrictHostKeyChecking=no \

-o UserKnownHostsFile=/dev/null \

-o PreferredAuthentications=publickey \

-o BatchMode=yes -i /etc/kadeploy3/keys/id_deploy

taktuk_tree_arity = 0

taktuk_auto_propagate = false

tarball_dest_dir = /tmp

environment_extraction_dir = /mnt/dest

kadeploy_server = fgdx2.orsay.grid5000.fr

8

Page 10: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 2. SERVER SIDE CONFIGURATION 9

kadeploy_server_port = 25300

kadeploy_tcp_buffer_size = 8192

kadeploy_cache_dir = /tmp/kadeploy_cache

kadeploy_cache_size = 20000

max_preinstall_size = 30

max_postinstall_size = 30

ssh_port = 22

test_deploy_env_port = 25300

use_rsh_to_deploy = false

log_to_file = /tmp/kadeploy.log

log_to_syslog = true

log_to_db = true

dbg_to_syslog = false

dbg_to_syslog_level = 4

reboot_window = 100

reboot_window_sleep_time = 10

nodes_check_window = 90

bootloader = chainload_pxe

purge_deployment_timer = 900

rambin_path = /rambin

mkfs_options = ext2@-b 4096 -O sparse_super,filetype,resize_inode,dir_index|\

ext3@-b 4096 -O sparse_super,filetype,resize_inode,dir_index

demolishing_env_threshold = 2

demolishing_env_auto_tag = false

bt_tracker_ip = 172.24.100.2

bt_download_timeout = 1800

almighty_env_users = root,ejeanvoine

async_end_of_deployment_hook = echo WORKFLOW_ID

async_end_of_reboot_hook = echo REBOOT_ID

async_end_of_power_hook = echo POWER_ID

vlan_hostname_suffix = -kavlan-VLAN_ID

set_vlan_cmd = kavlan NODES -s -i VLAN_ID -u USER

2.1.2 Explanation of the �elds used in the general con�guration �le

Each line of the con�guration �le must follow the pattern: key = value (note that the spacesaround the = are mandatory.

• verbose_level: number between 0 and 4 that speci�es the default verbose level for the client.0 means �no verbose� and 4 means �full verbose�.

• tftp_repository: absolute path of the TFTP repository.

• tftp_images_path: relative path of the TFTP image sub-repository.

• tftp_images_max_size: maximal size in MB of the TFTP image repository. Warning, as faras the Kadeploy server is launched by the deploy user, deploy must have the rights to readin this directory.

Page 11: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 2. SERVER SIDE CONFIGURATION 10

• tftp_cfg: relative path of the TFTP con�guration repository. Warning, as far as the Kade-ploy server is launched by the deploy user, deploy must have the rights to write in thisdirectory.

• db_kind: database kind (only mysql is available now).

• deploy_db_host: hostname of the database.

• deploy_db_name: name of the Kadeploy database.

• deploy_db_login: login for the Kadeploy database.

• deploy_db_passwd: password for the Kadeploy database.

• rights_kind: authentication kind (use db for a true rights management or dummy to bypassthe rights management).

• taktuk_connector: connector used by Taktuk.

• taktuk_tree_arity: Taktuk tree arity for command executed through a tree. Use 0 if youwant to use the work stealing algorithm of Taktuk and thus a dynamic tree arity. Use anothervalue >0 to specify a static tree arity (should be avoided).

• taktuk_auto_propagate: use of the auto propagation feature of Taktuk (expected values aretrue or false). You should use this feature if the deployment environment doesn't containTaktuk.

• tarball_dest_dir: destination directory for the tarball download in the deployment envi-ronment. This is used when the tarballs are sent with Bittorrent .

• environment_extraction_dir: extraction directory for the tarball in the deployment envi-ronment.

• kadeploy_server: hostname of the Kadeploy server.

• kadeploy_server_port: port of the Kadeploy server.

• kadeploy_tcp_buffer_size: TCP bu�er size for the Kadeploy �le server.

• kadeploy_cache_dir: absolute path of the Kadeploy cache. The cache dir is used to storethe �les of a user in a deployment. It is possible to disable the use of a cache by settingno_cache to this �eld.

• kadeploy_cache_size: size in MB of the Kadeploy cache.

• max_preinstall_size: maximum size in MB of the preinstall �les.

• max_postinstall_size: maximum size in MB of the postinstall �les.

• ssh_port: port used by SSH

• test_deploy_env_port: port used as a tag in the deployment environment to ensure thatthe deployment environment is successfully booted.

Page 12: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 2. SERVER SIDE CONFIGURATION 11

• use_rsh_to_deploy: use rsh in the deployment work�ow (expected values are true or false).

• log_to_file: absolute path of a �le that will contain the log information. If you do not wishto use a log �le, leave this �eld empty.

• log_to_syslog: use Syslog to export the log information (expected values are true or false).The Syslog tag is �Kadeploy-log�.

• log_to_db: use the Kadeploy database to export the log information (expected values aretrue or false).

• dbg_to_syslog: use Syslog to export the debug information (expected values are true orfalse). The Syslog tag is �Kadeploy-dbg�.

• dbg_to_syslog_level: debug level of the output exported to Syslog.

• reboot_window: global size of the reboot window (ie. maximum number of nodes able toreboot at the same time). This might be useful to avoid high electricity peak.

• reboot_window_sleep_time: time to wait if the reboot window is full.

• nodes_check_window: size of the nodes check window.

• bootloader: kind of bootloader used to boot the deployed nodes (expected values are chain-load_pxe and pure_pxe).

• purge_deployment_timer: timeout used to consider that a deployment is �nished. This isused to avoid several deployment on the same nodes at the same time.

• rambin_path: path of the ramdisk directory in the deployment environment (/rambin seemsto be a good value).

• mkfs_options: options for mkfs. The options for several FS can be de�ned here with thefollowing syntax: fstype1@options|fstype2@options|... (no newline is expected)

• demolishing_env_threshold: maximum number of reboot failures (on the production envi-ronment) before considering that an environment is demolishing.

• demolishing_env_auto_tag: specify if Kareboot must tag automatically an environment asdemolishing after a failed reboot on the production environment.

• bt_tracker_ip: ip of the Bittorrent tracker.

• bt_download_timeout: timeout for the Bittorrent �le download.

• almighty_env_users: list of users allowed to perform special operations on the environmentslike publishing environments or moving �les.

• async_end_of_deployment_hook: command to launch at the end of an asynchronous deploy-ment. The WORKFLOW_ID can be used in the command, it is replaced at the runtime.

• async_end_of_reboot_hook: command to launch at the end of an asynchronous reboot. TheREBOOT_ID can be used in the command, it is replaced at the runtime.

Page 13: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 2. SERVER SIDE CONFIGURATION 12

• async_end_of_power_hook: command to launch at the end of an asynchronous power oper-ation. The POWER_ID can be used in the command, it is replaced at the runtime.

• vlan_hostname_suffix: this speci�es the su�x to add to the hostname to de�ne the host-name in the given VLAN. The pattern VLAN_ID can be used in the de�nition, it is replacedat the runtime.

• set_vlan_cmd: command to launch in orded to put a set of nodes in a VLAN. The patternsNODES, USER and VLAN_ID can be used.

2.2 Cluster-speci�c con�guration �les

To de�ne the speci�c con�guration of a cluster, you must create a speci�c �le for each cluster inthe con�guration directory. The name of the �le must be specific_conf_CLUSTER where CLUSTERis the cluster name.

2.2.1 Example of a cluster-speci�c con�guration �le

deploy_kernel = http://172.24.100.1/kadeploy/deploy-vmlinuz-2.6.27.8-bt

deploy_initrd = http://172.24.100.1/kadeploy/deploy-initrd-2.6.27.8-bt \

ETH_DRV=tg3 ETH_DEV=eth0 DISK_DRV=sata_svw SLEEP_TIME=5\

console=tty0 console=ttyS0,38400n8 ramdisk_size=260000 rw init=/linuxrc

block_device = /dev/sda

prod_part = 2

deploy_part = 3

tmp_part = 5

swap_part = 1

timeout_reboot_classical = 200 + 150 * Math.log(n)

timeout_reboot_kexec = 60

cmd_soft_reboot = ssh -q -o BatchMode=yes -o StrictHostKeyChecking=no \

-o PreferredAuthentications=publickey \

-o ConnectTimeout=2 -o UserKnownHostsFile=/dev/null \

-i /etc/kadeploy3/keys/id_deploy root@HOSTNAME_FQDN /sbin/reboot

cmd_hard_reboot = /usr/local/kadeploy/bin/reboot.rb HOSTNAME_SHORT

cmd_very_hard_reboot = /usr/local/kadeploy/bin/reboot_RSA.exp HOSTNAME_SHORT

cmd_console = /usr/local/kadeploy/bin/console HOSTNAME_SHORT

#cmd_soft_power_on =

#cmd_hard_power_on =

#cmd_very_hard_power_on =

#cmd_soft_power_off =

#cmd_hard_power_off =

#cmd_very_hard_power_off =

#cmd_power_status =

drivers = ata_piix,ata_generic

kernel_params = console=tty0 console=ttyS1,38400n8

pxe_header = PROMPT 1\nSERIAL 0 38400\nDEFAULT bootlabel\nDISPLAY messages\nTIMEOUT 50\n\nlabel bootlabel\n

nfsroot_kernel = deploy-vmlinuz-2.6.27.7-nfsroot

nfsroot_params = rw console=ttyS0,38400n8 console=tty0 root=/dev/nfs ip=dhcp nfsroot=172.24.120.35:/mnt/nfsroot/rootfs init=/sbin/init

Page 14: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 2. SERVER SIDE CONFIGURATION 13

partition_creation_kind = fdisk

admin_pre_install = /g5k/admin_pre_install.tgz|tgz|launch.sh

admin_post_install = /g5k/admin_post_install.tgz|tgz|launch.sh

#Automata description

macrostep = SetDeploymentEnv|SetDeploymentEnvProd:1:200,SetDeploymentEnvUntrusted:1:400

macrostep = BroadcastEnv|BroadcastEnvKastafior:2:500

macrostep = BootNewEnv|BootNewEnvKexec:1:200,BootNewEnvHardReboot:1:300

2.2.2 Explanation of the �elds used in the cluster-speci�c con�guration�le

Each line of the con�guration �le must follow the pattern: key = value (note that the spacesaround the = are mandatory.

• deploy_kernel: name of the kernel used by the deployment environment. It is possible tospecify an http location if you use gpxelinux.

• deploy_initrd: name of the initrd used by the deployment environment and boot arguments.It is possible to specify an http location if you use gpxelinux. According your hardware, youmust set the ETH_DRV, ETH_DEV, DISK_DRV and SLEEP_TIME (for slow disks) correctly. Further-more, if you use a deployment kernel generated with the script provided in the Kadeploy distri-bution, you must set the ramdisk_size value correctly and you must specify init=/linuxrc.

• block_device: block device of the disk used on the nodes.

• prod_part: number of the production partition on the disk.

• deploy_part: number of the deployment partition on the disk.

• tmp_part: number of the tmp partition on the disk.

• swap_part: number of the swap partition on the disk. If the none value is speci�ed, the swapformat at the deployment time will be bypassed.

• timeout_reboot_classical: classical reboot timeout. A Ruby expression can be used hereto represent a function depending on n (the number of nodes currently rebooted).

• timeout_reboot_kexec: kexec reboot timeout. A Ruby expression can be used here torepresent a function depending on n (the number of nodes currently rebooted).

• cmd_soft_reboot: generic soft reboot command. You can use the HOSTNAME_FQDN andHOSTNAME_SHORT variables in the command-line.

• cmd_hard_reboot: generic hard reboot command. You can use the HOSTNAME_FQDNand HOSTNAME_SHORT variables in the command-line.

• cmd_very_hard_reboot: generic very hard reboot command. You can use the HOST-NAME_FQDN and HOSTNAME_SHORT variables in the command-line.

Page 15: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 2. SERVER SIDE CONFIGURATION 14

• drivers: list of drivers that must be loaded in the deployment environment. The syntax is:driver1,driver2,driver3,...

• cmd_soft_power_on: generic soft power on command. You can use the HOSTNAME_FQDNand HOSTNAME_SHORT variables in the command-line.

• cmd_hard_power_on: generic hard power on command. You can use the HOST-NAME_FQDN and HOSTNAME_SHORT variables in the command-line.

• cmd_very_hard_power_on: generic very hard power on command. You can use the HOST-NAME_FQDN and HOSTNAME_SHORT variables in the command-line.

• cmd_soft_power_off: generic soft power o� command. You can use the HOST-NAME_FQDN and HOSTNAME_SHORT variables in the command-line.

• cmd_hard_power_off: generic hard power o� command. You can use the HOST-NAME_FQDN and HOSTNAME_SHORT variables in the command-line.

• cmd_very_hard_power_off: generic very hard power o� command. You can use the HOST-NAME_FQDN and HOSTNAME_SHORT variables in the command-line.

• cmd_power_status: generic power status command. You can use the HOSTNAME_FQDNand HOSTNAME_SHORT variables in the command-line.

• kernel_params: default kernel parameters applied to a Linux based deployed environment.This can be overloaded in the environment description.

• pxe_header: default PXE header (must be de�ned in one line).

• nfsroot_kernel: kernel for the NFS-root deployment environment (only used if you use anNFS-root deployment environment)

• nfsroot_params: kernel parameters for the NFS-root deployment environment (only used ifyou use an NFS-root deployment environment)

• partition_creation_kind: tool used to create the partition table. The expected values arefdisk or parted.

• admin_pre_install: list of pre-install to execute at the pre-install of a deployment. Thesyntax is: �le1|kind_�le1|script1,�le2|kind_�le2|script2, ... The kind of �le must be tgz ortbz2. The no_pre_install value can also be used if no administrator pre-install must beexecuted. For debug purpose, you can use the keyword breakpoint instead of a script. Thus,the �le will be transferred, the deployment work�ow will be stopped and you will be able toconnect in the deployment environment to debug. Finally, the script value can be none if noscript must be launched.

• admin_post_install: list of post-install to execute at the post-install of a deployment. Thesyntax is: �le1|kind_�le1|script1,�le2|kind_�le2|script2, ... The kind of �le must be tgz ortbz2. The no_post_install value can also be used if no administrator post-install must beexecuted. For debug purpose, you can use the keyword breakpoint instead of a script. Thus,the �le will be transferred, the deployment work�ow will be stopped and you will be able to

Page 16: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 2. SERVER SIDE CONFIGURATION 15

connect in the deployment environment to debug. Finally, the script value can be none if noscript must be launched.

• macrostep: list of implementations for a macro-step. The syntax is: macrostep-name|implem1:nb_retry:timeout,implem2:nb_retry:timeout,... There are 3 macro-steps, soyou must specify one line in the speci�c con�guration �le for each one. Here is the list of themacro-step and their implementation:

� SetDeploymentEnv

∗ SetDeploymentEnvProd

· check_nodes· create_partition_table· format_deploy_part· mount_deploy_part· format_tmp_part

∗ SetDeploymentEnvUntrusted

· switch_pxe· reboot· wait_reboot· send_key_in_deploy_env· create_partition_table· format_deploy_part· mount_deploy_part· format_tmp_part

∗ SetDeploymentEnvUntrustedCustomPreInstall

· switch_pxe· reboot· wait_reboot· send_key_in_deploy_env· manage_admin_pre_install

∗ SetDeploymentEnvNfsroot

· switch_pxe· reboot· wait_reboot· send_key_in_deploy_env· create_partition_table· format_deploy_part· mount_deploy_part· format_tmp_part

∗ SetDeploymentEnvDummy

� BroadcastEnv

Page 17: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 2. SERVER SIDE CONFIGURATION 16

∗ BroadcastEnvChain

· send_environment(�chain�)· manage_admin_post_install· manage_user_post_install· send_key· install_bootloader· switch_pxe

∗ BroadcastEnvKastafior

· send_environment(�kasta�or�)· manage_admin_post_install· manage_user_post_install· send_key· install_bootloader· switch_pxe

∗ BroadcastEnvTree

· send_environment(�tree�)· manage_admin_post_install· manage_user_post_install· send_key· install_bootloader· switch_pxe

∗ BroadcastEnvBittorrent

· send_environment(�bittorrent�)· manage_admin_post_install· manage_user_post_install· send_key· install_bootloader· switch_pxe

∗ BroadcastEnvDummy

� BootNewEnv

∗ BootNewEnvClassical

· umount_deploy_part· reboot_from_deploy_env· wait_reboot

∗ BootNewEnvKexec

· reboot(�kexec�)· wait_reboot

∗ BootNewEnvHardReboot

· reboot(�hard�)· wait_reboot

∗ BootNewEnvDummy

Page 18: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 2. SERVER SIDE CONFIGURATION 17

Note about the reboot/power-on/power-o� commands In some special cases, a such com-mand can a�ect a group of nodes. Thus, you can specify group of nodes for a given command usingthe following syntax :

cmd_very_hard_power_off = /usr/sbin/very_hard_power_off GROUP_SHORT, \

path_to_group_of_node_for_hard_power_off_cmd

You can remark two things :

• the HOSTNAME_SHORT and HOSTNAME_FQDN patterns are not used in these commands, insteadyou must use the GROUP_SHORT and GROUP_FQDN patterns.

• the a�nity between nodes is speci�ed in a �le (herepath_to_group_of_node_for_hard_power_off_cmd) that contains as much lines asthe number of groups. Then, each line contains the nodes of a group, for instance:node1,node2,node3.

For a given command on a given cluster, if you specify some group of nodes (with GROUP_SHORT orGROUP_FQDN patterns), you will also be able to specify, for some nodes of the cluster, a commandthat does not imply a group of nodes. To do this, you must specify these commands in the speci�ccommands con�guration �les.

2.3 Clusters �le

The list of all the clusters must be de�ned in the /etc/kadeploy3/clusters �le. For instance, the�le may contain something like :

#list of the clusters

gdx

netgdx

Warning, a cluster-speci�c con�guration �le must be de�ned for each cluster de�ne in this �le.

2.4 Partition map �les

A partition map must be provided for each cluster with the name partition_file_CLUSTER whereCLUSTER is the cluster name.

If you specify fdisk for the partition_creation_kind �eld in the cluster-speci�c con�guration�le, the partition map �le must be a fdisk map. In this case, concerning the kind of the deploymentpartition, you must use the value PARTTYPE instead of a real value. Thus, this value will be modi�edon the �y according to the kind of environment deployed (Linux, FreeBSD, ...).

If you specify parted for the partition_creation_kind �eld in the cluster-speci�c con�gu-ration �le, you must provide a parted script as a partition map �le. Currently, only the Linuxpartition kind is handled with parted.

Page 19: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 2. SERVER SIDE CONFIGURATION 18

2.5 Nodes con�guration �les

All the nodes of the clusters that aim to be deployed must be declared in a �le named nodes in thecon�guration directory. Each line of the �le must specify a node and the syntax is: hostname ip

cluster. Ranges can also be used to de�ne the nodes.Here is an example:

gdx-1.orsay.grid5000.fr 172.24.1.1 gdx

gdx-2.orsay.grid5000.fr 172.24.1.2 gdx

gdx-3.orsay.grid5000.fr 172.24.1.3 gdx

gdx-4.orsay.grid5000.fr 172.24.1.4 gdx

gdx-5.orsay.grid5000.fr 172.24.1.5 gdx

gdx-6.orsay.grid5000.fr 172.24.1.6 gdx

gdx-7.orsay.grid5000.fr 172.24.1.7 gdx

gdx-8.orsay.grid5000.fr 172.24.1.8 gdx

gdx-9.orsay.grid5000.fr 172.24.1.9 gdx

netgdx-1.orsay.grid5000.fr 172.25.1.1 netgdx

netgdx-2.orsay.grid5000.fr 172.25.1.2 netgdx

netgdx-3.orsay.grid5000.fr 172.25.1.3 netgdx

netgdx-4.orsay.grid5000.fr 172.25.1.4 netgdx

Another example:

gdx-[1-9].orsay.grid5000.fr 172.24.1.[1-9] gdx

netgdx-[1-3].orsay.grid5000.fr 172.25.1.[1-3] netgdx

netgdx-4.orsay.grid5000.fr 172.25.1.4 netgdx

2.6 Speci�c commands con�guration �les

In the part 2.2 we saw that generic commands can be given to all the nodes that belong to a cluster.It is also possible to override these generic values for some speci�c nodes. To do this, you must �llthe �le named cmd in the con�guration directory. Each line of the �le must specify a command tooverride for a given node and the syntax is: hostname|command kind|cmd where hostname must bealso de�ned in the nodes �le and the expected values for command kind are:

• reboot_soft

• reboot_hard

• reboot_very_hard

• power_on_soft

• power_on_hard

• power_on_very_hard

• power_off_soft

• power_off_hard

Page 20: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 2. SERVER SIDE CONFIGURATION 19

• power_off_very_hard

• power_status

• console

Here is an example:

vm-001|reboot_soft|ssh -q root@vm-001 /sbin/special_reboot_for_vm

vm-001|reboot_hard|vmware-cmd /home/vmware/vm-001/vm-001.vmx reset hard

vm-002|reboot_soft|ssh -q root@vm-002 /sbin/special_reboot_for_vm

Note: it is not mandatory to override all the commands for a given node.

2.7 Deployment environment

There are three ways to set a deployment environment: using the production environment, using adedicated environment, using an NFSRoot environment.

2.7.1 Con�guration of the production environment

TODO

2.7.2 Creation of the dedicated environment

This methods consists in creating a kernel/initrd that contains all the tools required to perform adeployment. Two scripts are provided to ease the creation of the deployment environment. To usethese scripts, go to the addons/deploy_env_generation/debootstrap directory and execute withroot rights:

> sh make_debootstrap.sh

> sh make_kernel.sh

The make_debootstrap.sh script can be tuned if you want to add or remove some pack-ages in the �lesystem. To do this, you can modify the DEBOOTSTRAP_INCLUDE_PACKAGES andDEBOOTSTRAP_INCLUDE_PACKAGES values.

The make_kernel.sh script prompts the user the following things:

• the size of the uncompressed initrd in KB;

• the kernel version;

• the absolute path to a kernel con�g �le;

• the use of automatic con�guration for the new �elds in kernel con�guration.

The size of the uncompressed initrd depends on what you have to put in your deploymentenvironment. If you use the make_debootstrap.sh script, the initrd size should be at least 200MB.Depending on the kernel version you choose, the script will fetch the vanilla kernel correspondingto this version. Once a kernel has been fetched, it won't be fetched again in another run. Thus,you have to delete the kernel �le if you want to fetch it again. At the opposite, if you do not want

Page 21: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 2. SERVER SIDE CONFIGURATION 20

to use the sources of the vanilla kernel but your own sources, you can put your own kernel (tar.bz2compressed) in the current directory. The only requirement is to name the �le with the followingpattern: linux-version.tar.bz2. Then, at the kernel version prompt, just enter the version value.

After the execution of make_kernel.sh, a directory pre�xed with built- will be created. Thisdirectory contains the kernel and the initrd �les, pre�xed with deploy-.

2.7.3 Creation of the NFSRoot environment

TODO

2.8 Con�guration of the deploy user

In order to use the Kasta�or based �le broadcaster (BroadcastEnvKastafior macro-step), theserver must be able to perform an ssh connection on itself. Thus, you must add the deploy keyinstalled in the /etc/kadeploy3/keys/id_deploy.pub in the .ssh/authorized_keys �le of thedeploy user. This step is optional if you do not plan to use the BroadcastEnvKastafior macro-step.

Page 22: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

Chapter 3

Client side con�guration

On the client side, you only have to con�gure the �le named client_conf. This �le de�nes oneKadeploy server per line and a default server. For instance:

default = rennes

rennes = rennes.grid5000.fr:25300

toulouse = toulouse.grid5000.fr:25300

21

Page 23: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

Chapter 4

User guide

4.1 Overview of the Kadeploy tools

4.1.1 Kadeploy

The Kadeploy tool is base on a client/server architecture. Thus, it is composed both of a serverpart and a client part. The server must be run with the root rights and the client is used withstandard rights.

4.1.2 Kareboot

Kareboot is designed to perform several reboot operations on the nodes.

4.1.3 Kaenv

Kaenv is designed to manage the users environments.

4.1.4 Kaconsole

Kaconsole is designed to provide a user to access to the consoles of the nodes on which the user hasthe deployment rights.

4.1.5 Kastat

Kastat is designed to show several statistics about the deployments.

4.1.6 Kanodes

Kanodes is designed to show the state of the nodes.

4.1.7 Kapower

Kapower is designed to control the power state of the nodes.

22

Page 24: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 23

4.1.8 Karights

Karights is designed to allow users to perform some deployments on a set of nodes throughout areservation. This tool is typically called by the resource manager at the prologue and epilogue steps.

4.2 Use the Kadeploy tools

4.2.1 Kadeploy server

All the Kadeploy tools use the Kadeploy server. On a well con�gured system, the Kadeploy servercan be launched with the following command (with root rights):

> kadeploy3d

4.2.2 Kadeploy client

The Kadeploy client is actually the user interface for the Kadeploy software. It can be used byusing the kadeploy3 command. The CLI looks like this:

> kadeploy3 -h

Usage: kadeploy3 [options]

Contact: [email protected]

General options:

-a, --env-file ENVFILE File containing the environment description

-b, --block-device BLOCKDEVICE Specify the block device to use

-d, --debug-mode Activate the debug mode

-e, --env-name ENVNAME Name of the recorded environment to deploy

-f, --file MACHINELIST Files containing list of nodes (- means stdin)

-k, --key [FILE] Public key to copy in the root's authorized_keys,

if no argument is specified, use the authorized_keys

-m, --machine MACHINE Node to run on

--multi-server Activate the multi-server mode

-n, --output-ko-nodes FILENAME File that will contain the nodes not correctly deployed

-o, --output-ok-nodes FILENAME File that will contain the nodes correctly deployed

-p, --partition-number NUMBER Specify the partition number to use

-r, --reformat-tmp FSTYPE Reformat the /tmp partition with the given filesystem type

(ext[234] are allowed)

-s, --script FILE Execute a script at the end of the deployment

-u, --user USERNAME Specify the user

-v, --version Get the version

--vlan VLANID Set the VLAN"

-w, --set-pxe-profile FILE Set the PXE profile (use with caution)

--set-pxe-pattern FILE Specify a file containing the substituation of a pattern for

each node in the PXE profile (the NODE_SINGULARITY pattern must

be used in the PXE profile)

-x, --upload-pxe-files FILES Upload a list of files (file1,file2,file3) to the "tftp_images_path"

directory. Those files will be prefixed with "pxe-$username-"

--env-version NUMBER Number of version of the environment to deploy

--server STRING Specify the Kadeploy server to use

Page 25: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 24

-V, --verbose-level VALUE Verbose level between 0 to 4

Advanced options:

--write-workflow-id FILE Write the workflow id in a file

--ignore-nodes-deploying Allow to deploy even on the nodes tagged as "currently deploying"

(use this only if you know what you do)

--disable-bootloader-install Disable the automatic installation of a bootloader for a

Linux based environment

--disable-disk-partitioning Disable the disk partitioning

--breakpoint MICROSTEP Set a breakpoint just before launching the give micro-step, the

syntax is macrostep:microstep (use this only if you know what you do)

--set-custom-operations FILE Add some custom operations defined in a file

--reboot-classical-timeout V Overload the default timeout for classical reboots

--reboot-kexec-timeout V Overload the default timeout for kexec reboots

--force-steps STRING Undocumented, for administration purpose only

At least, Kadeploy must be called with one node and an environment. The nodes to deploycan be speci�ed by using several -m|�machine options, or the -f|�file options (one node per linein the �le), or a mix of both. The environment can be speci�ed with the -e|�env-name option ifyou want to use an environment recorded in the environment database or with the -a|�env-fileoptions if you want to use an environment described in a �le. Refer to the 4.2.4 part for informationabout the environment description. Here are some examples:

> kadeploy3 -m gdx-5.orsay.grid5000.fr -e lenny-x64-nfs-1.0 -o nodes_ok -n nodes_ko

> kadeploy3 -m gdx-[5-12].orsay.grid5000.fr -e lenny-x64-base -o nodes_ok -n nodes_ko

> kadeploy3 -f nodes -a custom_env.dsc

> kadeploy3 -f nodes -m gdx-5.orsay.grid5000.fr -a custom_env.dsc

> cat nodefile|kadeploy3 -f - -e lenny-x64-base

We present now several use cases.

Use case 1 - basic usage - deployment of a node

> kadeploy3 -m gdx-5.orsay.grid5000.fr \

-e lenny-x64-nfs-1.0 \

--verbose-level 4 \

-k ~/.ssh/id_rsa.pub

This command performs the deployment of the environment lenny-x64-nfs-1.0 on the node gdx-5.orsay.grid5000.fr and copies the SSH public key /.ssh/id_rsa.pub of the user in the deployedenvironment to allow a direct connection with the root account. Furthermore, the verbose level isset to 4, which means that you want the maximum verbose information.

Use case 2 - basic usage - deployment of a range of nodes

> kadeploy3 -m gdx-[45-51].orsay.grid5000.fr \

-e lenny-x64-base \

-k

Page 26: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 25

This command performs the deployment of the environment lenny-x64-base on the nodes gdx-45.orsay.grid5000.fr, gdx-46.orsay.grid5000.fr, ..., gdx-51.orsay.grid5000.fr. Furthermore, it copiesthe entries of the /.ssh/authorized_keys user �le in the /root/.ssh/authorized_keys of thedeployed nodes.

Use case 3 - basic usage - deployment of a set of nodes

> kadeploy3 -f ~/machinefile \

-e custom_env \

-l johnsmith \

-o nodes_ok -n nodes_ko

This command uses the environment custom_env of the user johnsmith to deploy the nodes spec-i�ed in /machine�le. The list of the nodes correctly deployed will be written in the �le speci-�ed with the -o|�output-ok-nodes option. Idem for the nodes not correctly deployed with the-o|�output-ko-nodes option. Refer to the part 4.2.4 about Kaenv to know more about the envi-ronment management.

Use case 4 - basic usage - execution of a script after deployment

> kadeploy3 -f $OAR_NODE_FILE \

-a ~/my-lenny.dsc \

-r ext3 \

-p 4 \

-s ~/launcher.sh

This command performs the deployment of the environment described by the �le /my-lenny.dsc(useful if you don't want to share your environment with the other users) on the nodes speci�ed inthe �le pointed by $OAR_NODE_FILE (typically a variable set by the resource manager). We specifyhere that we want the /tmp partition to be reformated. Furthermore, we specify that we want todeploy the environment on the 4th disk partition, instead of the default one. Finally, we ask toexecute the script /launcher.sh at the end of the deployment.

Use case 5 - advanced usage - play with breakpoint

> kadeploy3 -m gdx-5.orsay.grid5000.fr \

-e lenny-x64-nfs-1.0 \

--verbose-level 4 \

--breakpoint BroadcastEnvKastafior:manage_user_post_install \

-d

This kind of command can be used for debug purpose. It performs a deployment with the max-imum verbose level and it asks to stop the deployment work�ow just before executing the man-age_user_post_install micro-step of the BroadcastEnvKasta�or macro-step. Thus you will be ableto connect in the deployment environment and to debug what you want. Furthermore, the fulloutput of the distant commands performed is shown.

Page 27: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 26

Use case 6 - advanced usage - speci�c PXE pro�le

> kadeploy3 -m gdx-[5-10].orsay.grid5000.fr \

-e lenny-x64-nfs-1.0 \

-w ~/pxe_profile -x "~/custom-kernel,~/custom-initrd" \

--set-pxe-pattern ~/singularities

In some speci�c case, you may want to use a speci�c PXE pro�le to boot your nodes. To do this,you have to provide a PXE pro�le. Warning, the �les used in your PXE pro�l (Comboot, kernel,initrd, ...) must be readable by the TFTP server on the Kadeploy server. So Kadeploy o�ers afeature to stage some �les in an area where the �les can be read by the TFTP server. This can beachieved with the -x|�upload-pxe-files option. You must know that such uploaded �les will becopied in the tftp_images_path, and will be pre�xed with pxe-username-.

Here is an example of PXE pro�le that uses uploaded �les:

PROMPT 1

SERIAL 0 38400

DEFAULT bootlabel

DISPLAY messages

TIMEOUT 50

label bootlabel

KERNEL kernels/pxe-ejeanvoine-custom-kernel

APPEND initrd=kernels/pxe-ejeanvoine-custom-initrd root=/dev/sda3 node_id=NODE_SINGULARITY

You can notice the NODE_SINGULARITY pattern used in the PXE pro�le. Thanks to the�set-pxe-pattern option, you can also provide a �le that de�nes a value in the PXE pro�lethat depends on the node concerned. This �le must de�ne on each line a couple of value as follows :hostname,node singularity. In our example, the �le /singularities can contains something like:

gdx-5.orsay.grid5000.fr,1

gdx-6.orsay.grid5000.fr,2

gdx-7.orsay.grid5000.fr,3

gdx-8.orsay.grid5000.fr,3

gdx-9.orsay.grid5000.fr,4

gdx-10.orsay.grid5000.fr,5

Use case 7 - advanced usage - speci�c bootloader requirement

> kadeploy3 -m gdx-5.orsay.grid5000.fr \

-e Custom_linux_env \

--disable-bootloader-install

If you deploy a Linux based environment and if the administrator choose to boot the nodes with thechainload fashion, Kadeploy will install automatically a bootloader on the deployment partition.In some cases, you may want to bypass this installation because you have installed at the timeof a previous deployment another bootloader. This allows to avoid the overriding of the installedbootloader. However, if no bootloader is installed or if the installed bootdloader is not able to bootyour environment, the won't be reachable at the end of the deployment.

Page 28: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 27

Use case 8 - advanced usage - get a work�ow id for an external deployment tracking

> kadeploy3 -m gdx-5.orsay.grid5000.fr \

-e Custom_linux_env \

--write-workflow-id wid_file

This command performs the deployment of the Custom_linux_env environment and write thework�ow id of this deployment in the �le wid_�le. The aim of getting the deployment id is tomonitor the deployment from an extern tool thanks to the Kanodes tool.

Use case 9 - expert usage - modify the deployment work�ow

> kadeploy3 -m gdx-5.orsay.grid5000.fr \

-e "FreeBSD 7.1" \

--force-steps "SetDeploymentEnv|SetDeploymentEnvProd:2:100&

BroadcastEnv|BroadcastEnvKastafior:2:300&

BootNewEnv|BootNewEnvKexec:1:150"

If you are a power user, you can specify the full Kadeploy work�ow and bypass the default con�g-uration. Use it at your own risk since the nodes may not support all the Kadeploy features likethe Kexec optimization for instance. The syntax for the �force-steps option is the same that forthe macrostep �eld if the Kadeploy con�guration. The di�erence is that the three macrostep arede�ned on the same line, with the & character as a delimiter between the macro-steps. Warning, youmust de�ne at least one implementation for each macro-step, without newline (unlike the example).

Use case 10 - expert usage - insert custom operations in the deployment work�ow

> kadeploy3 -m gdx-5.orsay.grid5000.fr \

-e lenny-x64-nfs-1.0 \

--set-custom-operations ~/custom_ops

For very speci�c purpose, you can add some custom operations in the deployment work-�ow. To do this, you have to specify these operations in a �le where each line spec-ify the operations that must be executed at the beginning of a micro-step. The syntax is:macrostep,microstep@cmd1%arg%dir,cmd2%arg%dir,...,cmdN%arg%dir. You can specify twokinds of operations: send and exec. For the send operation, arg is used to specify a �le nameand dir is used to specify the destination directory. Concerning the exec operation, arg is used tospecify the command to execute and dir must be empty.

Here is an example of a �le that contains custom operations:

> cat ~/custom_ops

SetDeploymentEnvUntrusted,format_tmp_part@send%/tmp/script.sh%/dest,exec%/dest/script.sh%

BootNewEnvKexec,reboot@exec%echo "s" > /proc/sysrq-trigger%

4.2.3 Kareboot

Kareboot can be used by using the kareboot3 command. The CLI looks like this:

Page 29: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 28

> kareboot3 -h

Usage: kareboot3 [options]

Contact: [email protected]

General options:

-b, --block-device BLOCKDEVICE Specify the block device to use

-c, --check-prod-env Check if the production environment has been detroyed

-e, --env-name ENVNAME Name of the recorded environment

-f, --file MACHINELIST Files containing list of nodes (- means stdin)

-k, --key [FILE] Public key to copy in the root's authorized_keys,

if no argument is specified, use the authorized_keys

-l, --reboot-level VALUE Reboot level (soft, hard, very_hard)

-m, --machine MACHINE Reboot the given machines

--multi-server Activate the multi-server mode

-n, --output-ko-nodes FILENAME File that will contain the nodes not correctly rebooted

-o, --output-ok-nodes FILENAME File that will contain the nodes correctly rebooted

-p, --partition-number NUMBER Specify the partition number to use

-r, --reboot-kind REBOOT_KIND Specify the reboot kind (set_pxe, simple_reboot,

deploy_env, env_recorded)

-u, --user USERNAME Specify the user

-v, --version Get the version

-w, --set-pxe-profile FILE Set the PXE profile (use with caution)

--set-pxe-pattern FILE Specify a file containing the substituation of a pattern for

each node in the PXE profile (the NODE_SINGULARITY pattern must

be used in the PXE profile)

-x, --upload-pxe-files FILES Upload a list of files (file1,file2,file3) to the "tftp_images_path"

directory. Those files will be prefixed with "pxe-$username-"

--env-version NUMBER Specify the environment version

--no-wait Do not wait the end of the reboot

--server STRING Specify the Kadeploy server to use

-V, --verbose-level VALUE Verbose level between 0 to 4

--reboot-classical-timeout V Overload the default timeout for classical reboots

At least, Kareboot must be called with one node and a reboot kind. The nodes to reboot canbe speci�ed by using several -m|�machine options, or the -f|�file options (one node per line inthe �le), or a mix of both. The expected values for the -r|�reboot-kind are:

• simple_reboot: perform a simple reboot of the nodes. Kareboot �rstly tries to perform asoft reboot, then a hard reboot is performed and lastly a very hard reboot if it doesn't successbefore.

• set_pxe: modify the PXE pro�le with the one given with the -w|�set-pxe-profile optionsand perform a simple reboot.

• env_recorded: perform a reboot on an environment that is already deployed (for instance,the production environment on the production part). This operation must be used with the-e and -p options at least.

• deploy_env: perform a reboot on the deployment environment. This can be used with the-k|�key option.

Page 30: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 29

Here are some basic examples:

> kareboot3 -m gdx-5.orsay.grid5000.fr -r simple_reboot

> kareboot3 -m gdx-[5-8].orsay.grid5000.fr -r simple_reboot

> cat nodefile|kareboot3 -f - -r simple_reboot

> kareboot3 -m gdx-5.orsay.grid5000.fr -r simple_reboot -o reboot_ok.txt \

-n reboot_ko.txt

> kareboot3 -f nodes -r set_pxe -w ~/customized_pxe_profile

> kareboot3 -f nodes -r set_pxe -w ~/customized_pxe_profile -l hard \

-x "~/custom_kernel,~/custom_initrd" \

--set-pxe-pattern ~/singularities (Cf. Kadeploy use case 6)

> kareboot3 -f nodes -r deploy_env -k .ssh/id_rsa

> kareboot3 -r env_recorded -e production_environment \

-p 2 -u root -m gdx-5.orsay.grid5000.fr

> kareboot3 -r env_recorded -e production_environment \

-p 2 -u root -m gdx-5.orsay.grid5000.fr \

--no-wait

Kareboot can be used to manage the demolishing environment. Typically, at the end of a reserva-tion with deployment, the resource manager will perform a reboot on the production environment.By using the -c|�check-prod-env option (for instance: kareboot -f nodes -r env_recorded

-c), Kareboot �rstly checks if the deployed environment on the involved nodes is tagged like ademolishing environment. If the environment is considered as demolishing, Kareboot does not per-form a reboot and returns the 2 value. In this case, the production environment has been destroyedand should be deployed again. If the environment is not considered as demolishing, the reboot isperformed and a check is performed at the end of the reboot to ensure that the production envi-ronment is correctly deployed. If the nodes are correctly rebooted on the production environment,Kareboot returns the 0 value. Otherwise it returns the 1 value, what means that the productionenvironment has been destroyed and that it should be deployed again.

An environment is considered demolishing if the number of failures after a reboot on the pro-duction environment (when the -c|�check-prod-env optionis used with Kareboot), is higher thanthe threshold specify in the con�guration �le. In the Kaenv part you can �nd the way to reset thedemolishing counter of an environment by using an option of Kaenv.

Warning, if the �no-wait option is used, Kareboot won't wait the end of the reboot to exit.Thus, this option cannot be used with the -c|�check-prod-env, -o, �output-ok-nodes and -n,

�output-ko-nodes options.

4.2.4 Kaenv

Command line interface

Kaenv can be used by using the kaenv3 command. The CLI looks like this:

> kaenv3 -h

Usage: kaenv3 [options]

Contact: [email protected]

General options:

-a, --add ENVFILE Add an environment

Page 31: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 30

-d, --delete ENVNAME Delete an environment

-l, --list List environments

-m, --files-to-move FILES Files to move (src1:dst1,src2:dst2,...)

-p, --print ENVNAME Print an environment

-s, --show-all-versions Show all versions of an environment

-t, --visibility-tag TAG Set the visibility tag (private, shared, public)

-u, --user USERNAME Specify the user

--env-version NUMBER Specify the version

--server STRING Specify the Kadeploy server to use

Advanced options:

--remove-demolishing-tag ENVNAME Remove demolishing tag on an environment

--set-visibility-tag ENVNAME Set the visibility tag on an environment

--update-tarball-md5 ENVNAME Update the MD5 of the environment tarball

--update-preinstall-md5 ENVNAME Update the MD5 of the environment preinstall

--update-postinstalls-md5 ENVNAME Update the MD5 of the environment postinstalls

--move-files Move the files of the environment (for administrators only)

We present now several use cases.

Use case 1 - list the environments

> kaenv3 -l

This command lists the environment that you have previously recorded, and the public environ-ments.

Use case 2 - list the shared environments recorded by another user

> kaenv3 -l -u johnsmith -s

This command lists the environment of the user johnsmith. If you use �*� as a user value, it lists theenvironments of all the users. Furthermore, the -s|�show-all-versions option is used to showall the versions of each environment. If this option is not speci�ed, only the version is displayed.

Use case 3 - print an environment

> kaenv3 -p FreeBSD --env-version 3 -u johnsmith

This command lists prints the version 3 of the environment FreeBSD that belongs to johnsmith. Ifno version number is given, the last version of the environment is printed. To print an environmentyou own, there is no need to use the -u|�user option.

Use case 4 - add an environment described in a �le

> kaenv3 -a ~/new_env.dsc

This command adds the environment de�ned in the �le /new_env.dsc.

Page 32: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 31

Use case 5 - add an environment described in an http �le

> kaenv3 -a http://www.grid5000.fr/pub/johnsmith/env.desc

This command adds the environment de�ned in the �lehttp://www.grid5000.fr/pub/johnsmith/env.desc.

Use case 6 - delete an environment

> kaenv3 -d FreeBSD --env-version 2

This command deletes the version 2 of the environment FreeBSD from the environment database.If no version number is given, all the versions are deleted.

Use case 7 - remove the demolishing property of an environment

> kaenv3 --remove-demolishing-tag FreeBSD --env-version 3

This command resets the demolishing counter of the version 3 of the environment FreeBSD. If noversion number is given, the latest version of the environment is considered.

Use case 8 - update the tarball of an environment

> kaenv3 --update-tarball-md5 sidx64-base

This command is useful if you modify the tarball of the environment sidx64-base without modifyingthe kernel or the initrd and if you do not want to record a new environment. Thus, it will updatethe MD5 of the tarball �le. This operation is required if something change in the tarball, otherwisethe environment will be unusable.

Use case 9 - update the postinstalls of an environment

> kaenv3 --update-postinstalls-md5 sidx64-base

This command does the same thing than the precedent one but it concerns the post-install �les.This operation is required if something change in the post-install �les, otherwise the environmentwill be unusable.

Use case 10 - de�ne the visibility of an environment

> kaenv3 --set-visibility-tag sidx64-base --env-version 3 -t private

This command allows to de�ne the environment sidx64-base version 3 as a private environment.Note that the environment version is required and only the almighty environment users are allowedto de�ne an environment as public.

Page 33: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 32

Environment description

Each line of an environment description must follow the pattern: key : value (note that thespaces around the : are mandatory. Here is an example of an environment description:

name : xen

version : 1

description : https://www.grid5000.fr/index.php/Etch-x64-xen-1.0

author : John Smith

tarball : /grid5000/etch-x64-xen-1.0.tgz|tgz

preinstall : /home/john/test/pre_install.tgz|tgz|launch.sh

postinstall : /home/john/test/post_install.tgz|tgz|traitement.sh

kernel : /boot/vmlinuz-2.6.18-6-xen-amd64

kernel_params : console=tty0 console=ttyS1,38400n8

initrd : /boot/initrd.img-2.6.18-6-xen-amd64

hypervisor : /boot/xen-3.0.3-1-amd64.gz

hypervisor_params : dom0_mem=1000000

fdisktype : 83

filesystem : ext2

environment_kind : xen

visibility : shared

demolishing_env : 0

Explanation of the �elds used in the environment description:

• name: name of the environment. The spaces are allowed in the name but remember to usesome quotes around it when you use Kadeploy or Kaenv.

• version: version of the environment.

• author: author of the environment.

• tarball: disk image of the environment. The syntax is: file|kind. The allowed kinds aretgz, tbz2, ddgz and ddbz2.

• preinstall (opt): pre-install �le. The syntax is: file|kind|script [params]. The al-lowed kinds of �les are tgz and tbz2. For debug purpose, you can use the keyword breakpointinstead of a script. Thus, the �le will be transferred, the deployment work�ow will be stoppedand you will be able to connect in the deployment environment to debug. Finally, the scriptvalue can be none if no script must be launched. Warning, if the preinstall �eld is ful�lled,the entire SetDeploymentEnv step de�ned by the administrator will be bypassed. Refer tothe 4.6 part concerning build of a pre-install.

• postinstall: post-install �les. The syntax is: file1|kind|script1

[params],file2|kind|script2 [params], .... The allowed kinds of �les for post-installs are tgz and tbz2. For debug purpose, you can use the keyword breakpoint insteadof a script. Thus, the �le will be transferred, the deployment work�ow will be stopped andyou will be able to connect in the deployment environment to debug. Finally, the script valuecan be none if no script must be launched.

• kernel: path of the kernel in the tarball.

Page 34: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 33

• kernel_params: set of parameters that must be applied to the kernel for a correct boot.

• initrd: path of the initrd in the tarball.

• hypervisor (opt): path of the hypervisor in the tarball. This �elds is only required for theXen based environments.

• hypervisor_params (opt): set of parameters that must be applied to the hypervisor for acorrect boot. This �elds is only required for the Xen based environments.

• fdisktype: partition type in hexadecimal (83 for Linux, a4 for FreeBSD, ...). This is used asan input for fdisk.

• filesystem: type of �lesystem wished on the deployment partition. It must be known by themkfs command.

• environment_kind: kind of environment. Expected values are linux, xen or other.

• visibility: de�ne the visibility level of an environment. Three levels are available:

� private: only the owner of the environment can see and use it ;

� shared: the environment can be used by everybody but it must explicitly use with theowner name ; furtermore, it won't be listed unless the owner name is speci�ed ;

� public: the environment can be used by everybody and it is listed without speci�ng itsowner name.

• demolishing_env: specify that the environment is demolishing (expected values are 0 if theenvironment is not demolishing, 10000 otherwise). SHOULD BE IMPROVED...

4.2.5 Kaconsole

Karights can be used by using the kaconsole command. It has only one use case that is openinga console on a given node, for instance:

> kaconsole3 -m gdx-25.orsay.grid5000.fr

Kaconsole can't be used on a node on which a user doesn't have the deployment rights. Further-more, as soon as the deployments rights are revoked for a user, ever open console is automaticallyclosed.

4.2.6 Kastat

Kastat can be used by using the kastat3 command. The CLI looks like this:

> kastat3 -h

Usage: kastat3 [options]

Contact: [email protected]

General options:

-a, --list-min-retries NB Print the statistics about the nodes that need several attempts

-b, --list-failure-rate Print the failure rate for the nodes

Page 35: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 34

-c, --list-min-failure-rate RATE Print the nodes which have a minimum failure-rate of

RATE (0 <= RATE <= 100

-d, --list-all Print all the information

-f, --field FIELD Only print the given fields (user,hostname,step1,step2,step3,

timeout_step1,timeout_step2,timeout_step3,

retry_step1,retry_step2,retry_step3,

start,

step1_duration,step2_duration,step3_duration,

env,md5,success,error)

-m, --machine MACHINE Only print information about the given machines

-s, --step STEP Applies the retry filter on the given steps (1, 2 or 3)

-v, --version Get the version

-x, --date-min DATE Get the stats from this date (yyyy:mm:dd:hh:mm:ss)

-y, --date-max DATE Get the stats to this date

--server STRING Specify the Kadeploy server to use

We present now the use cases. Note that all the commands can be �ltered with a period byusing the -x|�date-min and -y|�date-max options.

Use case 1 - get the information about the deployments performed on a node

> kastat3 -d -m gdx-25.orsay.grid5000.fr

This command prints all the deployment performed on the node gdx-25.orsay.grid5000.fr.

Use case 2 - get the information about deployments performed on a range of node

> kastat3 -d -m gdx-[25-130].orsay.grid5000.fr

This command prints all the deployment performed on the nodes gdx-25.orsay.grid5000.fr, gdx-26.orsay.grid5000.fr, ..., gdx-130.orsay.grid5000.fr.

Use case 3 - print only a subset of the information about the deployments performed

> kastat3 -d -f hostname -f env -f success

This command prints all the deployment performed. Because the -f|�field option is used, onlythe �elds hostname, env, and success are printed. If the option -f|�field is not used, all the �eldsare printed.

Use case 4 - print the failure rate about the nodes wrt the deployments that occursbetween two dates

> kastat3 -b -x 2009:02:12:08:00:00 -y 2009:02:13:08:00:00

This command prints the failure rate of all the nodes (at least deployed one time) during the periodbetween the 2009/02/12 - 8h00 and the 2009/02/13 - 8h00. The -x|�date-min and -y|�date-max

options can be used separately or can be omitted.

Page 36: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 35

Use case 5 - print the information about the nodes that have at least a given failurerate

> kastat3 -c 25 -x 2009:02:12:08:00:00

This command prints the nodes that have a failure rate of at least 25% from the 2009/02/12 - 8h00.

Use case 6 - print the information about the nodes that require several retries to deploycorrectly

> kastat3 -a 3 -s 1

This command prints the information about the deployments that requires at least 3 retries inthe macro-step 1. If the -s|�step option is not set, the information about the deployments thatrequires at least 3 retries in any macro-step are printed.

4.2.7 Kanodes

Kanodes can be used by using the kanodes3 command. The CLI looks like this:

> kanodes3 -h

Usage: kanodes3 [options]

Contact: [email protected]

General options:

-d, --get-deploy-state Get the deploy state of the nodes

-f, --file MACHINELIST Only print information about the given machines (- means stdin)

-m, --machine MACHINE Only print information about the given machines

-v, --version Get the version

-w, --workflow-id WID Specify a workflow id (this is use with the get_yaml_dump

operation. If no wid is specified, the information of all

the running worklfows will be dumped

-y, --get-yaml-dump Get the yaml dump

--server STRING Specify the Kadeploy server to use

We present now the use cases.

Use case 1 - print the deployment state of the nodes

> kanodes3 -d

This command prints the global state of all the nodes managed by a Kadeploy server. The outputis as follows 1,2,3,4,5,6, where :

• 1 is the hostname ;

• 2 is the deployment state of the node (prod_env, deployed, deploy_failed, aborted) ;

• 3 is the username who launched the last deployment ;

• 4 is the environment name ;

• 5 is the environment version ;

• 6 is the environment owner.

Page 37: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 36

Use case 2 - print the deployment state of some nodes

> kanodes3 -d -m gdx-25.orsay.grid5000.fr -m netgdx-[1-30].orsay.grid5000.fr -f machine_file

This command prints the global state of the node gdx-25.orsay.grid5000.fr the nodes netgdx-1.orsay.grid5000.fr, netgdx-2.orsay.grid5000.fr, ..., netgdx-30.orsay.grid5000.fr and of the nodeslisted in the �le machine_file.

Use case 3 - get information about all the current deployment work�ows

> kanodes3 -y

This command prints a YAML output of the deployment state of all the nodes currently in de-ployment. On the YAML output, the nodes are sorted according to the deployment work�ow theybelong to.

Use case 4 - get information about a speci�c deployment work�ows

> kanodes3 -y -w 78

This command prints a YAML output of the deployment state of all the nodes currently in thedeployment number 78. The deployment number, or work�ow id, can be obtained thanks to aKadeploy option.

4.2.8 Kapower

Kapower can be used by using the kapower3 command. The CLI looks like this:

> kapower3 -h

Usage: kapower3 [options]

Contact: [email protected]

General options:

-d, --debug-mode Activate the debug mode

-f, --file MACHINELIST Files containing list of nodes (- means stdin)

-l, --level VALUE Level (soft, hard, very_hard)

-m, --machine MACHINE Operate on the given machines

--multi-server Activate the multi-server mode

-n, --output-ko-nodes FILENAME File that will contain the nodes on which

the operation has not been correctly performed

-o, --output-ok-nodes FILENAME File that will contain the nodes on which the

operation has been correctly performed

--off Shutdown the nodes

--on Power on the nodes

--status Get the status of the nodes

-v, --version Get the version

--no-wait Do not wait the end of the power operation

--server STRING Specify the Kadeploy server to use

-V, --verbose-level VALUE Verbose level between 0 to 4

Page 38: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 37

Use case 1 - print the power status of some nodes

> kapower3 --status -m gdx-[25-35].orsay.grid5000.fr -o nodes_up -n nodes_down

This command print the power status of the nodes gdx-25.orsay.grid5000.fr to gdx-35.orsay.grid5000.fr. Furthermore, the list of the powered up nodes is stored in nodes_up andthe list of the powered o� nodes is stored in nodes_down.

Use case 2 - power o� some nodes

> kapower3 --off -f machine_file --server lille

This command powers o� the nodes nodes contained in the machine_file �le. Since the �serveris used, the nodes of a distant site are concerned by the operation ; in this example, the lille siteis concerned.

Use case 3 - power on some nodes

> kapower3 --on -m gdx-25.orsay.grid5000.fr --no-wait

This command powers on the node gdx-25.orsay.grid5000.fr without waiting the end of the opera-tion to return.

Note for the administrators While using the �no-wait option, Kapower add the �no-wait

value to the command line used for the given operation. Thus the underlying power managementtool must be able to handle this option if this Kapower option is required.

4.2.9 Karights

Karights can be used by using the karights3 command (it is designed for administrators in orderto allow users to perform deployments). The CLI looks like this:

> karights3 -h

Usage: karights3 [options]

Contact: [email protected]

General options:

-a, --add Add some rights to a user

-d, --delete Delete some rights to a user

-f, --file FILE Machine file (- means stdin)

-m, --machine MACHINE Include the machine in the operation

-o, --overwrite-rights Overwrite existing rights

-p, --part PARTNAME Include the partition in the operation

-s, --show-rights Show the rights for a given user

-u, --user USERNAME Specify the user

-v, --version Get the version

--server STRING Specify the Kadeploy server to use

We present now the use cases.

Page 39: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 38

Use case 1 - give some rights to a user on a node

> karights3 -a -m gdx-25.orsay.grid5000.fr -p /dev/sda3 -u johnsmith

This command gives some rights for a given user.

Use case 1 - give some rights to a user on several nodes

> karights3 -a -m gdx-[25-32].orsay.grid5000.fr -p /dev/sda3 -u johnsmith

This command gives some rights for a given user on a range of nodes.

Use case 3 - give all the rights to a user on all the nodes

> karights3 -a -m "*" -p "*" -u root

This command gives all the rights on all the nodes to the user root.

Use case 4 - give some rights on a node and remove existing ones

> karights3 -a -m gdx-25.orsay.grid5000.fr -p /dev/sda3 -u johnsmith -o

This command gives some rights for a given user. Furthermore, if some rights (excepted thosespeci�ed with *) were previously given on the node gdx-25.orsay.grid5000.fr, they are deleted.

Use case 5 - remove som rights

> karights3 -d -m gdx-25.orsay.grid5000.fr -p /dev/sda3 -u johnsmith

This command removes some rights for a given user.

Use case 6 - show the rights of a user

> karights3 -s -u johnsmith

This command shows the rights given to user.

4.3 What you should know if you want to do kernel develop-

ment on deployed nodes

Kernel development implies to know what Kadeploy do concerning the boot of the deployed envi-ronments.

4.3.1 Kadeploy 3 behavior

Kadeploy 3 has a di�erent behavior depending on the kind of deployed environment. Reminder:the kind of environment is de�ned in the environment description.

Page 40: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 39

Linux environments

On a Linux environment, Kadeploy 3 automatically installs the Grub 2 bootloader on the deployedpartition once the tarball is broadcasted. Then it modi�es the PXE pro�le of the concerned nodesin order to ask the chainload on the deployed partition. This is performed thanks to pxelinux andthe comboot chain.c32.

Xen environments

On a Xen environment, Kadeploy 3 doesn't install the Grub 2 bootloader since Grub 2 there aresome known issues when booting a Xen Dom0 with Grub 2. Thus Kadeploy 3 uses the old methodthat consists in booting the nodes in a pure PXE fashion. To do that, Kadeploy extracts thekernel, initrd and hypervisor �les from the environment tarball and modi�es the PXE pro�le of theconcerned nodes in order to ask their in pure PXE. This is performed thanks to pxelinux and thecomboot mboot.c32.

Other environments

On anOther environment, Kadeploy 3 assumes that a bootloader is already installed on the partitionsince a full partition image (dd.gz image) has been copied. Thus, it only modi�es the PXE pro�leof the concerned nodes in order to ask the chainload on the deployed partition, like in the Linuxcase.

4.3.2 Tips to simply use your new kernel

If you do kernel development on the deployed nodes, you will probably want to update you kernelwithout recording a new image and redeploying it to save time, especially to perform small tests.

Linux environments

On a Linux environment, after having updated your kernel/initrd, 2 cases are imaginable:

1. your kernel/initrd have the same name, so you can reboot the node without modifying any-thing.

2. your kernel/initrd have a new name, so you will have to update the grub con�guration �le(/boot/grub/grub.cfg) of your node in order to allow grub to select the new kernel and thenyou can reboot the node.

Xen environments

On a Xen environment, the things are a little bit more complicated. As far as the ker-nel/initrd/hypervisor are extracted by Kadeploy in a dedicated cache, changing them on the de-ployed nodes won't have any e�ect for the next reboot. So you have to use a feature of Karebootthat allows to reboot a node after having changed the PXE pro�le of the node. For instance:

> kareboot3 -m gdx-25.orsay.grid5000.fr -r set_pxe -w ~/pxe_profile_xen \

-x "~/custom_kernel,~/custom_initrd,~/custom_hypervisor"

Page 41: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 40

Kadeploy has the same feature, so please refer to the use case about speci�c PXE pro�le for moreinformation.

Other environments

On an Other environment, you eventually have to update your bootloader in order to boot on thenew kernel.

4.4 Migrate your Kadeploy 2.1.x environment

Migrating your environments from Kadeploy 2.1.x is quite easy. Please refer to the 4.2.4 part toget the full information about the environment description with Kadeploy 3.

Di�erences

The �elds used in the previous descriptions are similar. This following �elds are exactly the same:name, version, description, author, fdisktype, and filesystem. You just have to replace the= character with : for these �elds. Then, the old filebase and filesite have been modi�ed andrenamed in tarball and postinstall.

Kadeploy 3 considers three kinds of environments: linux, xen, and other. The environment kindmust be speci�ed with the �eld environment_kind.

• If you choose the linux kind, you can �ll the new kernel �eld by using the old kernelpath

�eld. This is the same thing with the new initrd �eld where you can use the old initrdpath.The new kernel_params �eld can be �lled with the old kernelparam.

• If you choose the xen, you must use the �elds of a linux environment and the new hypervisor

and hypervisor_params. You do not have to specify anymore the use of mboot.c32, this isautomatically handled by Kadeploy 3.

• If you choose the other kind (typically for OS like FreeBSD), you can �ll the kernel,kernel_params and initrd with any value.

The �eld part has been added to allow the users to specify a default deployment partition fortheir environment. The expected value must be an existing block device like /dev/sda3.

Automatic translation

A small script named env_migrate has been written to ease the translation of the old Kadeployenvironment. The CLI looks like this:

> kaenv2to3 -h

Usage: kaenv2to3 [options]

Contact: [email protected]

General options:

-e, --env-name NAME Environment name

-f, --env-file FILE Environment file

-k, --env-kind KIND Environment kind (linux|xen|other)

Page 42: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 41

To use kaenv2to3, you have to choose the kind of environment you wish to migrate and youhave to choose the environment. The choice can be made in two ways:

• choosing the environment from its name in the old version of Kadeploy (like it can be seenwith the kaenvironments output) ;

• choosing the environment from a �le that contains the description in the old format.

Here are two examples:

> kaenv2to3 -e envname_in_kaenvironments_db -k linux

> kaenv2to3 -f envfile_in_2_1_x_format.dsc -k xen

If everything went right, the output of kaenv2to3 shows the description in the new format. Youcan redirect this output to a �le and use this �le as an input for kaenv.

4.5 Environment variables in the pre- and post-install context

When writing a script for an admin pre-install, an admin post-install and a user post-install, youcan use the following environment variables :

• KADEPLOY_CLUSTER : cluster on which the pre/post install is launched

• KADEPLOY_ENV : environment deployed

• KADEPLOY_DEPLOY_PART : deployment partition

• KADEPLOY_ENV_EXTRACTION_DIR : path where the environment tarball is extracted

• KADEPLOY_PREPOST_EXTRACTION_DIR : path where the pre/post tarball are extracted

4.6 Build a custom pre-install

The goal of the pre-install in the Kadeploy work�ow is to prepare the disk of the nodes before thecopy of the environment. It can include:

• setting disk parameters (with hdparm for instance) ;

• partitioning the disk (with fdisk or parted) ;

• formating the deployment and the /tmp partition ;

• mounting partition(s).

You can do want you want in the pre-install but you must that Kadeploy will extract theenvironment in the directory de�ned by the environment_extraction_dir �eld of the generalcon�guration �le. Commonly, this directory is /mnt/dest. Thus, you have to mount all thepartitions you need in this directory. If you wish to deploy the environment onto several partitions,you can use for instance the following map:

• /dev/sda3 7→ /mnt/dest

Page 43: Kadeploy 3: Installation, con guration and use · Chapter 1 Installation 1.1 Requirements 1.1.1 Pacagesk Kadeploy requires the following softwares (the Debian pacagesk aailablev in

CHAPTER 4. USER GUIDE 42

• /dev/sda4 7→ /mnt/dest/var

• /dev/sda5 7→ /mnt/dest/usr

• /dev/sda6 7→ /mnt/dest/tmp

If you choose to mount more than one partition in the pre-install, remember to umount all thepartitions excepted the one mounted on environment_extraction_dir (/mnt/dest in principle)in the post-install step. Indeed, the common Kadeploy work�ow will automatically umount thepartition mounted on environment_extraction_dir. Thus, if other partitions are mounted, theumount will fail.