Partage Type SAN avec ATA Over Ethernet

AoE Serveur

Configuration du serveur de fichier faisant office de SAN.
Vérification si le kernel à bien été configuré avec option AoE, vérifier sa présence dans le ficher .config

host:<span style="color: #000000; font-weight: bold;">/</span><span style="color: #808080; font-style: italic;"># grep ATA_OVER /boot/config-`uname -r`</span> <span style="color: #007800;">CONFIG_ATA_OVER_ETH=</span>m

Pour l’activé à la compilation

Device Drivers --<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">|</span>- Block Devices ---<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">|</span>- <span style="color: #000000; font-weight: bold;">&lt;</span>m<span style="color: #000000; font-weight: bold;">&gt;</span> ATA over Ethernet support

Si l’option est présente chargé le module

modprobe aoe

Vérifier dans les logs

<span style="color: #c20cb9; font-weight: bold;">grep</span> aoe <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>syslog Jul <span style="color: #000000;">7</span> <span style="color: #000000;">16</span>:<span style="color: #000000;">31</span>:<span style="color: #000000;">12</span> Nada kernel: aoe: aoe_init: AoE v22 initialised. Jul <span style="color: #000000;">7</span> <span style="color: #000000;">16</span>:<span style="color: #000000;">59</span>:<span style="color: #000000;">57</span> Nada kernel: aoe: aoe_init: AoE v22 initialised.

Installation des outils serveur

apt-get <span style="color: #c20cb9; font-weight: bold;">install</span> vblade

Pour exporter /dev/sdb1

vbladed <span style="color: #000000;">0</span> <span style="color: #000000;">1</span> eth1 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb1

Chaque périphérique AoE device est identifier par une couple numérique Majeur / Mineur. Le majeur est dans la plage 0-65535 et le mineur dans la plage 0-255. Dans l’exemple du dessus nous avons

* Majeur O * Mineur 1 * Via l'interface eth1 * Le partition physique /dev/sdb1

Vérification

<span style="color: #c20cb9; font-weight: bold;">ps</span> -ax <span style="color: #7a0874; font-weight: bold;">&#91;</span>...<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000;">1316</span> tty1 S <span style="color: #000000;">0</span>:<span style="color: #000000;">00</span> <span style="color: #c20cb9; font-weight: bold;">sh</span> -c <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>vblade <span style="color: #000000;">0</span> <span style="color: #000000;">1</span> eth1 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb1 <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> logger -t vbladed <span style="color: #000000;">1318</span> tty1 S <span style="color: #000000;">0</span>:<span style="color: #000000;">00</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>vblade <span style="color: #000000;">0</span> <span style="color: #000000;">1</span> eth1 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb1 <span style="color: #000000;">1319</span> tty1 S <span style="color: #000000;">0</span>:<span style="color: #000000;">00</span> logger -t vbladed <span style="color: #7a0874; font-weight: bold;">&#91;</span>...<span style="color: #7a0874; font-weight: bold;">&#93;</span>

Pour qu’il soit lancer au démarrage du serveur, a défaut de faire une script dans /etc/init.d/ on le colle dans /etc/inittab

<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;e0:1:respawn:/usr/sbin/vblade 0 1 eth1 /dev/sdb1&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>inittab init q

Installer OCFS2

Installer les outils sur les serveurs du node cluster, c.a.d les deux machines hôte xen dom0. Ils ne sont pas nécessaire sur le serveur offrant la ressource disque.

apt-get <span style="color: #c20cb9; font-weight: bold;">install</span> ocfs2-tools

Sur chaque serveur du mode cluster configuré OCFS2 via le fichier /etc/ocfs2/cluster.conf. Dans exemple l’exemple suivant nous avons deux nœuds (Bella et Brutus ) et l’espace disque est nommé oscf2.

node: ip_port = <span style="color: #000000;">7777</span> ip_address = <span style="color: #000000;">192.168</span><span style="color: #000000;">.0</span><span style="color: #000000;">.10</span> number = <span style="color: #000000;">0</span> name = Bella cluster = ocfs2 &nbsp; node: ip_port = <span style="color: #000000;">7777</span> ip_address = <span style="color: #000000;">192.168</span><span style="color: #000000;">.0</span><span style="color: #000000;">.11</span> number = <span style="color: #000000;">1</span> name = Brutus cluster = ocfs2 &nbsp; cluster: node_count = <span style="color: #000000;">2</span> name = ocfs2

