Ganeti is a virtual machine cluster manager.
You can also use it to quickly create and dispose development machines.
Runs on the ganeti master node:
Runs on all nodes:
Runs on the master:
Read the Ganeti 2.1 design doc for future daemons and their purpose.
This is geared at a one-node portable secure installation. Don't use it on a real cluster: follow the install.html Ganeti doc.
cat >>/etc/network/interfaces <<EOF iface dummy0 inet static address 192.168.99.254 netmask 255.255.255.0 iface br0 inet static address 192.168.99.254 netmask 255.255.255.0 bridge_ports dummy0 pre-up /sbin/ifup dummy0 up /etc/init.d/dnsmasq restart down /etc/init.d/dnsmasq stop EOF
You can also set up dnsmasq to only start when br0 is up, if you want.
cat >/etc/default/ganeti <<EOF NODED_ARGS="-b 192.168.99.254" RAPI_ARGS="-b 192.168.99.254" EOF
RAPI=/bin/true works as well :)
$IPT -N FWD_VIRTUAL $IPT -t nat -N PST_VIRTUAL $IPT -A FORWARD -m state --state INVALID -j DROP $IPT -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT $IPT -A FORWARD -j FWD_VIRTUAL $IPT -t nat -A POSTROUTING -j PST_VIRTUAL $IPT -F FWD_VIRTUAL $IPT -A FWD_VIRTUAL -s 192.168.99.0/24 -i br0 -j ACCEPT $IPT -A FWD_VIRTUAL -s 192.168.99.0/24 -i tap+ -j ACCEPT $IPT -t nat -F PST_VIRTUAL $IPT -t nat -A PST_VIRTUAL -s 192.168.99.0/24 -o wlan0 -j MASQUERADE $IPT -t nat -A PST_VIRTUAL -s 192.168.99.0/24 -o wlan1 -j MASQUERADE $IPT -t nat -A PST_VIRTUAL -s 192.168.99.0/24 -o eth0 -j MASQUERADE $IPT -t nat -A PST_VIRTUAL -s 192.168.99.0/24 -o ppp0 -j MASQUERADE
cat <<EOF >/etc/hosts 192.168.99.254 myhost.mobile.example.com myhost 192.168.99.253 cluster.mobile.example.com cluster 192.168.99.10 i0.mobile.example.com i0 192.168.99.11 i1.mobile.example.com i1 192.168.99.12 i2.mobile.example.com i2 192.168.99.13 i3.mobile.example.com i3 EOF
Also make sure you have a FQDN in /etc/hostname
apt-get install ganeti2 ganeti-instance-debootstrap
ganeti-instance-debootstrap is customized through /etc/default/ganeti-instance-debootstrap. Unfortunately for now different installations are necessary to use different config files on the fly. (This will change in Ganeti 2.1)
gnt-cluster init [--no-lvm-storage] -t kvm --enabled-hypervisors=kvm cluster # install your kvm kernel gnt-instance add -t file -n myhost -o debootstrap -s 512M i4 # ... ping i0 ssh i0 # easy with OS hooks gnt-instance remove i0
Whatever you can do with virtual machines, plus a very fast deployment:
This is a showcase for how I use Ganeti to quickly create experimental development environments on the go, on my laptop.