Managing environments
From Grid5000
Contents |
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 | --nameenvironment name-v | --versionversion (default is 1)-d | --descriptiondescription-a | --authorauthor's email-fb | --filebaseenvironment image path-ft | --filesitepost-installation file path-s | --sizesize (Mo)-i | --initrdpathinitrd path-k | --kernelpathkernel path-p | --paramkernel parameters-fd | --fdisktypefdisk type (default is 83)-fs | --filesystemfile system (default is ext2)-o | --optsupportoptimisation support (default is 0)-fe | --file_environment-hget this help message
A typical command line could hence be:
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:
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 = https://www.grid5000.fr/index.php/Sid-x64-base-1.0 author = xavier.delaruelle@loria.fr 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
Just:
- update the
name,description,authorandfilebaselines - delete the
id,size,versionanduserlines - save
- and then record your environment with:
or
| 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 = you@lab.fr filebase =file:///home/Mysite/login/your_dd_image.dd.gzfilesite = file:///dev/null kernelpath =chainloadfdisktype = 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 | |
|---|---|
To deploy a | |
