Creating a New VM Guest on an IETF NOC Ganeti Cluster

Install Image Types

Install the noop image type on all nodes in the cluster

echo 'deb wheezy main' > /etc/apt/sources.list.d/grnet.list
wget -O - | apt-key add -
apt-get update
apt-get install ganeti-os-noop

If you get in trouble with apt-get update failing using IPv6, try

cat > /etc/apt/apt.conf.d/99force-ipv4
Acquire::ForceIPv4 "true";

Now you can create instances a la

gnt-instance add -t plain -o noop

Create the VM

This is the script i use as it is in vmhost-4:~randy/do-nnew


# do-new node diskGB ramGB nameFQDN


gnt-instance add \
     -t plain \
     -o noop \
     -s ${DISK}G \
     -B maxmem=${RAM}G,minmem=$((${RAM}/2))G \
     -n $NODE \
     -H kvm:vnc_bind_address= \
     --no-install \
     --no-start \
     --no-ip-check \
     --no-name-check \

Install from CD-ROM

Start the Guest VM With the CD-ROM Mounted ==

gnt-instance start -H boot_order=cdrom,cdrom_image_path=/var/iso/ubuntu-14.04.2-server-amd64.iso <your VM name>

Find the Console Port of the Running VM

Then find out on what port the vnc server will appear, 11019 in this case

gnt-instance info | grep console
  console connection: vnc to (display 5119)
    serial_console: default (True)

Tunnel VNC over SSH

From your laptop

ssh -N -L 5900:<port from gnt-instance info> <vm-node-for-image>

Do the Install

It should have booted the CD-ROM. Now do the install of the OpSys in your usual fashion.

When it finishes, if you just let it reboot, it will likely just boot the CD-ROM again. So restart the guest by

gnt-instance reboot

Enable Serial Console

It is also smart to enable the serial console in the guest so that the Ganeti host is able to

gnt-instance console

Detailed Configuration

Configure the Network to the Correct IP, Gateway etc.

e /etc/network/interfaces

Fix the hostname

echo "" > /etc/hostname
hostname `cat /etc/hostname`

Fix the timezone in case you made a mistake in install

dpkg-reconfigure tzdata

If you have reconfigured networking to be on the public LAN, then you need to bind the NIC to the public LAN with

gnt-instance modify --net 0:modify,link=br-public

Restart the server from ganeti

gnt-instance reboot
Last modified 4 years ago Last modified on Mar 29, 2016, 1:56:18 PM