HowtoForge

How To Build A Low Cost SAN - Page 4

12 AOE WITH VIRTUALIZATION

12.1 About XEN-AoE

XEN-AoE system takes maximum advantage of high-performance commodity computing power and high efficiency IP-SAN technologies to deliver a virtual- ization solution which provides the highest availability, performance, and best value possible in low cost. Xen-AoE is a cluster server architecture which pro- vides more efficient use of cpu, disk, and memory resources than traditional servers with zero single points of failure ensuring high availability and greater server maintainability. It does this by utilizing:

 

12.2 OBJECTIVE OF XEN-AoE EXPERIMENT

We have three xen machines booted on xen kernel of FC7. If you do not have your pc with xen kernel, then please select the virtualization option while in- stallation and install your pc with XEN-kernel. The objective of this lab is to export the block devices from node1 to node2 and create a DOMU (guest OS) in node2. This DOMU will be created on exported block devices from node1 and it will contain a minimum debian linux and one can easily do live migration of this DOMU from the second node(node2) to third node(node3).

 

12.3 SETUP

The first step of XEN-AoE setup is to export two block devices of 4GB from node1 to node2:

 

Creation of two block devices of 4GB each

[root@node1 Desktop]# dd if=/dev/zero of=newfile1.img bs=1M count=4000
[root@node1 Desktop]# dd if=/dev/zero of=newfile2.img bs=1M count=4000
[root@node1 Desktop]# losetup /dev/loop0 newfile1.img
[root@node1 Desktop]# losetup /dev/loop1 newfile2.img
[root@node1 Desktop]# losetup -a

 

Creation of LVM on these two devices

[root@node1 Desktop]# pvcreate /dev/loop0
[root@node1 Desktop]# pvcreate /dev/loop1
[root@node1 Desktop]# pvs
[root@node1 Desktop]# vgcreate vgnode1.0 /dev/loop0
[root@node1 Desktop]# vgcreate vgnode1.1 /dev/loop1
[root@node1 Desktop]# vgs
[root@node1 Desktop]# lvcreate -L3G -n lvnode1.0 vgnode1.0
[root@node1 Desktop]# lvcreate -L3G -n lvnode1.1 vgnode1.1
[root@node1 Desktop]# lvs

 

Export these devices

[root@node1 vblade]# ./vbladed 0 0 eth0 lvnode1.0
[root@node1 vblade]# ./vbladed 0 1 eth0 lvnode1.1

 

Acess of these two block devices on node2 and creating an Raid array

[root@node2 Desktop]# modprobe aoe
[root@node2 Desktop]# aoe-stat
[root@node2 Desktop]# mdadm - -create /dev/md0 - -level=1 - -raid-devices=2

  /dev/etherd/e0.0 /dev/etherd/e0.1

[root@node2 Desktop]# cat /proc/mdstat
[root@node2 Desktop]# mdadm - -detail /dev/md0
[root@node2 Desktop]# mkfs.ext3 /dev/md0

 

Creation of a Domu (containing debian linux) on raid array

Debootstrap is used to create a Debian base system from scratch, without re- quiring the availability of dpkg or apt. It does this by downloading .deb files from a mirror site, and carefully unpacking them into a directory which can eventually be chrooted into.

[root@node2 Desktop]# yum install debootstrap
[root@node2 Desktop]# mkdir /debian
[root@node2 Desktop]# mount /dev/md0 /debian
[root@node2 Desktop]# debootstrap - -arch i386 etch /debian

 

To get the console on DOMU

Please do some tricky things to get a console on your DomU. If you don't do this, it may be possible that you don't get a terminal. Your mingetty will respawn and it will not show you the screen. So, be careful to get the console. You can search on the net for available solutions:
https://lists.linux-foundation.org/pipermail/virtualization/2007-January/005478.html

[root@node2 Desktop]#cp /etc/passwd /etc/shadow /debian/etc
[root@node2 Desktop]#echo '/dev/sda1 / ext3 defaults 1 1' > /debian/etc/fstab
[root@node2 Desktop]#sed -ie 's/^[2-6]:/#/0/' /debian/etc/inittab

 

Making of a new initrd

Create a new initrd (initialization RAM Disk) without SCSI modules, and then use this to boot the guest Linux operating system. If you don't do this then your booting may be fail. In my case I got the message \kernel panic". Making of initrd can be achieved by following command:

[root@node2 Desktop]# mkinitrd - -omit-scsi-modules - -with=xennet - -with=xenblk - -preload=xenblk initrd-$(uname -r)-no-scsi.img $(uname -r)

 

Setup the debian Xen configuration file xm-script /etc/xen/debian:

kernel = `/boot/vmlinuz-2.6.21-7.fc7xen'
ramdisk = `/boot/initrd-2.6.21-7.fc7xen-no-scsi.img'
memory = `238'
name = `debian'
root = `/dev/sda1 ro'
extra=\console=tty1 xencons=tty1"
dhcp = `dhcp'
vif = [ ` ']
disk = [ `phy:md0,sda1,w ']
on poweroff = `destroy '
on reboot = `restart '
on crash = `restart '

Now Everything has done to create a new guest os with debian Linux.

 

Start your DomU

[root@node2 /]# umount /dev/md0
[root@node2 /]# xm create -c debian
[root@node1 /]# xm list

So, finally your Dom U has created with debian linux. If everything is fine then, you can get the terminal otherwise you can search on the net.

 

Live-Migration

Now it's time to migrate this virtual machine on node3. So, run the following command:

  [root@node2 ]#xm migrate - -live debian node3 

 

13 Conclusion

Fiber Channel and iSCSI customers are often looking for more than just storage. AoE is a simple network protocol and its description is only eleven pages long, but it provides enough of a structure to build exible, simple, and scalable storage solutions from inexpensive hardware like disks and gigabyte switch. So, if you want a small San with no extra features in a low budget, then AOE is a better choice rather than iSCSI and fiber channel. As there always has been a huge demand for low cost and exible storage solutions, it is not feasible to increase the number of drives easily in either Fiber or iSCSI based Sans. The ATA over Ethernet (AoE) protocol solves this issue to a large extent. However Fiber channel solutions are the fastest of the three while iSCSI solutions are still most reliable.

 

14 Terms and Terminology

How To Build A Low Cost SAN - Page 4