Lenny-x64-xen-2.0

From Grid5000
Jump to: navigation, search


Warning.png Warning

This environment has been marked as deprecated since 3 June 2013. Please consult the Environment_Management#Deletion_and_Deprecation to know what it means for this environment.

This page describes the 2.0 version of the xen environment based on Lenny version of Debian distribution for AMD64/EM64T machines. It intends to explain how this environment was built and how to use it with Kadeploy. This page is inspired from Lenny-x64-xen-1.0.

Contents

Identification sheet

Lenny-x64-xen-2.0

Kernel version 2.6.26-2-xen-amd64 from Debian for amd64/em64t

Authentication

  • Remote console: enabled on ttyS0 at 34800 bps
  • Services: ldap:no, nfs:no
  • Accounts: root:grid5000,g5k:grid5000

Applications

Misc

Build

Here are explanations on how the system was installed and tuned from a Lenny-x64-base-2.0.

Motd

Motd is updated :

cat > /etc/motd.tail <<EOF
Lenny-x64-xen-2.0 (image based on Debian version Lenny/stable for AMD64/EM64T)
Maintained by Cyril Constantin <cyril.constantin@loria.fr>
Valid on Dell {PE1855, PE1950}, HP {DL140G3, DL145G2, DL385G2}, 
       IBM {e325, e326, e326m}, Sun {V20z, X2200 M2, X4100},
       Altix Xe 310, Carri CS-5393B
Applications
* Text: Vim, XEmacs, JED, nano, JOE
* Script: Perl, Python, Ruby
  (Type "dpkg -l" to see complete installed package list)
Misc
* i386 shared libraries are available
* SSH has X11 forwarding enabled
* Max open files: 8192
* TCP bandwidth: for 1Gbs
More details: https://www.grid5000.fr/index.php/Lenny-x64-xen-2.0
EOF

Packages

Xen kernel and additionnal packages are necessary.

aptitude update
aptitude full-upgrade
aptitude install linux-image-xen-amd64

It's time to record the environment and reboot on the xen kernel.

aptitude install debootstrap xen-tools sysfsutils lvm2 libyaml-ruby 
aptitude purge linux-image-2.6.26-2-amd64 linux-image-2.6-amd64 linux-headers-2.6-amd64 linux-headers-2.6.26-2-amd64

Configuration

Xen and xen-tools packagse must be reconfigured

sed -i -e 's/^# (\(network-script network-bridge\))$/(\1)/' /etc/xen/xend-config.sxp
sed -i -e '/network-dummy/d' /etc/xen/xend-config.sxp
cat > /etc/xen-tools/xen-tools.conf <<EOF
dir = /opt/xen
debootstrap = 1
size   = 400Mb      # Disk image size.
memory = 128Mb    # Memory size
swap   = 128Mb    # Swap size
fs     = ext3     # use the EXT3 filesystem for the disk image.
dist   = lenny    # Default distribution to install.
image  = sparse   # Specify sparse vs. full disk images.
dhcp = 1
kernel = /boot/vmlinuz-2.6.26-2-xen-amd64
initrd = /boot/initrd.img-2.6.26-2-xen-amd64
arch=amd64
mirror = http://ftp.fr.debian.org/debian/
ext3_options   = noatime,nodiratime,errors=remount-ro
serial_device = hvc0
disk_device = xvda
EOF

A key is necessary to log on domU from dom0

ssh-keygen -f /root/.ssh/id_rsa -q -C "dom0 lenny-x64-xen-2.0 key" -N ""

Ssh security is too restrictive

echo "StrictHostKeyChecking no" > /root/.ssh/config

Xen-tools provide a solution to add file we want in domU by automated method.

mkdir -p /etc/xen-tools/skel/root/.ssh
cat /root/.ssh/id_rsa.pub > /etc/xen-tools/skel/root/.ssh/authorized_keys
mkdir -p /etc/xen-tools/skel/etc/apt/apt.conf.d/
cat > /etc/xen-tools/skel/etc/apt/apt.conf.d/proxy <<EOF
Acquire::http::Proxy "http://proxy:3128";
EOF
cp /etc/localtime /etc/xen-tools/skel/etc/localtime

domU creation

Xen-tools lenny package has a bug in devices creation.

sed -i -e 's#\./MAKEDEV#MAKEDEV#' /usr/lib/xen-tools/debian.d/55-create-dev 

The udev role is necessary to add console access and tty (ssh) to domU.

xen-create-image --hostname=domU --role=udev

domU is automatically created at boot.

mkdir -p /etc/xen/auto
ln -s /etc/xen/domU.cfg /etc/xen/auto/ 

Automatic tools

As for lenny-x64-xen-1.0, additionnal tools are added.

Definition file contains cluster definitions

cp /root/xen/definitions.yaml /etc/

xen-g5k reconfigure automatically domU network

cp /root/xen/xen-g5k /etc/init.d/
update-rc.d xen-g5k defaults 19
cp /root/xen/automatic_xen_conf.rb /usr/local/bin/

xenconf and xenlist allow to interrogate omapi proxy to learn domU ip address and dns naming.

cp /root/xen/xenconf /usr/local/bin/
cp /root/xen/xenlist /usr/local/bin/

xenkeys allow to copy user key on domUs.

cp /root/xen/xenkeys /usr/local/bin/

xen-addvm allow to automate domU création by lvm snapshot method.

cp /root/xen/xen-addvm /usr/local/bin/
Note.png Note

It use /tmp partition /dev/xda5 to create lvm partition.

  • At this moment, there is no process for correcting /tmp at the next reboot.
  • For this reason, this script is desactivated. Just uncomment the 3 lines in function main at the end of the script to activate it.
  • /tmp will be erased and should be recreated at the end of your réservation with an ext3 filesystem.
  • To do this, execute :
lvremove -f /dev/g5k/* && vgremove -f g5k && mkfs.ext3 /dev/sda5 && mount -a

Mark

Finally, the date of the release is updated.

date > /root/release

Environment

Creating image's archive

Now, a valid minimal environment has been build. Its corresponding image file has to be generated. At this point, the environment contains configuration files that depends of the site which installs it. These files must be excluded from image archive to stay as neutral as possible.

System archive creation and retrieving is now an easy task:

tgz-g5k login@frontend:lenny-x64-xen-2.0.tgz

Creating postinstall's archive

Postinstall archive is the etch-x64-base-2.0 postinstall.

Recording environment

Recording environment can be done from a description file. So we create lenny-x64-xen-2.0.dsc:

name = lenny-x64-xen-2.0
description = https://www.grid5000.fr/index.php/Lenny-x64-xen-2.0
author = cyril.constantin@loria.fr
filebase = file:///grid5000/images/lenny-x64-xen-2.0.tgz
filesite = file:///grid5000/postinstalls/etch-x64-base-2.0-post.tgz
size = 1000
initrdpath = /boot/xen-3.2-1-amd64.gz dom0_mem=1000000 --- /boot/vmlinuz-2.6.26-2-xen-amd64 --- /boot/initrd.img-2.6.26-2-xen-amd64
kernelpath = mboot.c32
fdisktype = 83
filesystem = ext3

With kaenvironments, the new environment can be known by Kadeploy:

kaenvironments --add /grid5000/images/lenny-x64-xen-2.0.dsc
Personal tools
Namespaces

Variants
Actions
Public Portal
Users Portal
Admin portal
Wiki special pages
Toolbox