Thursday, June 25, 2009


Setup Xen 3.4.1 Dom0 on top of Ubuntu 9.04 Server via Marc - A. Dahlhaus's UDEV patch


Per Marc - A. Dahlhaus:-
Udev removed the udevinfo symlink from versions higher than 123 and xens build-system could not detect if udev is in place and has the required version. In particular, Ubuntu 9.04 server has udev version
141 and appears to be affected by this issue. Straight forward Xen 3.4.1 build brings up Xen Host with hotplug scripts rejecting to work.
The recent patch suggested by Marc resolves this problem.
Brief description of Xen 3.4.1 build follows bellow. First – install on Uubuntu 9.04 Server all packages required for Xen build:-

libcurl4-openssl-dev
xserver-xorg-dev
python2.6-dev
python2.5
python2.5-dev
mercurial
gitk
build-essential
libncurses5-dev
uuid-dev
gawk
gettext
texinfo
bcc

Second step :-

# cd /usr/src
# hg clone http://xenbits.xensource.com/xen-3.4-testing.hg
# cd xen-3.4-testing.hg
Set in Config.mk
PYTHON = python
PYTHON_PREFIX_ARG =

Apply patch :-

--- xen-3.4.0.orig/tools/hotplug/Linux/Makefile
+++ xen-3.4.0/tools/hotplug/Linux/Makefile
@@ -28,6 +28,12 @@ XEN_SCRIPT_DATA += vtpm-migration.sh vtp
XEN_HOTPLUG_DIR = /etc/hotplug
XEN_HOTPLUG_SCRIPTS = xen-backend.agent
+ifeq ($(shell [ -x /sbin/udevadm ] && echo 1),1)
+UDEVINFO = /sbin/udevadm
+else
+UDEVINFO = /usr/bin/udevinfo
+endif
+
UDEV_RULES_DIR = /etc/udev
UDEV_RULES = xen-backend.rules xend.rules
@@ -36,7 +43,7 @@ DE = $(if $(DESTDIR),$(shell readlink -f
ifeq ($(findstring $(DI),$(DE)),$(DI))
HOTPLUGS=install-hotplug install-udev
else
-ifeq ($(shell [ -x /usr/bin/udevinfo ] && [ `/usr/bin/udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/'` -ge 059 ] && echo 1),1)
+ifeq ($(shell [ -x $(UDEVINFO) -a `$(UDEVINFO) -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/'` -ge 059 ] && echo 1),1)
HOTPLUGS=install-udev
else
HOTPLUGS=install-hotplug
--- xen-3.4.0.orig/tools/check/check_udev
+++ xen-3.4.0/tools/check/check_udev
@@ -8,8 +8,10 @@ OpenBSD|NetBSD|FreeBSD)
has_or_fail vnconfig
;;
Linux)
- has_or_fail udevinfo
- [ "`udevinfo -V | awk '{print $NF}'`" -ge 59 ] 2>/dev/null || \
+ has /sbin/udevadm && udevver=`/sbin/udevadm -V`
+ [ -z "$udevver" ] && has_or_fail udevinfo && \
+ udevver=`udevinfo -V | awk '{print $NF}'`
+ [ "$udevver" -ge 59 ] 2>/dev/null || \
has hotplug || \
fail "udev is too old, upgrade to version 59 or later"
;;
--- xen-3.4.0.orig/install.sh
+++ xen-3.4.0/install.sh
@@ -30,6 +30,8 @@ echo "Installing Xen from '$src' to '$ds
[ -x "$(which udevinfo)" ] && \
UDEV_VERSION=$(udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
+[ -z "$UDEV_VERSION" -a -x /sbin/udevadm ] && UDEV_VERSION=$(/sbin/udevadm -V)
+
if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
echo " - installing for udev-based system"
rm -rf "$tmp/etc/hotplug"

Now build

# make install-xen
# make install-tools

Install pvops enabled kernel from Jeremy Fitzhradinge git repository:-
Checkout the most recent branch:-

# git clone git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git linux-2.6-xen
# cd linux-2.6-xen
# git checkout origin/xen-tip/next -b xen-tip/next

Setup Xen Dom0 Support

# make menuconfig















Now build kernel

# make
# make modules_install install
# mkinitramfs -o /boot/initrd-2.6.30-rc6-tip.img 2.6.30-rc6-tip

Add entry to /boot/grub/menu.lst:-

title Xen 3.4 / Ubuntu 9.04 kernel 2.6.30-rc6-tip
uuid 34d2c0bd-fe30-47e0-990e-4921caf1e845
kernel /boot/xen-3.4.gz
module /boot/vmlinuz-2.6.30-rc6-tip root=/dev/sda14 ro console=tty0
module /boot/initrd-2.6.30-rc6-tip.img



F11 PV DomU install snapshots:-


























Remote vinagre console














Wednesday, June 10, 2009


Setup Fedora 11 PV DomU at Xen 3.4.1 Dom0 (kernel 2.6.30-rc6-tip) on top of Fedora 11


The most impressive F11 features seems to be the nice Xen 3.4.1 build with python 2.6 coming as default with F11 and graphical installer behavior during pygrub based PV DomU installation phase. F11 is supposed to be installed without libvirt to avoid conflict during Xen 3.4.1 port to Fedora 11 instance. Proceed with building Xen 3.4.1 Dom0 on top of F11.

# yum install gitk dev86 vnc-server bridge-utils
# cd /usr/src
# hg clone http://xenbits.xensource.com/xen-3.4-testing.hg
# cd xen-3.4-testing.hg
# make xen
# make install-xen
# make tools
# make install-tools

Building pvops enabled kernel.


1.To checkout master branch:-

# git clone git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git linux-2.6-xen
# cd linux-2.6-xen
# git checkout origin/xen-tip/master -b xen-tip/master

2.To checkout the most recent branch:-

# git clone git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git linux-2.6-xen
# cd linux-2.6-xen
# git checkout origin/xen-tip/next -b xen-tip/next

To setup Xen Dom0 support run :-

# make menuconfig











# make
# make modules_install install

Create a grub entry:-

title Xen 3.4 / Fedora kernel 2.6.30-rc6-tip
kernel /boot/xen-3.4.gz
module /boot/vmlinuz-2.6.30-rc6-tip root=/dev/mapper/VolGroup01/vg_fedora11 ro console=tty0
module /boot/initrd-2.6.30-rc6-tip.img

Set initdefault to 3 in /etc/inittab and reboot in Xen environment,
having /etc/rc.local to start:-

export HOME=/root
vncserver :1 -geometry 1280x1024 -depth 16
/etc/init.d/xend start
/etc/init.d/xendomains start

Connect to Xen Host remotely via vncviewer





Bring up local Apache Server to create HTTP installation source.

# chkconfig httpd on
# service httpd start
# mount -o loop f11.iso /var/www/html/f11
# wget http://192.168.1.36/f11/images/pxeboot/vmlinuz
# wget http://192.168.1.36/f11/images/pxeboot/initrd.img

Create installation profile:-

name="F11PV"
memory=2048
disk = ['phy:/dev/sdc7,xvda,w' ]
vif = [ 'bridge=eth0' ]
vfb = [ 'type=vnc,vncunused=1']
kernel = "/home/boris/fedora/vmlinuz"
ramdisk = "/home/boris/fedora/initrd.img"
vcpus=2
on_reboot = 'restart'
on_crash = 'restart'


# xm create f11.install
# vncviewer localhost:0

This time graphical installer will be brought up with no issues (vs F10)




















Load DomU via profile:-

name="F11PV"
memory=2048
disk = ['phy:/dev/sdc7,xvda,w' ]
vif = [ 'bridge=eth0' ]
vfb = [ 'type=vnc,vncunused=1']
bootloader = "/usr/bin/pygrub"
vcpus=2
on_reboot = 'restart'
on_crash = 'restart'


# xm create f11.pyrun
# vncviewer localhost:0















OpenSolaris 2009.06 PV DomU at the same Xen Host:-


Sunday, June 07, 2009


Backport ZFS Support for pygrub to Xen 3.3.1 providing via http://gitco.de


Gitco is providing http://www.gitco.de/repo/src/xen-3.3.1-0.src.rpm for free download. It gives am immediate option to back port Pygrub ZFS support from Xen 3.4-testing mercurial tree. Details follow bellow:-

# yum -y install transfig texi2html tetex-latex gtk2-devel libaio-devel gnutls-devel
# yum update ecryptfs-utils
[root@ServerXen ~]# wget http://www.gitco.de/repo/src/xen-3.3.1-0.src.rpm
--16:03:02-- http://www.gitco.de/repo/src/xen-3.3.1-0.src.rpm
Resolving www.gitco.de... 78.47.43.57
Connecting to www.gitco.de|78.47.43.57|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11381385 (11M) [application/x-redhat-package-manager]
Saving to: `xen-3.3.1-0.src.rpm'
100%[========================================================>] 11,381,385 82.0K/s in 97s
16:04:39 (115 KB/s) - `xen-3.3.1-0.src.rpm' saved [11381385/11381385]
[root@ServerXen ~]# rpm -iv xen-3.3.1-0.src.rpm

Edit correspondently:-

# vi /etc/yum.conf
gpgcheck=0
# vi /etc/yum.repos.d/XEN.repo
[xen]
name=CentOS-$releasever - XEN
baseurl=http://www.gitco.de/repo/xen3.3.1
gpgcheck=0

Change directory to /usr/src/redhat and add to reuired change sets to SOURCES

[root@ServerXen redhat]# ls -l
total 40
drwxr-xr-x 3 root root 4096 Jun 7 13:07 BUILD
drwxr-xr-x 4 root root 4096 Jan 28 15:54 RPMS
drwxr-xr-x 2 root root 4096 Jun 7 13:01 SOURCES
drwxr-xr-x 2 root root 4096 Jun 7 13:06 SPECS
drwxr-xr-x 2 root root 4096 Jun 7 13:19 SRPMS
[root@ServerXen redhat]# cd SOURCES
[root@ServerXen SOURCES]# ls -l
total 11116
-rw-r--r-- 1 root root 1296 Jan 21 00:47 xen-3.3.1-config.patch
-rw-r--r-- 1 root root 1779 Jan 21 00:47 xen-3.3.1-dumpdir.patch
-rw-r--r-- 1 root root 1335 Jun 7 13:01 xen-3.3.1-hg19322.patch
-rw-r--r-- 1 root root 1392 Jun 7 13:01 xen-3.3.1-hg19323.patch
-rw-r--r-- 1 root root 2229 Jan 21 00:47 xen-3.3.1-hotplug-locking-rhel.patch
-rw-r--r-- 1 root root 7063 Jan 21 00:47 xen-3.3.1-initscripts.patch
-rw-r--r-- 1 root root 11329774 Jan 5 15:28 xen-3.3.1.tar.gz
-rwx------ 1 root root 325 Aug 26 2008 xen.sysconfig
[root@ServerXen SOURCES]# cd ../SPECS
[root@ServerXen SPECS]# ls -l
total 36
-rw-r--r-- 1 root root 35130 Jun 7 13:06 xen-3.3.1.spec

Modify spec file correspondently :-

[root@ServerXen SPECS]# vi xen-3.3.1.spec
. . . . .
Patch1: %{name}-%{version}-initscripts.patch
Patch2: %{name}-%{version}-hotplug-locking-rhel.patch
Patch3: %{name}-%{version}-dumpdir.patch
Patch4: %{name}-%{version}-config.patch
Patch5: %{name}-%{version}-hg19322.patch
Patch6: %{name}-%{version}-hg19323.patch
. . . . . . . . . . .
%patch1 -p1 -b .init
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
:wq

Now build

[root@ServerXen SOURCES]# rpmbuild -ba ./xen-3.3.1.spec
[root@ServerXen SOURCES]# cd ../SPECS
[root@ServerXen SPECS]# ls -l
total 36
-rw-r--r-- 1 root root 35130 Jun 7 13:06 xen-3.3.1.spec
[root@ServerXen SPECS]# vi xen-3.3.1.spec

When done install ( or reinstall patched RPMS)

[root@ServerXen SPECS]# cd ../RPMS/x86_64
[root@ServerXen x86_64]# ls -l
total 9724
-rwxr-xr-x 1 root root 131 Jun 7 13:38 install.sh
-rw-r--r-- 1 root root 9268378 Jun 7 13:19 xen-3.3.1-0.x86_64.rpm
-rw-r--r-- 1 root root 228948 Jun 7 13:19 xen-debuginfo-3.3.1-0.x86_64.rpm
-rw-r--r-- 1 root root 260567 Jun 7 13:19 xen-devel-3.3.1-0.x86_64.rpm
-rw-r--r-- 1 root root 161287 Jun 7 13:19 xen-libs-3.3.1-0.x86_64.rpm
[root@ServerXen x86_64]# cat install.sh
yum install xen-3.3.1-0.x86_64.rpm \
xen-debuginfo-3.3.1-0.x86_64.rpm \
xen-devel-3.3.1-0.x86_64.rpm \
xen-libs-3.3.1-0.x86_64.rpm
[root@ServerXen x86_64]# ./install.sh


















OpenSolaris 2009.06 PV DomU running at Xen 3.3.1 Dom0 on CentOS 5.3.
Gitco system completely reinstall with patched rpms:-





SSH connection to Xen 3.3.1 Dom0:-


Wednesday, June 03, 2009


Setup opensolaris 2009.06 PV DomU at Xen 3.5-unstable Dom0 ( kernel 2.6.30-rc6-tip)


**********************************
Copy ramdisk and kernel to Dom0
**********************************

[root@ServerXen isos]# cat copy.sh
mount -o loop,ro osol-0906-x86.iso /mnt
cp /mnt/boot/amd64/x86.microroot /home/boris/solaris
cp /mnt/platform/i86xpv/kernel/amd64/unix /home/boris/solaris

***********************
Installation profile:-
***********************

[root@ServerXen solaris]# cat osol200906.install
name = "sol0906"
vcpus = 1
memory = "1024"
kernel = "/home/boris/solaris/unix"
ramdisk = "/home/boris/solaris/x86.microroot"
extra = "/platform/i86xpv/kernel/amd64/unix - nowin -B install_media=cdrom"
disk = ['phy:/dev/loop0,6:cdrom,r','phy:/dev/sdb5,0,w']
vif = ['bridge=eth1']
on_shutdown = "destroy"
on_reboot = "destroy"
on_crash = "destroy"




************************************************
Runtime profile for Xen 3.4 (3.5-unstable) Dom0
************************************************

[root@ServerXen solaris]# cat os0906.pyrun
name = 'OS0L906'
memory = 2048
vcpus = 2
bootloader = '/usr/bin/pygrub'
disk = ['phy:/dev/sdb5,0,w']
vif = [ 'bridge=eth1' ]