Managing environments

From Grid5000
Jump to: navigation, search


Record his own environment

This is done using the karecordenv command. It allows to create a pointer in the Kadeploy database to your archive and associate to it a name, that can be recalled by the kadeploy command, as well as a post-install archive to finely adjust some system files and make the system bootable on each different deployed node. An environment thus consists of this association between an image archive, a name and a post-install archive, along with some other minor parameters.

To find all the parameters of this command, one method is to read the output of karecordenv -h.

Usage : karecordenv
        -n  | --name             environment name
        -v  | --version          version              (default is 1)
        -d  | --description      description
        -a  | --author           author's email
        -fb | --filebase         environment image path
        -ft | --filesite         post-installation file path
        -s  | --size             size (Mo)
        -i  | --initrdpath       initrd path
        -k  | --kernelpath       kernel path
        -p  | --param            kernel parameters
        -fd | --fdisktype        fdisk type           (default is 83)
        -fs | --filesystem       file system          (default is ext2)
        -o  | --optsupport       optimisation support (default is 0)
        -fe | --file_environment
        -h                       get this help message

A typical command line could hence be:

Terminal.png frontend:
karecordenv -n "sid-x64-base-myLoginName" \
-v 1 \
-d "customized sid-x64-base by myFullName" \
-a myEmailAddress \
-fb file:///home/mySite/myLoginName/myPath/myImage.tgz \
-ft file:///grid5000/postinstalls/sid-x64-base-1.0-post.tgz \
-i /boot/initrd.img-2.6.18-3-amd64 \
-k /boot/vmlinuz-2.6.18-3-amd64 \
-fd 83 \
-fs ext3

Here, the -i and -k parameters are pointers to system files within your environment needed to build the correct boot loader (Kadeploy uses "pxelinux"). The files in the preceding example correspond to the default kernel installed in the sid-x64-base-1.0 environment, which are still valid in our customized environment (unless we had recompiled another kernel...).

Recording a classical tgz based environment

When customizing an already existing environment, it could be easier to restart from the original record, since karecordenv also accepts a file as a single parameter, following the output format of kaenvironments -e. For instance:

Terminal.png frontend:
kaenvironments -e sid-x64-base-1.0 > myEnvironment.env

You may then edit the content of the myEnvironment.env file:

#sid-x64-base-1.0 v1
name = sid-x64-base-1.0
id = 376
version = 1
description =
author =
filebase = file:///grid5000/images/sid-x64-base-1.0.tgz
filesite = file:///grid5000/postinstalls/sid-x64-base-1.0-post.tgz
size = 1000
initrdpath = /boot/initrd.img-2.6.18-3-amd64
kernelpath = /boot/vmlinuz-2.6.18-3-amd64
kernelparam = 
fdisktype = 83
filesystem = ext2
siteid = 1
optsupport = 0
user = deploy


  1. update the name, description, author and filebase lines
  2. delete the id, size, version and user lines
  3. save
  4. and then record your environment with:
Terminal.png frontend:
karecordenv -fe myEnvironment.env


Terminal.png frontend:
kaenv3 -a myEnvironment.env
Note.png Note

On this part, we used a default postinstall but if you to customized your environment more precisely, you can take a look to the Prepost page.

Recording a dd based environment

If you are using a dd image, you have to record tour environment like this :

name = dd-image-1
description = My first dd image
author =
filebase = file:///home/Mysite/login/your_dd_image.dd.gz
filesite = file:///dev/null
kernelpath = chainload
fdisktype = 83
filesystem = ext2

As you can see to record an environment based on a dd file, you need to specify the chainload keyword and to remove filesite and initrd stuff. Once the description correctly modified, you can record it like for the classical tgz environment.

Note.png Note

To deploy a dd based environment, you have to use --grub switch on the kadeploy command line on clusters which support it (capricorne, gdx, azur, bordemer)

Delete environment from dataBase

Terminal.png frontend:
kaenvironments -d myEnvironmentName
Personal tools

Public Portal
Users Portal
Admin portal
Wiki special pages