Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Xen and Ganeti on a Debian server

HOW-TO Install Ganeti/Xen/DRBD ?

You need a Volum Group on your server (LVM) named "vgganeti" for store VMs.
apt-get update && apt-get dist-upgrade
apt-get install git vim aptitude sudo htop screen curl openssh-server locales
apt-get -y install xen-linux-system xen-tools
dpkg-divert --divert /etc/grub.d/08_linux_xen --rename /etc/grub.d/20_linux_xen
sed -i '/TOOLSTACK/s/=.*/=xl/' /etc/default/xen
echo 'GRUB_CMDLINE_XEN_DEFAULT="dom0_mem=1024M,max:1024M \
  dom0_max_vcpus=1 dom0_vcpus_pin"' > /etc/default/grub
Give a static IP for eth0 /etc/network/interfaces
auto  eth0
iface eth0 inet manual
auto xenbr0
iface xenbr0 inet static
  address   <IpAddr> 
  broadcast <BroadcastAddr>
  netmask   <NetMaskAddr>
  gateway   <GWAddr>
  bridge_ports eth0
  bridge_stp off       
  bridge_waitport 0   
  bridge_fd 0 ```
###### Check this on /etc/default/xen :
`XENDOMAINS_SAVE=`
###### Let's reboot and install Ganeti :
```shell
update-grub
reboot
mkdir /root/.ssh/
apt-get install ganeti2 ganeti-instance-debootstrap
cd /boot
ln -s vmlinuz-3.16.0-4-amd64 vmlinuz-3-xenU
ln -s initrd.img-3.16.0-4-amd64 initrd-3-xenU
apt-get install drbd8-utils
echo "options drbd minor_count=128 usermode_helper=/bin/true" \
   > /etc/modprobe.d/drbd.conf
echo "drbd" >> /etc/modules
depmod -a
modprobe drbd
service ganeti restart
Edit /etc/hosts and add 2 IP, the server's IP and any cluster's IP (on same range)
127.0.0.1	localhost
192.168.1.5 serv1
192.168.1.50 cluster-ip
Let's Init the Cluster
gnt-cluster init --vg-name=vgganeti --master-netdev=xenbr0 \
  --vg-name vgganeti cluster-name
Change this on /var/lig/ganeti/config.data :
"xen_cmd":"xl"},
"link":"xenbr0",
"initrd_path":"/boot/initrd-3-xenU",
"kernel_args":"ro",
"kernel_path":"/boot/vmlinuz-3-xenU
Let's restart Ganeti

service ganeti restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.