== proxy ==
#Toutes les vms mksp seront sur z2-6, donc on y met logiquement le proxy aussi.
- définition dhcp + dns (proxy.mekensleep.vm.gnt, 52:54:fa:e4:44:c7)
- gnt-backup import --src-node=z2-2.host.gnt --src-dir=/var/lib/ganeti/export/proxy-reference.vm.gnt -t drbd -s 10G -B memory=256M -n z2-6.host.gnt:z2-5.host.gnt   --net 0:52:54:fa:e4:44:c7 proxy.mekensleep.vm.gnt
- ProxyPass wetball.mekensleep.com wetball.mekensleep.vm.gnt

== mekensleep dns == 
ssh root@www.mekensleep.com
filer:~# vserver ns.public enter
ns:/# tail /etc/bind/mksp/mekensleep.com
- proxy.mekensleep.com 91.121.57.196
- check wetball.mekensleep.com 91.121.57.196

== z2-6 ==	
- shorewall DNAT 80 proxy.mekensleep.vm.gnt from 91.121.57.196

# CHECKPOINT 1 #
- verifier que http://wetball.mekensleep.com/WEBSERVICE/admin marche
	
== hanabi ==
- backup (effectué) => gw:/mnt/densha# ( ssh root@densha.mekensleep.com 'set -x ; for volume in transport wetball hanabi ; do umount /dev/all/$volume ; mount -o ro /dev/all/$volume /mnt/$volume ; done' && nohup rsync --delete -avHz --numeric-ids --exclude=/proc --exclude=/sys --link-dest=/mnt/densha/2009-10-08-densha.mekensleep.com/ root@densha.mekensleep.com:/ /mnt/densha/2009-11-06-densha.mekensleep.com/ ) > /home/loic/densha.out 2>&1 &
- définition dns + dhcp (hanabi.mekensleep.vm.gnt, 52:54:da:76:9a:82)
- gnt-instance add (gnt-instance add --no-start -t drbd -s 10G -B memory=1G -n z2-6.host.gnt:z2-5.host.gnt -o debootstrap  --net 0:mac=52:54:da:76:9a:82 hanabi.mekensleep.vm.gnt)
- ./mount_instance.sh hanabi.mekensleep.vm.gnt 33333
- ssh densha.tld virsh shutdown hanabi
- ssh densha.tld virsh autostart --disable hanabi
- ssh densha.tld "dd if=/dev/all/hanabi" | dd of=/dev/drbdXX
- gnt-instance modify -H root_path=/dev/vda 
- resizefs ?
- drbdsetup /dev/drbdXX down
- gnt-instance start hanabi.mekensleep.vm.gnt
- check ssh + http
- ajout check nagios

== proxy ==
- ProxyPass hanabi.mekensleep.com hanabi.mekensleep.vm.gnt

== z2-6 ==	
- shorewall DNAT 22 hanabi.mekensleep.vm.gnt from 91.121.57.196

== mekensleep dns == 
ssh root@www.mekensleep.com
filer:~# vserver ns.public enter
ns:/# tail /etc/bind/mksp/mekensleep.com
- hanabi.mekensleep.com 91.121.57.196

# CHECKPOINT 2 #
- verifier http://hanabi.mekensleep.com/mediawiki/index.php/Main_Page

== mekensleep ==
- backup
gw:~# e2fsck -f /dev/backup2009-01-20-01/mekensleep
e2fsck 1.41.0 (10-Jul-2008)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/backup2009-01-20-01/mekensleep: 1262300/10009600 files (0.3% non-contiguous), 21968373/26214400 blocks
gw:~# nohup dd bs=1024k if=/dev/backup2009-01-20-01/mekensleep of=/dev/backup2009-08-12/mekensleep-backup > /home/loic/mekensleep-backup.dd.out &
107374182400 bytes (107 GB) copied, 5158.9 s, 20.8 MB/s
gw:~# fsck /dev/backup2009-08-12/mekensleep-backup
gw:~# lvresize -L +80G /dev/backup2009-01-20-01/mekensleep 
  Extending logical volume mekensleep to 180.00 GB
  Logical volume mekensleep successfully resized
