Installation XEN : Différence entre versions

De Wiki_DR13
Aller à : navigation, rechercher
 
(45 révisions intermédiaires par 2 utilisateurs non affichées)
Ligne 1 : Ligne 1 :
 +
== Installation du Dom0 ==
 +
 +
'''Install Debian''' par defaut avec lvm, decocher toutes les options lors de l'install des paquets:
 +
nom du lvm : lvm1 (pour les scripts)
 +
 +
 +
'''Installer ssh'''
 +
apt-get install ssh
 +
 +
 +
'''Installer le systeme xen :'''
 +
apt-get install linux-image-2.6-xen-686 xen-hypervisor-3.0.3-1-i386-pae xen-ioemu-3.0.3-1 xen-tools xen-utils-3.0.3-1 \
 +
xen-utils-common linux-image-2.6.18-6-xen-686 xen-linux-system-2.6.18-6-xen-686 bridge-utils libc6-xen
 +
 +
 +
'''Configurer le bridge :'''
 +
 +
vim /etc/xen/xend-config.sxp
 +
 +
Decommenter :
 +
(network-script network-bridge)
 +
 +
 +
'''Configurer les outils :'''
 +
vim /etc/xen-tools/xen-tools.conf
 +
 +
lvm = lvm1
 +
debootstrap = 1
 +
dist  = etch
 +
gateway  = 193.49.133.1
 +
netmask  = 255.255.255.0
 +
passwd = 1
 +
kernel = /boot/vmlinuz-2.6.18-6-xen-686
 +
initrd = /boot/initrd.img-2.6.18-6-xen-686
 +
mirror = http://ftp.fr.debian.org/debian/
 +
 +
 +
'''Configurer le partage nfs :'''
 +
mkdir /save
 +
 +
Ajouter dans la fstab :
 +
erasme:/save/domU  /save nfs soft,timeo=5,intr,rsize=8192,wsize=8192  0  0
  
== Commandes principales ==
 
  
 +
'''redemarrer''' le serveur qui va booter sur xen
  
Les fichiers d'images sont dans /home/xen/domains
+
== Liste des serveurs virtuels ==
  
 
pour voir les serveurs en cours sur un hôte :
 
pour voir les serveurs en cours sur un hôte :
  
 
  # xm list
 
  # xm list
 +
 +
{{Virtual_tabl}}
 +
 +
== Commandes principales ==
 +
 +
 +
Les fichiers d'images sont dans /home/xen/domains
 +
  
 
pour démarrer un serveur :
 
pour démarrer un serveur :
Ligne 24 : Ligne 74 :
 
first create an extra image with the desired size (here 1GB) that will be added to the current image  
 
first create an extra image with the desired size (here 1GB) that will be added to the current image  
 
      
 
      
   dd if=/dev/zero of=extra.img bs=1M count=1024
+
   # dd if=/dev/zero of=extra.img bs=1M count=1024
 
   1024+0 records in
 
   1024+0 records in
 
   1024+0 records out
 
   1024+0 records out
 
   1073741824 bytes (1.1 GB) copied, 5.09034 seconds, 211 MB/s
 
   1073741824 bytes (1.1 GB) copied, 5.09034 seconds, 211 MB/s
       
 
  
 
Make sure domU is not running. Then just add extra.img to your domU image file (here domU.img). Yes just as simple Very Happy  
 
Make sure domU is not running. Then just add extra.img to your domU image file (here domU.img). Yes just as simple Very Happy  
  
   cat domU.img extra.img > domU.resize.img
+
   # cat domU.img extra.img > domU.resize.img
+
 
 
You also need to enlarge your filesystem. I've test it with ext3 but not with ReiserFS - it seems ReiserFS needs resize_reiserfs instead of resize2fs -.  
 
You also need to enlarge your filesystem. I've test it with ext3 but not with ReiserFS - it seems ReiserFS needs resize_reiserfs instead of resize2fs -.  
  
      $ ef2fsck -f domU.resize.img
+
    # fsck.ext3 -f disk_resize.img
      $ resize2fs domU.resize.img
+
    # resize2fs domU.resize.img
     
+
 
 
Finally modify your domU config file or move domU.resize.img over domU.img.
 
Finally modify your domU config file or move domU.resize.img over domU.img.
 +
 +
== Bonding ==
 +
 +
Setup Bonding Ethernet on Debian with a  2.6 kernel
 +
 +
To use Bonding Ethernet for High-Availability (fail-over) on  Debian (Woody, Sarge or Sid with a 2.4.x kernel) you need to:
 +
 +
