From: Luca Filipozzi Date: Thu, 31 May 2012 02:48:41 +0000 (+0000) Subject: start documenting ganeti install X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-wiki.git;a=commitdiff_plain;h=d5fe68cff6bae89851ff8dd1d91dc1867efdb1ad start documenting ganeti install --- diff --git a/input/howto/install-ganeti.creole b/input/howto/install-ganeti.creole new file mode 100644 index 0000000..7270537 --- /dev/null +++ b/input/howto/install-ganeti.creole @@ -0,0 +1,125 @@ +== How To Install Ganeti Clusters and Instances == + +=== How To Install Ganeti Clusters === + +Suppose that you have two identical hosts running squeeze, foo.debian.org and +bar.debian.org, that will be used as nodes in a ganeti cluster. + +==== install required packages ==== + +On each node, install the required packages: + +{{{ + apt-get install fai-client ssed extlinux + apt-get install -t squeeze-backports drbd8-utils ganeti2 ganeti-instance-debootstrap ganeti-htools +}}} + +==== configure kernel modules ==== + +On each node, ensure that required kernel modules are loaded at boot: + +{{{ + ainsl /etc/modules 'drbd minor_count=255 usermode_helper=/bin/true' + ainsl /etc/modules 'hmac' + ainsl /etc/modules 'tun' +}}} + +==== configure networking ==== + +Determine a hostname for the cluster (foobar.debian.org) and assign an A record. + +On each node, ensure that all nodes and the cluster itself are listed in +{{{/etc/hosts}}}. + +On each node, create a bridge interface: br0. + +==== create storage ==== + +On each node, configure lvm to ignore drbd devices and to prefer +{{{/dev/cciss}}} devices names to {{{/dev/block}}} device names +([[http://code.google.com/p/ganeti/issues/detail?id=93|why?]]): + +{{{ + ssed -i \ + -e 's#^\(\s*filter\s\).*#\1= [ "a|.*|", "r|/dev/drbd[0-9]+|" ]#' + -e 's#^\(\s*preferred_names\s\).*#\1= [ "^/dev/dm-*/", "^/dev/cciss/" ]#' \ + /etc/lvm/lvm.conf +}}} + +On each node, create a volume group: + +{{{ + vgcreate vg_ganeti /dev/cciss/c0d0p3 +}}} + +==== create kvmU symbolic links ==== + +{{{ + ln -s -T /boot/vmlinuz-2.6.32-5-amd64 /boot/vmlinuz-2.6-kvmU + ln -s -T /boot/initrd.img-2.6.32-5-amd64 /boot/initrd.img-2.6-kvmU +}}} + +==== instantiate the cluster ==== + +On the master node (foo) only: + +{{{ + gnt-cluster init \ + --master-netdev br0 \ + --vg-name vg_ganeti \ + --secondary-ip 192.168.2.213 \ + --enabled-hypervisors kvm \ + --nic-parameters link=br0 \ + --mac-prefix 00:16:37 \ + --no-ssh-init \ + --no-etc-hosts \ + --hypervisor-parameters kvm:initrd_path=/boot/initrd.img-2.6-kvmU \ + foobar.debian.org +}}} + +==== add slave nodes === + +For each slave node (bar), on the master node (foo): + +{{{ + gnt-node add \ + --secondary-ip 192.168.2.217 \ + --no-ssh-key-check \ + --no-node-setup \ + bar.debian.org +}}} + +==== verify cluster ==== + +On the master node (foo): + +{{{ + gnt-cluster verify +}}} + +=== How To Install Ganeti Instances === + +Suppose that the first guest on will be qux.debian.org. + +==== define the instance ==== + +# add qux.debian.org entry in LDAP to establish A record +# ask hosting partner to establish PTR record as appropriate +# add qux.debian.org entry in puppet +# add qux.debian.org entry in nagios + +==== create the instance ==== + +On the master node (foo): + +{{{ + gnt-instance add \ + --node foo:bar \ + --disk-template drbd \ + --os-size 4GiB \ + --os-type debootstrap+dsa \ + --hypervisor-parameters kvm:initrd_path=,kernel_path= \ + --net 0:ip=1.2.3.4 \ + qux.debian.org +}}} +