gw:~# resize2fs /dev/backup2009-01-20-01/mekensleep 
resize2fs 1.41.0 (10-Jul-2008)
Resizing the filesystem on /dev/backup2009-01-20-01/mekensleep to 47185920 (4k) blocks.
The filesystem on /dev/backup2009-01-20-01/mekensleep is now 47185920 blocks long.
gw:/mnt/mekensleep# lvrename /dev/backup2009-08-12/mekensleep-backup  /dev/backup2009-08-12/mekensleep-2009-11-06
  Renamed "mekensleep-backup" to "mekensleep-2009-11-06" in volume group "backup2009-08-12"
gw:/mnt/mekensleep# nohup rsync -avHz --delete --numeric-ids --exclude=/proc --exclude=/sys --link-dest=/mnt/mekensleep/2009-08-02-mekensleep.snif.tld/ root@mekensleep.snif.tld:/ /mnt/mekensleep/2009-11-06-mekensleep.snif.tld/ > /home/loic/mekensleep.out 2>&1 &


- définition dns + dhcp (mksp.mekensleep.vm.gnt, 52:54:61:79:b2:8e)
- gnt-instance add (gnt-instance add --no-start -t drbd -s 50G -B memory=1G -n z2-6.host.gnt:z2-5.host.gnt -o debootstrap  --net 0:mac=52:54:61:79:b2:8e mksp.mekensleep.vm.gnt)
- ./mount_instance.sh mekensleep.mekensleep.vm.gnt 44444
- ssh snif.tld lvcreate -L10G -s -n mekensleep-snapshot /dev/all/mekensleep
- ssh snif.tld "dd if=/dev/all/mekensleep-snapshot" | dd of=/dev/drbdXX
- ssh snif.tld virsh shutdown mekensleep
- ssh snif.tld virsh autostart --disable mekensleep
- ssh snif.tld kpartx -a /dev/all/mekensleep
- ssh snif.tld mount /dev/mapper/???-mekensleep-??? /mnt/mekensleep
- mount /dev/drbdXXX /mnt/mekensleep
- rsync -avHz --delete --numeric-ids --exclude=/proc --exclude=/sys snif.tld:/mnt/mekensleep /mnt/mekensleep
- umount /mnt/mekensleep
- drbdsetup /dev/drbdXX down
- gnt-instance modify -H kernel_path=,initrd_path= mekensleep.mekensleep.vm.gnt #full virt 
- gnt-instance start mekensleep.mekensleep.vm.gnt
- manager ovh move failover ip (ip 91.121.57.174)
- check ssh + http
- ajout check nagios

Rapport

