Hackery Virt-manager on OpenSuse 11.3 to perform PV Guests installs via Apache Mirrors

September 27, 2010

In other words, hack bellow will have virt-manager to behave exactly as in Fedoras or CentOS environment in regards of any xenified DVD distros loop mounted as pages of local Apache Server or remote official HTTP mirrors not only owned by Novell, but RH as well . View also Xen Hypervisor upgrade up to 4.0.1 on Opensuse 11.3. Looks like regular hacking is what OpenSuse 11.3 needs to be brought to a good shape. Download from the Net virt-manager-0.8.4-5.1.1.src.rpm

# zypper update
# rpm -iv virt-manager-0.8.4-5.1.1.src.rpm
# cd /usr/src/packages/SPECS
Edit virt-manager.spec file , commenting patch51
# Patch51: virtman-vminstall.diff
# %patch51 -p1
Encrease version up 1.1.2
Save spec file and build :-
# zypper install intltool python-gtk-devel \
python-gobject2-devel \
gconf2-devel update-desktop-files
# rpmbuild -bb ./virt-manager.spec
# cd ../RPMS/x*
# zypper install virt-manager-0.8.4-5.1.2.x86_64.rpm

In case when package update doesn’t run smoothly, just remove old one

# zypper remove virt-manager-0.8.4-5.1.1.x86_64

As appears wipe out vm-install utility , which reject to work with http sources for PV Guests installs is as easy as described above.Series of snapshots follow bellow







HVM installs via ISO images run fine also





Xen Hypervisor upgrade up to 4.0.1 on Opensuse 11.3

September 20, 2010

Procedure bellow fixes one hidden issue in recently developed xen-4.0.1_21326_01-1.1.src.rpm. It removes error “xen be core: xen be core: can’t open gnttab device” in corresponding /var/log/xen log file during attempt to run virt-install for PV Guest in VNC mode or attempt to run python installation profile referencing VFB for domains of same kind.

# wget http://download.opensuse.org/repositories/Virtualization:/openSUSE11.3/openSUSE_11.3/src/xen-4.0.1_21326_01-1.1.src.rpm
# rpm -iv xen-4.0.1_21326_01-1.1.src.rpm

To fix error in mentioned above xen-4.0.1_21326_01-1.1.src.rpm for opensuse 11.3 before rebuild make following changes to /usr/src/packages/SOURCES/udev-rools.patch. Just add one “gntdev” line

Index: xen-4.0.1-testing/tools/hotplug/Linux/xen-backend.rules
===================================================================
--- xen-4.0.1-testing.orig/tools/hotplug/Linux/xen-backend.rules
+++ xen-4.0.1-testing/tools/hotplug/Linux/xen-backend.rules
@@ -9,3 +9,4 @@ SUBSYSTEM=="xen-backend", ACTION=="remove"
KERNEL=="evtchn", NAME="xen/%k"
KERNEL=="blktap[0-9]*", NAME="xen/%k"
KERNEL=="pci_iomul", NAME="xen/%k"
+KERNEL=="gntdev", NAME="xen/%k"
+KERNELS=="xen", KERNEL=="xvd*", SUBSYSTEM=="block", OPTIONS+="last_rule"

Now

# zypper install LibVNCServer-devel SDL-devel acpica automake bin86 curl-devel dev86 \
graphviz latex2html libjpeg-devel libxml2-devel ncurses-devel openssl openssl-devel \
pciutils-devel python-devel texinfo transfig \
texlive texlive-latex \
glibc-32bit glibc-devel-32bit

# rpmbuild -bb ./xen.spec

When done

# cd ../RPMS/x86_64
# zypper install xen-4.0.1_21326_01-1.3.x86_64.rpm \
xen-devel-4.0.1_21326_01-1.3.x86_64.rpm \
xen-doc-html-4.0.1_21326_01-1.3.x86_64.rpm \
xen-doc-pdf-4.0.1_21326_01-1.3.x86_64.rpm \
xen-kmp-default-4.0.1_21326_01_k2.6.34.7_0.2-1.3.x86_64.rpm \
xen-kmp-desktop-4.0.1_21326_01_k2.6.34.7_0.2-1.3.x86_64.rpm \
xen-libs-4.0.1_21326_01-1.3.x86_64.rpm \
xen-tools-4.0.1_21326_01-1.3.x86_64.rpm

Download
# wget http://download.opensuse.org/update/11.3/rpm/x86_64/kernel-xen-2.6.34.7-0.2.2.x86_64.rpm
and install the most recent kernel
# rpm ivh kernel-xen-2.6.34.7-0.2.2.x86_64.rpm