Recopie de /etc/ocfs2/cluster.conf vers les autres noeuds et configurer le démarrage de ocfs2 dans le fichier /etc/default/o2cb

vi <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>o2cb <span style="color: #808080; font-style: italic;"># O2CB_ENABLED: 'true' means to load the driver on boot.</span> <span style="color: #007800;">O2CB_ENABLED=</span>true

Lancer de démon ocfs2

<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>o2cb start

Vérifier le fonctionnement du démon

<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>o2cb status &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">!!!!</span>Configuration  de AoE Client &nbsp; Configuration des deux __machines hôtes xen Dom0__ client <span style="color: #c20cb9; font-weight: bold;">du</span> serveur de fichier faisant office de __SAN__. &nbsp; Installation des outils client <span style="color: #000000; font-weight: bold;">///</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>bash<span style="color: #7a0874; font-weight: bold;">&#93;</span> apt-get <span style="color: #c20cb9; font-weight: bold;">install</span> aoetools

Si vous n’utiliser par udev il est possible que les node dans /dev ne soit pas créé automatiquement. Pour forcer cela la commande suivante exite

aoe-mkdevs <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>etherd

Maintenant écoutons le réseau pour découvrir les volumes disponible

client:<span style="color: #000000; font-weight: bold;">/</span><span style="color: #808080; font-style: italic;"># aoe-discover</span>

Affichons ce qui a été découvert

client:<span style="color: #000000; font-weight: bold;">/</span><span style="color: #808080; font-style: italic;"># aoe-stat</span> e0<span style="color: #000000;">.1</span> <span style="color: #000000;">1</span>.048GB eth1 up

Il est maintenant possible d’utiliser ce périphérique

Utiliser le périphérique

Le formater la partition cluster en OCFS2

mkfs -t ocfs2 -L DATA <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>etherd<span style="color: #000000; font-weight: bold;">/</span>e0<span style="color: #000000;">.1</span>

Le monter et l’utiliser

<span style="color: #c20cb9; font-weight: bold;">mount</span> -t ocfs2 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>etherd<span style="color: #000000; font-weight: bold;">/</span>e0<span style="color: #000000;">.1</span> <span style="color: #000000; font-weight: bold;">/</span>home

Attention, le serveur de fichier faisant office de SAN, donc serveur AoE, ne peux pas être client de lui même.

machines virtuel xen

Il ne vous reste plus qu’a installer et lancer depuis une des machines hôtes des machines virtuel xen sur des disque virtuel dans un fichier image. Disque virtuel eux même stocker sur la partition présenté en AoE et partager en cluster OCFS2.

Xen relocation

Pour faire de la réallocation de machine virtuel du machine hôte (dom0) à une autre il faut monté la même ressource AoE sur chacune des machines hôte sur le même point de montage. Dans mon exemple machine hôte à la partition AoE/OCFS2 monté dans /home. Cette partition n’a été formaté qu’une fois depuis l’une des deux machines hôtes.

xend-config.sxp

Pour activé la possibilité de réallocation entre machine hôte xen voici les différente option activé dans les /etc/xen/xend-config.sxp des deux serveur.

Sur Bella, j’active la réallocation et j’autorise Brutus à envoyé des VM

<span style="color: #7a0874; font-weight: bold;">&#40;</span>xend-relocation-server <span style="color: #c20cb9; font-weight: bold;">yes</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>xend-relocation-port <span style="color: #000000;">8002</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>xend-relocation-address <span style="color: #ff0000;">'192.168.0.10'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>xend-relocation-hosts-allow <span style="color: #ff0000;">''</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>network-script <span style="color: #ff0000;">'bella-network-bridge'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>vif-script vif-bridge<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>dom0-min-mem <span style="color: #000000;">196</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>dom0-cpus <span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>vncpasswd <span style="color: #ff0000;">''</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>

Sur Brutus, j’active la réallocation et j’autorise Bella à envoyé des VM