Définition des dns :

  • etc/bind/db.10.10

    diff -r d3ba63c46910 etc/bind/db.10.10
    a b  
    44; 
    55$TTL    604800 
    66@       IN      SOA     localhost. root.localhost. ( 
    7                        2009110501      ; serial 
     7                       2009110503      ; serial 
    88                         604800         ; Refresh 
    99                          86400         ; Retry 
    1010                        2419200         ; Expire 
     
    31031041.1   IN      PTR     cspoker-bot.vm.gnt. 
    31131142.1   IN      PTR     pioneer.binbang.vm.gnt. 
    31231243.1   IN      PTR     drupal-z2.pokersource.vm.gnt. 
    313 44.1   IN      PTR     gnt-available-1-44.gnt. 
    314 45.1   IN      PTR     gnt-available-1-45.gnt. 
    315 46.1   IN      PTR     gnt-available-1-46.gnt. 
     31344.1   IN      PTR     proxy.mekensleep.vm.gnt. 
     31445.1   IN      PTR     hanabi.mekensleep.vm.gnt. 
     31546.1   IN      PTR     mksp.mekensleep.vm.gnt. 
    31631647.1   IN      PTR     gnt-available-1-47.gnt. 
    31731748.1   IN      PTR     gnt-available-1-48.gnt. 
    31831849.1   IN      PTR     gnt-available-1-49.gnt. 
  • etc/bind/db.gnt

    diff -r d3ba63c46910 etc/bind/db.gnt
    a b  
    44 
    55$ORIGIN gnt. 
    66@                       IN      SOA             ns hostmaster ( 
    7                        2009110502      ; serial 
     7                       2009110503      ; serial 
    88                                1h              ; refresh - time when the slave will try to refresh the zone from the master (8h) 
    99                                30m             ; update retry - time between retries if the slave (secondary) (2h) 
    1010                                                ; fails to contact the master when refresh (above) has expired. 
     
    314314cspoker-bot.vm         IN      A       10.10.1.41 
    315315pioneer.binbang.vm     IN      A       10.10.1.42 
    316316drupal-z2.pokersource.vm       IN      A       10.10.1.43 
    317 gnt-available-1-44     IN      A       10.10.1.44 
    318 gnt-available-1-45     IN      A       10.10.1.45 
    319 gnt-available-1-46     IN      A       10.10.1.46 
     317proxy.mekensleep.vm    IN      A       10.10.1.44 
     318hanabi.mekensleep.vm   IN      A       10.10.1.45 
     319mksp.mekensleep.vm     IN      A       10.10.1.46 
    320320gnt-available-1-47     IN      A       10.10.1.47 
    321321gnt-available-1-48     IN      A       10.10.1.48 
    322322gnt-available-1-49     IN      A       10.10.1.49 

DHCP :

  • dhcpd.conf

    diff -r 3f79ebb0a060 dhcpd.conf
    a b  
    592592               fixed-address drupal-z2.pokersource.vm.gnt; 
    593593               option subnet-mask 255.255.255.255; 
    594594        } 
     595       host proxy.mekensleep.vm.gnt { 
     596               hardware ethernet 52:54:fa:e4:44:c7; 
     597               fixed-address proxy.mekensleep.vm.gnt; 
     598               option subnet-mask 255.255.255.255; 
     599        } 
     600       host hanabi.mekensleep.vm.gnt { 
     601               hardware ethernet 52:54:da:76:9a:82; 
     602               fixed-address hanabi.mekensleep.vm.gnt; 
     603               option subnet-mask 255.255.255.255; 
     604        } 
     605       host mksp.mekensleep.vm.gnt { 
     606               hardware ethernet 52:54:61:79:b2:8e; 
     607               fixed-address mksp.mekensleep.vm.gnt; 
     608               option subnet-mask 255.255.255.255; 
     609        } 
    595610 
    596611 } 
    597612} 
z2-2:/etc/dhcp3# for i in 1 2 3 4 5 6;do echo "WORKING ON $i" ; ssh z2-$i "cd /etc/dhcp3; hg pull; hg update; /etc/init.d/dhcp3-server restart; rm /var/cache/bind/* && /etc/init.d/bind9 restart";done

hanabi

densha:~# virsh shutdown hanabi
Domain hanabi is being shutdown

densha:~# virsh list
 Id Name                 State
----------------------------------
  7 transport            running

densha:~# virsh autostart --disable hanabi
Domain hanabi unmarked as autostarted
gnt-instance add --no-start -t drbd -s 10G -B memory=1G -n z2-6.host.gnt:z2-5.host.gnt -o debootstrap  --net 0:mac=52:54:da:76:9a:82 hanabi.mekensleep.vm.gnt
z2-2:~# ./mount-instance.sh hanabi.mekensleep.vm.gnt 33333
z2-6:/etc/bind# ssh densha.tld "dd if=/dev/all/hanabi" | dd of=/dev/drbd6
The authenticity of host 'densha.tld (192.168.170.1)' can't be established.
RSA key fingerprint is b1:b4:ce:62:c6:de:0f:ac:2f:70:19:86:70:67:fa:06.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'densha.tld,192.168.170.1' (RSA) to the list of known hosts.
20480000+0 enregistrements lus
20480000+0 enregistrements écrits
10485760000 octets (10 GB) copiés, 1314,89 s, 8,0 MB/s
z2-2:~# ssh z2-6 "drbdsetup /dev/drbd6 down"
z2-2:~# ssh z2-5 "drbdsetup /dev/drbd14 down"
z2-2:~# gnt-instance modify -H root_path=/dev/vda hanabi.mekensleep.vm.gnt 
Modified instance hanabi.mekensleep.vm.gnt
 - hv/root_path -> /dev/vda
