How to install xen domu on Centos

Steps for installing fresh Domu on Centos6 are as follows :-

1. Download Centos6 iso image and mount it into /opt , I have downloaded iso image in mnt partition.

mount  -o loop /mnt/Centos.iso  /opt

2. Create  lvm partition for domu  , I have created 3 lvms (xenlv1 , xenlv2 , xenlv3) .

3. Create a interface for domu , I have used virbr0

4. Create domu cfg file in /etc/xen directory

vi /etc/xen/domu.cfg

name = “domu”
vcpus   = ‘2’
uuid     = ‘054004fc-81df-11e3-91ee-002590771426’
memory  = ‘5120’
maxmem  = ‘6144’
disk    = [ “file:/mnt/CentOS-6.5-x86_64-minimal.iso,hdc:cdrom,r”, “phy:/dev/vg00/xenlv1,xvda,w”, “phy:/dev/vg00/xenlv2,xvdb,w”, “phy:/dev/vg00/xenlv3,xvdc,w”]
kernel = “/opt/isolinux/vmlinuz”
ramdisk = “/opt/isolinux/initrd.img”
vif = [ ‘mac=00:16:3e:03:84:14,bridge=virbr0’ ]
on_xend_start   = ‘start’
on_xend_stop    = ‘shutdown’
on_poweroff     = ‘destroy’
on_reboot       = ‘restart’
on_crash        = ‘restart’
on_watchdog     = ‘restart

save the files

Note:- you can add mulitple xen partition in disk line, but while installation only two partition will come , later you can mount other partition
but don’t forgot to format the extra partition –  mkfs.ext4 /dev/vg00/xenlv3

5 .  Create domu with command ‘xl create command’

xl create /etc/xen/domu.cfg

You will get message domain is running with pid- xyz.

6 . Take console and install domu with standard procedure of OS installation .

xl  console domu

After completing domu os installation , don’t  reboot it before doing the following changes in domu cfg file and make file like below

name = “domu”
vcpus     = ‘2’
uuid       = ‘054004fc-81df-11e3-91ee-002590771426’
memory    = ‘5120’
maxmem     = ‘6144’
bootloader    = ‘pygrub’
disk         = [ “phy:/dev/vg01/xenlv1,xvda,w”,
“phy:/dev/vg01/xenlv2,xvdb,w”,
“phy:/dev/vg01/xenlv4,xvdc,w” ]
vif = [ ‘mac=00:16:3e:03:84:14,bridge=virbr0’ ]
on_xend_start   = ‘start’
on_xend_stop    = ‘shutdown’
on_poweroff     = ‘destroy’
on_reboot       = ‘restart’
on_crash        = ‘restart’
on_watchdog     = ‘restart’

So basically at this stage you need to add pygrub and should remove ram , kernel lines .

7 .Now you can select reboot option in console or better you just shutdown domu and create it again.

xl shutdown domu

then

xl create /etc/xen/domu.cfg

 

At this stage you will have guest system is running on your host machine .

Leave a Reply