Deployment of environment
Kadeploy's options description
ejeanvoi@g5kdev:~$ kadeploy -h Use : kadeploy [-m | --machine hostname] [-f | --file node_file] Choose -m XOR -f [-e | --environment environment_name] [-d | --device device] [-p | --partition partition] [-h | --help] This help message [-l username] Default : ejeanvoi [-k | --keys] Add ssh keys at the end of the deployment [-D | --debug-level level] 4 : show all ... 0 : hide all [-r | --reformat-tmp] Re-format the /tmp partition [-F | --fast-kernel-reboot] Use kexec to reboot quickly (only works with Linux env) [-u | --use-prod-env] Use the production environment to deploy [-s | --script script] Launch a script after a deployment
- -m|--machine: lets your specify the node to deploy. This option can be used several time in a command line (eg.: kadeploy -m paraquad-10.rennes.grid5000.fr -m paraquad-12.rennes.grid5000.fr -e sid-x64-base-1.0). Warning, if you use this option, do not use -f|--file
- -f|--file: lets you specify a file that contains a list of nodes to deploy. Warning, if you use this option, do not use -m|--machine
- -e|--environment: lets you specify the name of the environment to deploy on the nodes
- -d|--device: lets you specify a device if you do not wish to use the default one. A valid value may be sdb if you wish to use /dev/sdb
- -p|--partition: lets you specify a partition if you do not wish to use the default one. A valid value may be 6 if you wish to use /dev/sda6
- -D|--debug-level: lets you specify the level of verbosity. Default level is 0.
- 0: you only want the result of kadeploy, suitable for end-user
- 1: you want to know in which step is kadeploy
- 2: you want a normal verbosity level
- 3: you want an advanced verbosity level, suitable for debug
- 4: you want the more verbose level, all the syscall's outputs are shown
- -r|--reformat-tmp: lets you specify if you want to reformat the /tmp partition on the nodes. By default this step is bypassed
- -F|--fast-kernel-reboot: lets you specify if you want to use an optimization that performs a fast reboot if you deploy a Linux based environment. This is highly recommended to avoid some node failures due to the classical reboot method. Warning : this is an experimental feature.
- -u|--use-prod-env: lets you specify if you assume that the nodes are booted on the production environment and if you want to use this environment to perform the deployment instead of booting on the dedicated deployment environment. This method allows to remove a reboot in the process and can avoid some node failures due to the reboot. Warning : this is an experimental feature.
- -s|--script: lets you specify the path to a script that must be executed at the end of the deployment. Warning, the file must have execution rights.
Experimental features are not meant to be functional out-of-the-box. They may be still in development or not functional on all sites or configurations.
Make a reservation with OAR
The first step to deploy your environment (see the part concerning the environment management) on some nodes is to make reservation with OAR in the deploy queue. For instance:
oarsub -t deploy -I
Deployment of a node
Once you have made a reservation for one node, get the name of the reserved node. We suppose that the node is called my_node and you wish to deploy the my_tuned_environment environment. Then you can run kadeploy:
kadeploy -m my_node -e my_tuned_environment
Deployment of several nodes
If you have reserved several nodes called my_node_1, my_node_2, ..., my_node_n you can either do
kadeploy -m my_node_1 -m my_node_2 ... -m my_node_n -e my_tuned_environment
or you can put these nodes in a file (called my_node_file for the example) and do
kadeploy -f my_node_file -e my_tuned_environment
You can note that my_node_file can contains doubles, as a consequence, the file generated by OAR can be directly use (if you are in the good OAR environment) like this
kadeploy -f $OAR_NODEFILE -e my_tuned_environment
Nodes that belong to several clusters on a site
Kadeploy allows to deploy nodes that belong to several clusters in one shot. To perform that, just do nothing, Kadeploy will launch as many commands as the number of clusters involved.
Deployment of a multiboot system image
the term multiboot refers to environments requiring more than a kernel and a ramdisk parameters to boot
Kadeploy-2.1.7 supports the boot of Xen Linux images, which requires a multiboot environment.
Actually such environments need to boot first an hypervisor, then a kernel and at last the ramdisk. These 3-part boot is handled by the PXE COMBOOT32 image
A correct PXE configuration boot file must look like in this page : Xen and PXElinux
PXE configuration files are generated by Kadeploy from the environmenet description file, especially sourced from the values of
This 2 values must follow the PXELinux syntaxe, e.g. :
initrdpath = /boot/xen-3.0.3-1-amd64.gz dom0_mem=262144 --- /boot/vmlinuz-2.6.18-6-xen-amd64 --- /boot/initrd.img-2.6.18-6-xen-amd64 kernelpath = mboot.c32
- Notes :
kernelpathvalue is only
mboot.c32; it implies to put that file at TFTP root (e.g. :
initrdpathcarries in fact all the boot items ; each item is separated by ---.
Do not use the
Once a deployment is performed, you will get two kinds of output.
- Output to STDOUT. For instance:
Node State Error Description (if any) ---- ----- -------------------------- sagittaire-76.lyon.grid5000.fr deployed sagittaire-75.lyon.grid5000.fr deployed sagittaire-74.lyon.grid5000.fr deployed sagittaire-78.lyon.grid5000.fr deployed sagittaire-71.lyon.grid5000.fr deployed sagittaire-70.lyon.grid5000.fr error Preinstall failed on node sagittaire-77.lyon.grid5000.fr deployed sagittaire-72.lyon.grid5000.fr deployed sagittaire-79.lyon.grid5000.fr deployed
- Output to files in your current directory
- kadeploy-$user-$cluster-nodes_ok.out: contains the list of the nodes correctly deployed on the cluster $cluster
- kadeploy-$user-$cluster-nodes_nok.out: contains the list of the nodes not correctly deployed on the cluster $cluster
Typical kadeploy use for end-users
In the most common case, if you are a end-user and if you wish to deploy the default environment, you should perform the following command after having reserved some nodes with OAR
kadeploy -f $OAR_NODEFILE -e sid-x64-base-1.0
How to list the environments of a site ?
- You can list the default environments and your personal environments using:
- You can list the default environments and the personal environments of somebody using:
kaenvironments -l somebody
How to create a personalized environment ?
To create a personalized environment, there are two solutions : use an existing environment and personalizing it or creating an environment from scratch.
Modification of an existing environment
- First of all, you need to log on a frontend. Then you have to make a reservation with OAR in deploy queue (please look at OAR for more informations about OAR. For instance:
oarsub -I -l nodes=1,walltime=2
- Then deploy the existing environment on the resserved node:
kadeploy -e environment -m `cat $OAR_NODEFILE|uniq`
- Tune the environment on the deployed node
- When you have finished, turn-off udev on the deployed node if the environment uses it, for instance on a debian-like system:
- Dump the environment on the frontend in a file
- If you are using a Debian/Linux environment, you can use TGZ-G5K.
- If you are using a Linux based environment : after having deployed your environment on the deployment partition (eg. /dev/sda3), perform the following command
ssh root@node "tar --posix --numeric-owner --one-file-system -zcf - /" > my_new_environment.tar.gz
- If you are not using a Linux based environment : after having deployed your environment on the deployment partition (eg. /dev/sda3), reboot on the production environment and perform the following command
ssh root@node "dd if=/dev/sda3" | gzip > my_new_environment.dd.gz
How to get informations about an environment ?
kaenvironments -e an_environment_name
kaenvironments -e etch-x64-base-1.0 2>/dev/null using settings for default cluster No environment named 'etch-x64-base-1.0' with user bdexheimer #etch-x64-base-1.0 v1 name = etch-x64-base-1.0 id = 779 version = 1 description = https://www.grid5000.fr/index.php/Etch-x64-base-1.0 author = firstname.lastname@example.org filebase = file:///grid5000/images/etch-x64-base-1.0.tgz filesite = file:///grid5000/postinstalls/etch-x64-base-1.0-post.tgz size = 1000 initrdpath = /boot/initrd.img-2.6.18-6-amd64 kernelpath = /boot/vmlinuz-2.6.18-6-amd64 kernelparam = fdisktype = 83 filesystem = ext2 siteid = 1 optsupport = 0 user = deploy
How to record an environment ?
Once your customized environment created, you have to record it into the site local Kadeploy DB from the frontedn :
kaenvironments -a my_environment.dsc
my_environment.dsc is the environment's description file. You have to create such a file each time you want to record a new environment. It's a simple text file which contains informations to be recorded into the Kadeploy'DB.
To create such a file, the easiest way is to modify an existing description (cf above).
- Copy the end of the output from the line that contains name = env_name into a file (eg. my_desc.env)
- Update the fields of the description (name, environment file, user, kernel path, ...) and save the file
- Record the environment using the commande
kaenvironments --add my_image.dsc 2>/dev/null using settings for default cluster using settings for default cluster Environment registration successfully completed.
How to remove an environment ?
Removing (deleting) an environment from the site local Kadeploy DB :
kaenvironments -d env_name_to_delete
my_environment is the environment name recorded into Kadeploy's DB, not a full pathname to the description file
kaenvironments -d my_image 2>/dev/null environment my_image deleted succefully
kareboot allows users to reboot nodes for which they've been granted rights to do so.
Keep in mind that nodes boot sequence is managed entirely by Kadeploy's processes, so it's strongly recommanded to use kareboot to do this.
If direct commands are used to reboot nodes (e.g. :
/sbin/reboot), you may expect in some particular circumstances a reboot failure at the TFTP level.
kareboot -p sda3 -m grelon-23.nancy.grid5000.fr -m grelon-24.nancy.grid5000.fr
Users are allowed to gain direct console access on the nodes for which they received the right to do so.
The dedicated command is :
kaconsole -m grelon-24.nancy.grid5000.fr
Differences between releases 2.1.6 and 2.1.7
Please take a look at the mail announcing this vew version
Kadeploy 2.1.6 looks like this :
Use : kadeploy [-m | --machine hostname] [-f | --file node_file] Choose -m XOR -f [-e | --environment environment_name] [-p | --partition partition] [-h | --help] This help message [-l username] Default : bdexheimer
In comparison with the help output of release 2.1.7 (head of this page), new options are the following :
- -p | --partition : not exactly a new one but behaviour has changed : r2.1.7 needs only the partition number (e.g. : 3).
- -d | --device : according to the previous option, it provides to kadeploy the device part of the partition (e.g. : sda).
- -k | --keys : allows the user to provide SSH keys into the deployed environment.
- -D | --debug-level : verbosity of Kadeploy ; -D 0 allows a silent execution.
- -r | --reformat-tmp : allows the user to request a format of /tmp.
- -F | --fast-kernel-reboot : replace last reboot by a kexec reboot (no BIOS initialization)
- -u | --use-prod-env : use production environment to deploy the environment (first reboot saved)
- -s | --script : a user dedicated slot for executing a script after deployment
kaenvironments gathers all management operations : record, delete, get informations.
- Multi-cluster deployment in one command.
- Multiboot environment deployment.
- Revamped management of cached files (kernels and ramdisks in PXE deployments) and of PXE generated files in order to save space.
- Revamped process of deployment environment (kernel/ramdisk) : up-to-date deployment kernel could easily be generated.