Please don't forget that these parameters take effect only at the next start of the instance.
z2-2:~# gnt-instance startup hanabi.mekensleep.vm.gnt 

Update etc/network/interface to use dhcp, + dhclient eth0.

maxence@call:~$ ssh  root@hanabi.mekensleep.vm.gnt
The authenticity of host 'hanabi.mekensleep.vm.gnt (10.10.1.45)' can't be established.
RSA key fingerprint is 39:7a:c8:f9:d6:90:66:48:28:94:84:79:e5:39:81:82.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'hanabi.mekensleep.vm.gnt,10.10.1.45' (RSA) to the list of known hosts.
Linux hanabi 2.6.30-2-amd64 #1 SMP Fri Sep 25 22:16:56 UTC 2009 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Nov  6 15:12:23 2009
hanabi:~# 

Update shorewall config for ip 91.121.57.196 : 80 to http proxy, 22 to hanabi:

  • 91.121.57.196/params

    diff -r e506bb269624 91.121.57.196/params
    a b  
    11VM_WETBALL=10.10.1.37 
    22VM_PROXY_MKSP=10.10.1.44 
     3VM_HANABI=10.10.1.45 
  • 91.121.57.196/rules

    diff -r e506bb269624 91.121.57.196/rules
    a b  
    11ACCEPT      net             $FW:91.121.57.196  tcp 
    2 DNAT        net             loc:$VM_PROXY_MKSP  tcp     -     -       91.121.57.196 
    3 DNAT        net             loc:$VM_PROXY_MKSP     udp     -     -       91.121.57.196 
     2#web proxy 
     3DNAT        net             loc:$VM_PROXY_MKSP  tcp     https,http     -       91.121.57.196 
     4#ssh port 22 is for hanabi 
     5DNAT        net             loc:$VM_HANABI tcp     ssh -       91.121.57.196 

check http://hanabi.mekensleep.com, with an entry on /etc/hosts :OK dns updated, not propagated yet :

maxence@call:~$ dig +short @ns.mekensleep.com hanabi.mekensleep.com
91.121.57.196

nagios checks :

z2-6.pokersource

failover + gnt-instance replace-disks --on-secondary --new-secondary=z2-?

dtv09ut.binbang.vm.gnt         kvm        debootstrap z2-6.host.gnt running      128M
hanabi.mekensleep.vm.gnt       kvm        debootstrap z2-6.host.gnt running      1.0G
proxy.mekensleep.vm.gnt        kvm        debootstrap z2-6.host.gnt running      256M
wetball.mekensleep.vm.gnt      kvm        debootstrap z2-6.host.gnt running      512M

delete:

mksp.mekensleep.vm.gnt         kvm        debootstrap z2-6.host.gnt ADMIN_down      -

i7 ks308519.kimsufi.com

http://trac.dunnewind.net/dunnewind/wiki/GanetiOspfHowto gnt-instance replace-disks --on-secondary --new-secondary=i7

dtv09ut.binbang.vm.gnt         kvm        debootstrap z2-6.host.gnt running      128M
hanabi.mekensleep.vm.gnt       kvm        debootstrap z2-6.host.gnt running      1.0G
proxy.mekensleep.vm.gnt        kvm        debootstrap z2-6.host.gnt running      256M
wetball.mekensleep.vm.gnt      kvm        debootstrap z2-6.host.gnt running      512M