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;">></span> <span style="color: #000000; font-weight: bold;">|</span>- Block Devices ---<span style="color: #000000; font-weight: bold;">></span> <span style="color: #000000; font-weight: bold;">|</span>- <span style="color: #000000; font-weight: bold;"><</span>m<span style="color: #000000; font-weight: bold;">></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;">[</span>...<span style="color: #7a0874; font-weight: bold;">]</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;"><</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;">>&</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;">[</span>...<span style="color: #7a0874; font-weight: bold;">]</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;">"e0:1:respawn:/usr/sbin/vblade 0 1 eth1 /dev/sdb1"</span> <span style="color: #000000; font-weight: bold;">>></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 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 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 <span style="color: #000000; font-weight: bold;">!!!!</span>Configuration de AoE Client 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__. Installation des outils client <span style="color: #000000; font-weight: bold;">///</span><span style="color: #7a0874; font-weight: bold;">[</span>bash<span style="color: #7a0874; font-weight: bold;">]</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;">(</span>xend-relocation-server <span style="color: #c20cb9; font-weight: bold;">yes</span><span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>xend-relocation-port <span style="color: #000000;">8002</span><span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>xend-relocation-address <span style="color: #ff0000;">'192.168.0.10'</span><span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>xend-relocation-hosts-allow <span style="color: #ff0000;">''</span><span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>network-script <span style="color: #ff0000;">'bella-network-bridge'</span><span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>vif-script vif-bridge<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>dom0-min-mem <span style="color: #000000;">196</span><span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>dom0-cpus <span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>vncpasswd <span style="color: #ff0000;">''</span><span style="color: #7a0874; font-weight: bold;">)</span>
Sur Brutus, j’active la réallocation et j’autorise Bella à envoyé des VM
<span style="color: #7a0874; font-weight: bold;">(</span>xend-relocation-server <span style="color: #c20cb9; font-weight: bold;">yes</span><span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>xend-relocation-port <span style="color: #000000;">8002</span><span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>xend-relocation-address <span style="color: #ff0000;">'192.168.0.11'</span><span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>xend-relocation-hosts-allow <span style="color: #ff0000;">''</span><span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>network-script <span style="color: #ff0000;">'brutus-network-bridge'</span><span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>vif-script vif-bridge<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>dom0-min-mem <span style="color: #000000;">196</span><span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>dom0-cpus <span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #7a0874; font-weight: bold;">(</span>vncpasswd <span style="color: #ff0000;">''</span><span style="color: #7a0874; font-weight: bold;">)</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