Creating a New FreeBSD VM Guest on Ganeti

Create the Guest VM

Use the silly script ~root/do-add

./do-add vm0 100 2

Which looks like


# makeVM 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 \

Start the Guest VM With the CD-ROM Mounted

You should get the latest and greatest ISO of the opsys you wish to install and put in in /ISOs on the node to which you are installing. And then

gnt-instance start -H boot_order=cdrom,cdrom_image_path=/ISOs/FreeBSD-10.0-STABLE-i386-20140712-r268571-disc1.iso

Find the Console Port of the Running VM

gnt-instance info | grep console

Which will produce something similar to

  console connection: vnc to (display 5124)
    serial_console: default (True)

You are interested in the 11024, not the 5124.

Tunnel VNC over SSH

From your laptop

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

Of course you will need an account on the vm node

Run VNC to the Guest VM

From your laptop, use a VNC client to connect to localhost, display 0, password as set for the VM host.

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

DRBD Mirror Guest to CLuster

You will likely want the reliability of mirroring the guest to another node in the cluster. I have a script I use

# do-drbd guest-name to-node
gnt-instance shutdown $1
gnt-instance modify \
    -t drbd \
    --no-wait-for-sync \
    -n $2 \
gnt-instance start $1
Last modified 4 years ago Last modified on Mar 13, 2016, 4:03:15 AM