install package ifenslave-2.6.To install this package follow  this command
 +
 +
#apt-get install ifenslave-2.6
 +
 +
make sure the real NICs kernel modules are loaded automatically
 +
 +
edit /etc/network/interfaces to look like this:
 +
 +
iface bond0 inet static
 +
address 10.31.1.5
 +
netmask 255.255.255.0
 +
network 10.31.1.0
 +
gateway 10.31.1.254
 +
up /sbin/ifenslave bond0 eth0
 +
up /sbin/ifenslave bond0 eth1
 +
 +
comment or borrow the lines referring to your real NICs in the  same file
 +
 +
add the following lines to your /etc/modprobe.d/arch/i386:
 +
 +
alias bond0 bonding
 +
 +
options bonding mode=1 miimon=100 downdelay=200 updelay=200

Version actuelle datée du 13 juillet 2012 à 09:14

Installation du Dom0[modifier]

Install Debian par defaut avec lvm, decocher toutes les options lors de l'install des paquets: nom du lvm : lvm1 (pour les scripts)


Installer ssh

apt-get install ssh


Installer le systeme xen :

apt-get install linux-image-2.6-xen-686 xen-hypervisor-3.0.3-1-i386-pae xen-ioemu-3.0.3-1 xen-tools xen-utils-3.0.3-1 \
xen-utils-common linux-image-2.6.18-6-xen-686 xen-linux-system-2.6.18-6-xen-686 bridge-utils libc6-xen


Configurer le bridge :

vim /etc/xen/xend-config.sxp

Decommenter :

(network-script network-bridge)


Configurer les outils :

vim /etc/xen-tools/xen-tools.conf
lvm = lvm1
debootstrap = 1
dist   = etch
gateway   = 193.49.133.1
netmask   = 255.255.255.0
passwd = 1
kernel = /boot/vmlinuz-2.6.18-6-xen-686
initrd = /boot/initrd.img-2.6.18-6-xen-686
mirror = http://ftp.fr.debian.org/debian/


Configurer le partage nfs :

mkdir /save

Ajouter dans la fstab :

erasme:/save/domU   /save nfs soft,timeo=5,intr,rsize=8192,wsize=8192  0  0 


redemarrer le serveur qui va booter sur xen

Liste des serveurs virtuels[modifier]

pour voir les serveurs en cours sur un hôte :

# xm list
Serveurs virtuels
Nom du serveur services test/prod cronos saturne Bond
ldap ldap translucent prod X
ldap_relay relais de bordeau prod X
sympa listes de diffusion prod X
vpn acess VPn prod X
hades supervision prod X
pluton OCS-ng + GLPI prod X

Commandes principales[modifier]

Les fichiers d'images sont dans /home/xen/domains


pour démarrer un serveur :

# xm create nom_du_serveur.cfg

pour le reste :

# xm

vous donnera les autres commandes dispos


Augmenter la taille d'un serveur :[modifier]

first create an extra image with the desired size (here 1GB) that will be added to the current image

  # dd if=/dev/zero of=extra.img bs=1M count=1024
  1024+0 records in
  1024+0 records out
  1073741824 bytes (1.1 GB) copied, 5.09034 seconds, 211 MB/s

Make sure domU is not running. Then just add extra.img to your domU image file (here domU.img). Yes just as simple Very Happy

  # cat domU.img extra.img > domU.resize.img

You also need to enlarge your filesystem. I've test it with ext3 but not with ReiserFS - it seems ReiserFS needs resize_reiserfs instead of resize2fs -.

   # fsck.ext3 -f disk_resize.img
   # resize2fs domU.resize.img

Finally modify your domU config file or move domU.resize.img over domU.img.

Bonding[modifier]

Setup Bonding Ethernet on Debian with a 2.6 kernel

To use Bonding Ethernet for High-Availability (fail-over) on Debian (Woody, Sarge or Sid with a 2.4.x kernel) you need to:

install package ifenslave-2.6.To install this package follow this command

#apt-get install ifenslave-2.6

make sure the real NICs kernel modules are loaded automatically

edit /etc/network/interfaces to look like this:

iface bond0 inet static address 10.31.1.5 netmask 255.255.255.0 network 10.31.1.0 gateway 10.31.1.254 up /sbin/ifenslave bond0 eth0 up /sbin/ifenslave bond0 eth1

comment or borrow the lines referring to your real NICs in the same file

add the following lines to your /etc/modprobe.d/arch/i386:

alias bond0 bonding

options bonding mode=1 miimon=100 downdelay=200 updelay=200