Centos – Ganeti : Installing Centos/RHEL Instance

centosganetikvm-virtualizationvirtual-machinesvirtualization

I have installed Ganeti on Centos 6.3 with DRBD and have added couple of nodes. However, now I am facing next challenge of installing a Centos Guest/Instance on top of it. I tried using ganeti-instance-image but it does not appear to have ISO install. I tried the steps given https://code.osuosl.org/projects/ganeti-image/wiki/HOWTO_-_Ganeti_Instance_Image but did not work for me.

I know there is extensive documentation in ganeti page but most of them are for xen/Debian destro. The default debootstrap is also designed for Default debian instance install. If anyone could help me with working steps (idiot's guide) of installing an Centos Instance from

  • ISO image
  • Importing an existing qemu image file (qcow2/img/raw)
  • Installing Centos using instance-image project.

So far I have been using KVM/DRBD for my Virtual machine management.

Best Answer

Answering my own Question.The answer to my question was understanding and using Ganeti OS templates/Bootstraps. Ganeti provides a default bootstrap to install Debian based Instances/Virtual machine. It could be modified to install any type of OS. There are already such instance-images available that could be used to install other destros such as CentOS/RHEL and Windows.

  1. debootstrap -- For Debian
  2. Instance-image -- For all Linux
  3. Linux-image/Raw-image -- It worked for me to get CentOS 6 VM install.

Install Linux-image. Remember to install the packages and ISO images across all the nodes in same location.

wget http://sourceforge.net/projects/ganeti-os-defs/files/ganeti-os-defs-1.1.1.tgz/download
tar -zxvf ganeti-os-defs-1.1.1.tgz -C /src/ganeti/os/
cd linux-image/

edit environment.sh path of ISO rescue image Modify cluster settings

Verify the install

gnt-os list

Installing from ISO Image

Create an instance image

gnt-instance add -t drbd -o linux-image+default -s 10g -n node1:node2 --no-start --no-install  -B vcpus=2,memory=1024M -H kvm:vnc_bind_address=0.0.0.0 vm1.net

Install OS

gnt-instance start -H boot_order=cdrom,cdrom_image_path=/usr/local/iso/CentOS-6.3-x86_64-minimal.iso vm1.net

Get the VNC Access

gnt-instance info --all  | grep network

You may have to restart the Instances from Ganeti as it may not pick up up the grub.

Importing existing Qemu-image to DRBD based Ganeti

Sharing the steps mentioned at https://groups.google.com/forum/?fromgroups=#!topic/ganeti/YH_5pM8rAvc

Convert the Image

Get the image size

qemu-img convert dsl.qcow2 -O raw dsl.qcow2

qemu-img info dsl.raw
image: dsl.raw
file format: raw
virtual size: 8.0G (8589934592 bytes)
disk size: 1.5G

Create a DRBD image

gnt-instance add -t drbd -o linux-image+default -s 8g -n gkvm01.net:gkvm02.net -H --no-start --no-install -B vcpus=2,memory=1024M -H kvm:vnc_bind_address=0.0.0.0 dsl.net


gnt-instance activate-disks dsl.net
dd if=dsl.raw of=/dev/drbd1

gnt-instance deactivate-disks dsl.net

gnt-instace start dsl.net
Related Topic