# 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 http://repo.noc.grnet.gr/ wheezy main' > /etc/apt/sources.list.d/grnet.list wget -O - http://repo.noc.grnet.gr/grnet.gpg.key | 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 ``` #!/bin/sh # do-new node diskGB ramGB nameFQDN NODE=$1 DISK=$2 RAM=$3 NAME=$4 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=127.0.0.1 \ --no-install \ --no-start \ --no-ip-check \ --no-name-check \ ${NAME} ``` ## 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 ``` ### 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 meetecho-1.meeting.ietf.org | grep console console connection: vnc to vmhost-6.meeting.ietf.org:11019 (display 5119) serial_console: default (True) ``` ### Tunnel VNC over SSH From your laptop ``` ssh -N -L 5900:127.0.0.1: ``` ### 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 your.vm.name ``` ### 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 your.vm.name ``` ### Detailed Configuration Configure the Network to the Correct IP, Gateway etc. ``` e /etc/network/interfaces ``` Fix the hostname ``` echo "foo.meeting.ietf.org" > /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 your.vm.name ``` Restart the server from ganeti ``` gnt-instance reboot foo.meeting.ietf.org ```