<span style="color: #7a0874; font-weight: bold;">&#40;</span>xend-relocation-server <span style="color: #c20cb9; font-weight: bold;">yes</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>xend-relocation-port <span style="color: #000000;">8002</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>xend-relocation-address <span style="color: #ff0000;">'192.168.0.11'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>xend-relocation-hosts-allow <span style="color: #ff0000;">''</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>network-script <span style="color: #ff0000;">'brutus-network-bridge'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>vif-script vif-bridge<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>dom0-min-mem <span style="color: #000000;">196</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>dom0-cpus <span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>vncpasswd <span style="color: #ff0000;">''</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> xm migrate

Depuis la machine hôte (dom0) hébergeant vos machines virtuel xen pour déplacer une VM à chaud il suffit d’utiliser la commande suivante

Depuis Bella

xm migrate --live VM-<span style="color: #7a0874; font-weight: bold;">test</span> Brutus
 

Je reprend ici un note du mardi 22 avril 2008 par Noplay qui m’a été très utile et que je souhaite garder à disposition (comme souvent).

Plusieurs interface, plusieurs route

Sous Debian ou Ubuntu si vous désirez ajouter automatiquement des routes lorsque une interface réseau devient active vous pouvez utiliser la règle post-up du fichier /etc/network/interfaces. Celle-ci permet éxécuter une commande après qu’une interface soit passée active.

allow-hotplug eth1 iface eth1 inet dhcp post-up route add -net <span style="color: #000000;">42.42</span><span style="color: #000000;">.42</span><span style="color: #000000;">.0</span> netmask <span style="color: #000000;">255.255</span><span style="color: #000000;">.255</span><span style="color: #000000;">.0</span> gw <span style="color: #000000;">192.168</span><span style="color: #000000;">.1</span><span style="color: #000000;">.1</span> down route del -net <span style="color: #000000;">42.42</span><span style="color: #000000;">.42</span><span style="color: #000000;">.0</span> netmask <span style="color: #000000;">255.255</span><span style="color: #000000;">.255</span><span style="color: #000000;">.0</span> gw <span style="color: #000000;">192.168</span><span style="color: #000000;">.1</span><span style="color: #000000;">.1</span>

Pour plus d’informations : man interfaces

 

Suite a l’annonce d’un Important bug de sécurité sur noyau 2.6.17 à 2.6.24 sur linuxfr.org je colle le nez sur mes serveurs pour faire un brin de ménage.

Ménage avec apt-get remove

J’en profite pour virer de vieux paquet et la, sur un serveur de test et bibouille, c’est le drame !!

apt-get remove --purge linux-image<span style="color: #000000;">-2.6</span><span style="color: #000000;">-686</span> Reading package lists... Done Building dependency tree... Done The following packages will be REMOVED: linux-image<span style="color: #000000;">-2.6</span><span style="color: #000000;">-686</span><span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">0</span> upgraded, <span style="color: #000000;">0</span> newly installed, <span style="color: #000000;">1</span> to remove and <span style="color: #000000;">45</span> not upgraded. Need to get 0B of archives. After unpacking 8192B disk space will be freed. Do you want to <span style="color: #7a0874; font-weight: bold;">continue</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Y<span style="color: #000000; font-weight: bold;">/</span>n<span style="color: #7a0874; font-weight: bold;">&#93;</span>? y <span style="color: #c20cb9; font-weight: bold;">perl</span>: warning: Setting locale failed. <span style="color: #c20cb9; font-weight: bold;">perl</span>: warning: Please check that your locale settings: LANGUAGE = <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">unset</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, LC_ALL = <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">unset</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, LANG = <span style="color: #ff0000;">&quot;fr_FR.UTF-8&quot;</span> are supported and installed on your system. <span style="color: #c20cb9; font-weight: bold;">perl</span>: warning: Falling back to the standard locale <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;C&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>. locale: Cannot <span style="color: #000000; font-weight: bold;">set</span> LC_CTYPE to default locale: No such <span style="color: #c20cb9; font-weight: bold;">file</span> or directory locale: Cannot <span style="color: #000000; font-weight: bold;">set</span> LC_MESSAGES to default locale: No such <span style="color: #c20cb9; font-weight: bold;">file</span> or directory locale: Cannot <span style="color: #000000; font-weight: bold;">set</span> LC_ALL to default locale: No such <span style="color: #c20cb9; font-weight: bold;">file</span> or directory <span style="color: #7a0874; font-weight: bold;">&#40;</span>Reading database ... <span style="color: #000000;">43097</span> files and directories currently installed.<span style="color: #7a0874; font-weight: bold;">&#41;</span> Removing linux-image<span style="color: #000000;">-2.6</span><span style="color: #000000;">-686</span> ...

