This is meant as a reminder for now. Each bullet point would have to be explained to become a HOWTO.

  • ssh root@…
    • emacs /etc/bind/db.gnt
    • find a free IP (gnt-available*) : 10.10.1.IP
    • set the name HOST.DOMAIN.vm.gnt.
    • emacs /etc/bind/db.10.10
    • set the reverse for HOST
    • cd /etc/bind ; hg commit -m 'define HOST.DOMAIN.vm.gnt'
    • /etc/init.d/bind9 reload
    • tail -f /var/log/syslog # check it does not bark because of an error
  • ssh root@…
    • emacs /etc/dhcp3/dhcpd.conf
    • copy stanza host dev.politis.vm.gnt { into host HOST.DOMAIN.vm.gnt
    • replace mac with MACADDR="52:54:$(dd if=/dev/urandom count=1 2>/dev/null | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4/')"; echo $MACADDR
    • cd /etc/dhcp3 ; hg commit -m 'define HOST.DOMAIN.vm.gnt'
  • ssh root@… # z2 master at the time
    • for i in 1 2 3 4 6 7 9 10 ;do echo z2-$i && ssh z2-$i "cd /etc/dhcp3 && hg pull -u && /etc/init.d/dhcp3-server restart && rm /var/cache/bind/* && /etc/init.d/bind9 restart";done
    • gnt-instance add -d -t drbd -s 10G -B memory=512M,vcpus=1 -H kvm:kernel_path=,initrd_path=,boot_order=cdrom,cdrom_image_path=/root/debian-6.0.0-amd64-CD-1.iso,vnc_bind_address=0.0.0.0 -n PRIMARY.host.gnt:SECONDARY.host.gnt -o debootstrap+default --net 0:mac=MACADDRESS HOST.DOMAIN.vm.gnt
    • gnt-instance info HOST.DOMAIN.vm.gnt | grep -i 'vnc to' => VNCPORT
  • ssh root@…
    • lvcreate backup-2010-03-24 --name=HOST.DOMAIN.vm.gnt --size=10G
    • mke2fs -t ext4 /dev/backup-2010-03-24/HOST.DOMAIN.vm.gnt
    • tune2fs -c 300 -i 300 -m 0 /dev/backup-2010-03-24/HOST.DOMAIN.vm.gnt
  • ssh root@…
    • cd /etc/nagios2/conf.d
    • cp paste3d.dachary.org.cfg HOST.DOMAIN.cfg
    • perl -pi -e 's/paste3d.dachary/HOST.DOMAIN/ HOST.DOMAIN.cfg
    • hg add HOST.DOMAIN.cfg
    • hg commit -m 'define HOST.DOMAIN.vm.gnt'
    • /etc/init.d/nagios2 restart # twice because nagios2 fails to restart because of timing issues
  • pick a public IP in the OVH manager, failover IP menu
  • ssh root@…
    • cd /etc/shorewall ; hg update
    • /etc/shorewall/PUBLIC_IP/params
      VM_HOST_DOMAIN=10.10.1.IP
      HOST_DOMAIN_VNC=VNCPORT
      
    • /etc/shorewall/PUBLIC_IP/rules
      DNAT        net             loc:$PRIMARY               tcp     ${HOST_DOMAIN_VNC:-.} -      PUBLIC_IP
      DNAT        net             loc:$VM_HOST_DOMAIN      tcp     -     -       PUBLIC_IP
      DNAT        net             loc:$VM_HOST_DOMAIN      udp     -     -       PUBLIC_IP
      DNAT        net             loc:$VM_HOST_DOMAIN      icmp    -     -       PUBLIC_IP
      
    • echo INCLUDE /etc/shorewall/PUBLIC_IP/rules >> /etc/shorewall/rules
    • echo INCLUDE /etc/shorewall/PUBLIC_IP/params >> /etc/shorewall/params
    • echo PUBLIC_IP eth0:XXX IP Yes >> /etc/shorewall/nat
    • shorewall restart ; sleep 30 && shorewall clear
    • cd /etc/shorewall ; hg commit -m 'forward PUBLIC_IP to HOST_DOMAIN'
  • vncviewer PUBLIC_IP:VNCPORT
  • ssh root@…
    • gnt-instance modify -H boot_order=disk HOST.DOMAIN.vm.gnt
    • gnt-instance reboot --shutdown-timeout=1 HOST.DOMAIN.vm.gnt
  • vncviewer PUBLIC_IP:VNCPORT