After reboot make sure

linux-6t07:~/Desktop # ls -l /dev/xen
total 0
crw----- 1 root root 250, 0 2010-09-20 20:09 blktap0
crw----- 1 root root 10, 57 2010-09-20 20:09 evtchn
crw----- 1 root root 249, 0 2010-09-20 20:09 gntdev
crw----- 1 root root 10, 59 2010-09-20 20:09 pci_iomul

Check xen environment

host : linux-6t07
release : 2.6.34.7-0.2-xen
version : #1 SMP 2010-09-14 14:21:06 +0200
machine : x86_64
nr_cpus : 2
nr_nodes : 1
cores_per_socket : 2
threads_per_core : 1
cpu_mhz : 2999
hw_caps : bfebfbff:20100800:00000000:00000940:0008e3fd:00000000:00000001:00000000
virt_caps : hvm
total_memory : 8191
free_memory : 1029
free_cpus : 0
max_free_memory : 7582
max_para_memory : 7578
max_hvm_memory : 7552
node_to_cpu : node0:0-1
node_to_memory : node0:1029
node_to_dma32_mem : node0:967
max_node_id : 0
xen_major : 4
xen_minor : 0
xen_extra : .1_21326_01-1.3
xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64
xen_scheduler : credit
xen_pagesize : 4096
platform_params : virt_start=0xffff800000000000
xen_changeset : 21326
xen_commandline : vgamode=0x31a vgamode=0x31a
cc_compiler : gcc version 4.5.0 20100604 [gcc-4_5-branch revision 160292] (SU
cc_compile_by : root
cc_compile_domain : site
cc_compile_date : Mon Sep 20 20:02:51 MSD 2010
xend_config_format : 4



GNOME 3 at Xen 4.0.1 (2.6.32.21 pvops) on top of F14 (rawhide)

September 5, 2010

In meantime Xen 4.0.1 is available via rawhide repositories . Been installed along with 2.6.32.21 pvops kernel and the most recent libvirt 0.8.3 on top of F14 (rawhide) via just several yum install commands,it doesn’t require any longer to build xen rpms using corresponding xen-4.0.1-1.f14.src.rpm. Changing preferences allows to play with Gnome 3 shell managing virt-manager and other desktop tools.
Looks like F14 rawhide with Xen 4.0.1 available via yum install and Michael Young’s http://fedorapeople.org/~myoung/dom0/src/kernel-2.6.32.21-167.xendom0.fc12.src.rpm which might be rebuilt on F14 and loaded under xen with init=/sbin/upstart is the most friendly environment for the Xen&Pvops testing.
*********************************************************************************************************
Update on 09/18/10 Fedora 14 to use Upstart not systemd
*********************************************************************************************************
Install xen 4.0.1

[root@fedora14a ~]# yum install xen
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package xen.x86_64 0:4.0.1-1.fc14 set to be installed
–> Processing Dependency: xen-runtime = 4.0.1-1.fc14 for package: xen-4.0.1-1.fc14.x86_64
–> Processing Dependency: PyXML for package: xen-4.0.1-1.fc14.x86_64
–> Processing Dependency: libxenguest.so.4.0()(64bit) for package: xen-4.0.1-1.fc14.x86_64
–> Processing Dependency: libxenctrl.so.4.0()(64bit) for package: xen-4.0.1-1.fc14.x86_64
–> Processing Dependency: libxenstore.so.3.0()(64bit) for package: xen-4.0.1-1.fc14.x86_64
–> Processing Dependency: libflask.so.1.0()(64bit) for package: xen-4.0.1-1.fc14.x86_64
–> Running transaction check
—> Package PyXML.x86_64 0:0.8.4-25.fc14 set to be installed
—> Package xen-libs.x86_64 0:4.0.1-1.fc14 set to be installed
–> Processing Dependency: xen-licenses for package: xen-libs-4.0.1-1.fc14.x86_64
—> Package xen-runtime.x86_64 0:4.0.1-1.fc14 set to be installed
–> Processing Dependency: xen-hypervisor-abi = 4.0 for package: xen-runtime-4.0.1-1.fc14.x86_64
–> Processing Dependency: /usr/bin/qemu-nbd for package: xen-runtime-4.0.1-1.fc14.x86_64
–> Processing Dependency: /usr/bin/qemu-img for package: xen-runtime-4.0.1-1.fc14.x86_64
–> Running transaction check
—> Package qemu-common.x86_64 2:0.13.0-0.5.20100809git25fdf4a.fc14 set to be installed
—> Package qemu-img.x86_64 2:0.13.0-0.5.20100809git25fdf4a.fc14 set to be installed
—> Package xen-hypervisor.x86_64 0:4.0.1-1.fc14 set to be installed
—> Package xen-licenses.x86_64 0:4.0.1-1.fc14 set to be installed
–> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================
Package Arch Version Repository Size
===================================================================================================================
Installing:
xen x86_64 4.0.1-1.fc14 fedora 1.0 M
Installing for dependencies:
PyXML x86_64 0.8.4-25.fc14 updates-testing 894 k
qemu-common x86_64 2:0.13.0-0.5.20100809git25fdf4a.fc14 fedora 258 k
qemu-img x86_64 2:0.13.0-0.5.20100809git25fdf4a.fc14 fedora 169 k
xen-hypervisor x86_64 4.0.1-1.fc14 fedora 3.5 M
xen-libs x86_64 4.0.1-1.fc14 fedora 378 k
xen-licenses x86_64 4.0.1-1.fc14 fedora 59 k
xen-runtime x86_64 4.0.1-1.fc14 fedora 4.6 M

Transaction Summary
===================================================================================================================
Install 8 Package(s)

Total download size: 11 M
Installed size: 31 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 11 M
(1/8): PyXML-0.8.4-25.fc14.x86_64.rpm | 894 kB 00:03
(2/8): qemu-common-0.13.0-0.5.20100809git25fdf4a.fc14.x86_64.rpm | 258 kB 00:00
(3/8): qemu-img-0.13.0-0.5.20100809git25fdf4a.fc14.x86_64.rpm | 169 kB 00:00
(4/8): xen-4.0.1-1.fc14.x86_64.rpm | 1.0 MB 00:04
(5/8): xen-hypervisor-4.0.1-1.fc14.x86_64.rpm | 3.5 MB 00:15
(6/8): xen-libs-4.0.1-1.fc14.x86_64.rpm | 378 kB 00:01
(7/8): xen-licenses-4.0.1-1.fc14.x86_64.rpm | 59 kB 00:00
(8/8): xen-runtime-4.0.1-1.fc14.x86_64.rpm | 4.6 MB 00:20
——————————————————————————————————————-
Total 236 kB/s | 11 MB 00:47
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : xen-licenses-4.0.1-1.fc14.x86_64 1/8
Installing : xen-libs-4.0.1-1.fc14.x86_64 2/8
Installing : PyXML-0.8.4-25.fc14.x86_64 3/8
Installing : 2:qemu-img-0.13.0-0.5.20100809git25fdf4a.fc14.x86_64 4/8
Installing : 2:qemu-common-0.13.0-0.5.20100809git25fdf4a.fc14.x86_64 5/8
Installing : xen-hypervisor-4.0.1-1.fc14.x86_64 6/8
Installing : xen-runtime-4.0.1-1.fc14.x86_64 7/8
Non-fatal POSTIN scriptlet failure in rpm package xen-runtime-4.0.1-1.fc14.x86_64
Restarting xenconsoled (via systemctl): Job failed, see system logs for details.
[FAILED]
warning: %post(xen-runtime-4.0.1-1.fc14.x86_64) scriptlet failed, exit status 1
Installing : xen-4.0.1-1.fc14.x86_64 8/8
Non-fatal POSTIN scriptlet failure in rpm package xen-4.0.1-1.fc14.x86_64
Restarting xend (via systemctl): Job failed, see system logs for details.
[FAILED]
warning: %post(xen-4.0.1-1.fc14.x86_64) scriptlet failed, exit status 1

Installed:
xen.x86_64 0:4.0.1-1.fc14

Dependency Installed:
PyXML.x86_64 0:0.8.4-25.fc14 qemu-common.x86_64 2:0.13.0-0.5.20100809git25fdf4a.fc14
qemu-img.x86_64 2:0.13.0-0.5.20100809git25fdf4a.fc14 xen-hypervisor.x86_64 0:4.0.1-1.fc14
xen-libs.x86_64 0:4.0.1-1.fc14 xen-licenses.x86_64 0:4.0.1-1.fc14
xen-runtime.x86_64 0:4.0.1-1.fc14

Complete!

Then install libvirt 0.8.3

# yum install libvirt libvirt-python python-virtinst virt-manager virt-viewer
# chkconfig libvirtd on

Now checkout and build 2.6.32.21 pvops kernel

# 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 -b xen/stable-2.6.32.x origin/xen/stable-2.6.32.x
# git branch
xen/master
* xen/stable-2.6.32.x - current branch
# make menuconfig

and tune kernel to support Xen in Dom0

# make -j(x)number_of_cores
# make modules_install install

Comment out all xen bridging declarations in /etc/xen/xend-config.sxp except

(network-script /bin/true)

Another option to install Dom0 kernel is via Michael Young kernel-2.6.32.21-167.xendom0.fc12.src.rpm

# wget http://repos.fedorapeople.org/repos/myoung/dom0-kernel/fedora-12/SRPMS/kernel-2.6.32.21-167.xendom0.fc12.src.rpm
# yum install transfig texi2html libaio-devel \
dev86 glibc-devel.i686 \
e2fsprogs-devel gitk iasl
# rpm -iv kernel-2.6.32.21-167.xendom0.fc12.src.rpm
# cd /root/rpmbuild/SPECS
# rpmbuild -bb ./kernel.spec
# cd ../RPMS/x86_64
# yum install \
kernel-2.6.32.21-167.xendom0.fc14.x86_64.rpm \
kernel-devel-2.6.32.21-167.xendom0.fc14.x86_64.rpm \
kernel-debuginfo-2.6.32.21-167.xendom0.fc14.x86_64.rpm \
kernel-headers-2.6.32.21-167.xendom0.fc14.x86_64.rpm \
kernel-debuginfo-common-x86_64-2.6.32.21-167.xendom0.fc14.x86_64.rpm

Creating network initscripts
In the /etc/sysconfig/network-scripts directory it is neccessary
to create 2 config files. The first (ifcfg-eth0) defines your physical
network interface, and says that it will be part of a bridge:

# yum install bridge-utils


# cat > ifcfg-eth0 <<EOF
DEVICE=eth0
HWADDR=00:16:76:D6:C9:45
ONBOOT=yes
BRIDGE=br0
NM_CONTROLLED=no
EOF

Obviously change the HWADDR to match your actual NIC’s address.

The second config file (ifcfg-br0) defines the bridge device:

# cat > ifcfg-br0 <<EOF
DEVICE=br0
TYPE=Bridge
BOOTPROTO=dhcp
ONBOOT=yes
DELAY=0
NM_CONTROLLED=no
EOF

Disable NetworkManager per [1]

# chkconfig NetworkManager off
# chkconfig network on
# service network start

Create grub entry keeping in mind init=/sbin/upstart to be second parameter kernel command line [2].

title Xen 4.0.1 Fedora (2.6.32.21)
root (hd0,8)
kernel /xen.gz
module /vmlinuz-2.6.32.21 init=/sbin/upstart ro root=/dev/mapper/vg_fedora14-lv_root LANG=US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us
module /initramfs-2.6.32.21.img

In case of rebuilding kernel-2.6.32.21-167.xendom0.fc12.src.rpm

title Xen 4.0.1 Fedora (vmlinuz-2.6.32.21-167.xendom0.fc14.x86_64)
root (hd0,8)
kernel /xen.gz
module /vmlinuz-2.6.32.21-167.xendom0.fc14.x86_64 init=/sbin/upstart ro root=/dev/mapper/vg_fedora14-lv_root LANG=US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us
module /initramfs-2.6.32.21-167.xendom0.fc14.x86_64.img

Reboot

[root@fedora14a ~]# xm info
host : fedora14a
release : 2.6.32.21-167.xendom0.fc14.x86_64
version : #1 SMP Mon Sep 6 13:55:35 MSD 2010
machine : x86_64
nr_cpus : 4
nr_nodes : 1
cores_per_socket : 4
threads_per_core : 1
cpu_mhz : 2833
hw_caps : bfebfbff:20100800:00000000:00000940:0408e3fd:00000000:00000001:00000000
virt_caps : hvm
total_memory : 8190
free_memory : 1668
node_to_cpu : node0:0-3
node_to_memory : node0:1668
node_to_dma32_mem : node0:858
max_node_id : 0
xen_major : 4
xen_minor : 0
xen_extra : .1
xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64
xen_scheduler : credit
xen_pagesize : 4096
platform_params : virt_start=0xffff800000000000
xen_changeset : unavailable
xen_commandline :
cc_compiler : gcc version 4.5.1 20100812 (Red Hat 4.5.1-1) (GCC)
cc_compile_by : mockbuild
cc_compile_domain : (none)
cc_compile_date : Wed Aug 25 20:17:21 UTC 2010
xend_config_format : 4

Now brctl should report :-
[root@fedora14a ~]# brctl show

bridge name bridge id STP enabled interfaces
br0 8000.90e6ba2d11eb no eth0
virbr0 8000.000000000000 yes







Setup compiz

# yum install compiz*



References
1.http://wiki.libvirt.org/page/Networking
2.http://lwn.net/Articles/401856/


Follow

Get every new post delivered to your Inbox.