dpkg-reconfigure locales

J’ai du testé et bibouiller un peu trop sur ce serveur et maintenant plus moyen de le maintenant à jour. C’est pas la première fois que j’ai ce message et d’habitude le solutionne la chose avec un bonne reconfiguration des LOCALES

dpkg-reconfigure locales <span style="color: #000000; font-weight: bold;">//</span> &nbsp; Malheureusement l<span style="color: #ff0000;">'utilisation de __dpkg-reconfigure locales__ débouche sur le même message d'</span>erreur. __Perl__ ne comprend pas ma langue et ne trouve pas les variables nécessaire pour cela. &nbsp; Pas grave on va revenir a la langue universel, au fondamentaux de <span style="color: #c20cb9; font-weight: bold;">perl</span> &nbsp; <span style="color: #000000; font-weight: bold;">///</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>bash<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LC_ALL=</span>C

Parfait, je retente la configuration des locales

dpkg-reconfigure locales <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>dpkg-reconfigure: locales is not installed

Et la j’ai l’air con :D

J’installe les locales, je les reconfigure, en sifflant d’un air dégagé et je reprend mes activités.

 

Générer le plan de son architecture réseau facilement ? Voila une promesse sympa que j’ai découvert sur le petit blog de cyril.

Premier Test de Lanmap

Je me lance sur un serveur debian

apt-get <span style="color: #c20cb9; font-weight: bold;">install</span> lanmap

D’après le man la syntaxe est celle-ci :

lanmap <span style="color: #7a0874; font-weight: bold;">&#91;</span>-o directory<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>-e program<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>-T <span style="color: #7a0874; font-weight: bold;">&#123;</span>png,gif,svg<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>-f filtetr<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>-D <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #808080; font-style: italic;">#,all,raw}] [-r seconds]</span> &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span>-i <span style="color: #7a0874; font-weight: bold;">&#123;</span>?,<span style="color: #000000; font-weight: bold;">*</span>wildcard<span style="color: #000000; font-weight: bold;">*</span>,iface<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>-h<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>-v<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>-V<span style="color: #7a0874; font-weight: bold;">&#93;</span>

Sur le petit blog de cyril. je trouve l’exemple suivant :

lanmap -i eth0 -r <span style="color: #000000;">30</span> -T png -o ~<span style="color: #000000; font-weight: bold;">/</span>

Je décode la syntaxe : on force l’interface eth0, on force la génération de l’image toute les 30 secondes, on force le format image en png et on indique de prendre le home directory comme répertoire ou écrire l’image.

Je me place dans le /var/www/lanmap de mon serveur et je lance la commande. Cela cause beaucoup beaucoup dans le xterm alors que j’ai pas ajouter d’option verbose. L’image lanmap.png que je consulte régulièrement depuis le serveur apache de la machine ou je l’ai lancé ne change pas. Il me fait une image avec juste un « outside ».

Recherche de la bonne syntaxe pour lanmap

J’ai un message qui reviens régulièrement

Error: using too many intersections

Je fouille, de décode et reprend le man et je constate que l’on peux filtrer l’écoute sur le réseau.

-f filter Traffic filter, <span style="color: #000000; font-weight: bold;">in</span> libpcap syntax.

libcap c’est tcpdump ! Voila comment lanmap découvre l’architecture du réseau il sniff les paquet. Bon ayant un grand, grand réseau à plat je pense qu’il doit noyé sous le flux.

Je limite cela à tcp/ip pour l’essai suivant en supprimant les requêtes arp et leur réponse de mon réseau ethernet :

lanmap -i eth0 -r <span style="color: #000000;">240</span> -T png -o <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>lanmap<span style="color: #000000; font-weight: bold;">/</span> -vvv -f <span style="color: #ff0000;">&quot;not rarp &amp;&amp; not arp&quot;</span>

Je regarde évolué l’image….guère mieux. Je n’ai aucun lien, juste des machines qui apparaissent.

Google est mon ami, je trouve le site du programmeur de lanmap : parseerror.com. Petite lecture de la FAQ ou je trouve cette information :

  • Q : I have a big network and lanmap only shows me part of it !
  • A : Indeed. lanmap is passive and won’t work beyond switches.

Ha ? et bien pour le coût c’est moins intéressant comme soft, pas étonnant que l’image ne change pas vraiment ou reste incomplète.

Dommage sur le site du créateur l’exemple est vendeur.

 

Support Physique a la machine virtuel

Il y à trois support physique à un DomU : Un fichier image, une partition LVM, une Partition Physique

  1. Un fichier image est ce est le plus rapide à configuré. La contre partie sont de pauvre performance I/O. La taille du fichier image représentant le disque du serveur virtuel est modifiable mais au prix de quelque manipulation laborieuse. Par contre un fichier image est facilement manipulable, copiable, déplacèable
  2. LVM est ce qui est le plus largement utilisé en production. Les partitions peuvent être re-tailler à volonté, facilement, sans (trop) d’intéruption de service. C’est l’idéal pour constituer un hébergement xen. Les performances I/O sont bien meilleur de fait comparé à un fichier image. Par contre en cas de soucis cela ce déplace bien moins facilelement qu’un fichier image.
  3. La partition physique est ce qu’il y à de mieux pour les performances IO. Mais c’est difficilement administrable et pas vraiment flexible.

Disque virtuel dans un fichier image.

C’est mon choix de production, la partition sur la quelle je stock ces fichiers images étant sur un SAN j’ai limité le soucis des I/O tout en ayant la possibilité de transférer mes machine virtuel sur une autre serveur d’hebergement facilement et rapidement.

<span style="color: #c20cb9; font-weight: bold;">mkdir</span> -p <span style="color: #000000; font-weight: bold;">/</span>xens<span style="color: #000000; font-weight: bold;">/</span>burkesys<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if=</span><span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of=</span><span style="color: #000000; font-weight: bold;">/</span>xens<span style="color: #000000; font-weight: bold;">/</span>burkesys<span style="color: #000000; font-weight: bold;">/</span>diskimage.img <span style="color: #007800;">bs=</span>1024k <span style="color: #007800;">count=</span><span style="color: #000000;">5000</span> <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if=</span><span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of=</span><span style="color: #000000; font-weight: bold;">/</span>xens<span style="color: #000000; font-weight: bold;">/</span>burkesys<span style="color: #000000; font-weight: bold;">/</span>swapimage.img <span style="color: #007800;">bs=</span>1024k <span style="color: #007800;">count=</span><span style="color: #000000;">512</span> &nbsp; mkfs.ext3 <span style="color: #000000; font-weight: bold;">/</span>xens<span style="color: #000000; font-weight: bold;">/</span>burkesys<span style="color: #000000; font-weight: bold;">/</span>diskimage.img mkswap <span style="color: #000000; font-weight: bold;">/</span>xens<span style="color: #000000; font-weight: bold;">/</span>burkesys<span style="color: #000000; font-weight: bold;">/</span>swapimage.img &nbsp; <span style="color: #c20cb9; font-weight: bold;">mount</span> -o loop <span style="color: #000000; font-weight: bold;">/</span>xens<span style="color: #000000; font-weight: bold;">/</span>burkesys<span style="color: #000000; font-weight: bold;">/</span>diskimage.img <span style="color: #000000; font-weight: bold;">/</span>mnt

Disque Virtuel dans une volume LVM

lvcreate -n twister --<span style="color: #c20cb9; font-weight: bold;">size</span> 2g main-vol2 lvcreate -n twisterswp --<span style="color: #c20cb9; font-weight: bold;">size</span> 512m main-vol2 &nbsp; mkfs.ext3 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>main-vol2<span style="color: #000000; font-weight: bold;">/</span>twister mkswap <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>main-vol2<span style="color: #000000; font-weight: bold;">/</span>twisterswp &nbsp; <span style="color: #c20cb9; font-weight: bold;">mount</span> -o loop <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>main-vol2<span style="color: #000000; font-weight: bold;">/</span>twister <span style="color: #000000; font-weight: bold;">/</span>mnt

Un nouvel OS avec Debootstrap

Créé avec Debootstrap un nouveau système sur le disque virtuel

debootstrap --<span style="color: #c20cb9; font-weight: bold;">arch</span> i386 sarge <span style="color: #000000; font-weight: bold;">/</span>mnt http:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #c20cb9; font-weight: bold;">ftp</span>.de.debian.org<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span> &nbsp; <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>tls <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>tls.disabled &nbsp; <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>sources.list <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span> vi <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>sources.list &nbsp; <span style="color: #c20cb9; font-weight: bold;">cp</span> -a <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2.6</span><span style="color: #000000;">.16</span><span style="color: #000000;">-1</span>-xen-k7<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span> &nbsp; <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>resolve.conf <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span> &nbsp; <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>network<span style="color: #000000; font-weight: bold;">/</span>interfaces <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>network<span style="color: #000000; font-weight: bold;">/</span> vi <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>network<span style="color: #000000; font-weight: bold;">/</span>interfaces &nbsp; <span style="color: #808080; font-style: italic;">#To use Specific IP address - edit the /mnt/etc/network/interfaces manually.</span> <span style="color: #808080; font-style: italic;">#To use DHCP, edit and include the following:</span> <span style="color: #808080; font-style: italic;"># The loopback network interface</span> auto lo iface lo inet loopback <span style="color: #808080; font-style: italic;"># The primary network interface</span> auto eth0 iface eth0 inet dhcp &nbsp; vi <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">hostname</span> &nbsp; vi <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab proc <span style="color: #000000; font-weight: bold;">/</span>proc proc defaults <span style="color: #000000;">0</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda1 <span style="color: #000000; font-weight: bold;">/</span> ext3 defaults,<span style="color: #007800;">errors=</span>remount-ro <span style="color: #000000;">0</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda2 none swap sw <span style="color: #000000;">0</span> <span style="color: #000000;">0</span>

Configurer le serveur virtuel domU

<span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt &nbsp; vi <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>burkesys kernel = <span style="color: #ff0000;">&quot;/boot/vmlinuz-2.6.16-1-xen-k7&quot;</span> ramdisk = <span style="color: #ff0000;">&quot;/boot/initrd.img-2.6.16-1-xen-k7&quot;</span> memory = <span style="color: #000000;">192</span> name = <span style="color: #ff0000;">&quot;burkesys&quot;</span> vif = <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">'bridge=xenbr0'</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #808080; font-style: italic;">#File Based:# disk = ['file:/xens/burkesys/diskimage.img,sda1,w','file:/xens/burkesys/swapimage.img,sda2,w']</span> <span style="color: #808080; font-style: italic;">#LVM Based:# disk = ['phy:/dev/main-vol2/twister,sda1,w', 'phy:/dev/main-vol2/twister,sda2,w']</span> <span style="color: #808080; font-style: italic;">#DHCP - remove the ip, gateway and netmask lines, and include:# dhcp = &quot;dhcp&quot;</span> ip = <span style="color: #ff0000;">&quot;ip add&quot;</span> gateway = <span style="color: #ff0000;">&quot;ip add&quot;</span> netmask = <span style="color: #ff0000;">&quot;255.255.0.0&quot;</span> root = <span style="color: #ff0000;">&quot;/dev/sda1 ro&quot;</span> extra = <span style="color: #ff0000;">'4'</span> &nbsp; <span style="color: #c20cb9; font-weight: bold;">ln</span> -s <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>burkesys <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>auto<span style="color: #000000; font-weight: bold;">/</span>burkesys <span style="color: #000000; font-weight: bold;">//</span><span style="color: #c20cb9; font-weight: bold;">link</span> <span style="color: #000000; font-weight: bold;">in</span> the config <span style="color: #c20cb9; font-weight: bold;">file</span> so that the Virtal Machine starts on Bootup of Dom0

Lancer et mettre à jour le serveur virtuel DomU

xm create burkesys -c

Vous allez voir votre serveur virtuel booter. Logger vous en suite et faire une mise à jour.

<span style="color: #c20cb9; font-weight: bold;">passwd</span> &nbsp; apt-get update apt-get upgrade
© 2012 Karlesnine Suffusion theme by Sayontan Sinha