Xen on Fedora 13: Difference between revisions

From Alteeve Wiki
Jump to navigation Jump to search
No edit summary
Line 5: Line 5:
----
----


= Installing from RPM =
'''Note''': This method uses the older Xen 3.4.x tools and myoung's [[dom0]], which does '''not''' support [[DRBD]].


= Installing from RPM =
== Xen Hypervisor ==


Installing Xen (minus [[dom0]]) is trivial:
Installing Xen (minus [[dom0]]) is trivial:
Line 14: Line 17:
</source>
</source>


= Building from Source =
== dom0 ==
 
This uses a kernel built for Fedora 12, but it works on Fedora 13.
 
Add the repo:
 
<source lang="bash">
cd /etc/yum.repos.d/
wget -c http://myoung.fedorapeople.org/dom0/myoung.dom0.repo
</source>


This is the only way to get Xen 4.0 at the time of writing. It seems to not play nicely with DRBD though.
Edit the repo file and change the two <span class="code">enabled=0</span> entries to <span class="code">enabled=1</span>.


All of this is from [http://wiki.xensource.com/xenwiki/Xen4.0 here].
<source lang="bash">
vim /etc/yum.repos.d/myoung.dom0.repo
</source>
<source lang="text">
[myoung-dom0]
name=myoung's repository of Fedora based dom0 kernels - $basearch
baseurl=http://fedorapeople.org/~myoung/dom0/$basearch/
enabled=1
gpgcheck=0
 
[myoung-dom0-source]
name=myoung's repository of Fedora based dom0 kernels - Source
baseurl=http://fedorapeople.org/~myoung/dom0/src/
enabled=1
gpgcheck=0
</source>
 
Install the [[Xen]] [[dom0]] kernel (edit the version number if needed).
 
<source lang="bash">
yum install kernel-2.6.32.17-157.xendom0.fc12.x86_64
</source>
 
The entry in grub's <span class="code">/boot/grub/menu.lst</span> won't work. You will need to edit it to look like this:
 
<source lang="bash">
title Xen 3.4.x, Linux kernel 2.6.32.17-157.xendom0.fc12.x86_64
root  (hd0,0)
kernel /xen.gz dom0_mem=1024M
module /vmlinuz-2.6.32.17-157.xendom0.fc12.x86_64 ro root=/dev/mapper/vg_01-lv_root rd_MD_UUID=4f48439e:39ec22e8:a6154857:c340036f rd_LVM_LV=vg_01/lv_root rd_LVM_LV=vg_01/lv_swap rd_NO_LUKS rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
module /initramfs-2.6.32.17-157.xendom0.fc12.x86_64.img
</source>
 
Add this to <span class="code">/etc/fstab</span>
 
<source lang="bash">
vim /etc/fstab
</source>
<source lang="text">
xenfs                  /proc/xen              xenfs  defaults        0 0
</source>


== Install Requirements ==
= Build from source =


Install:
Install:
== Install Requirements ==


<source lang="bash">
<source lang="bash">
Line 31: Line 85:
</source>
</source>


== Build from source ==
This is required if you want [[dom0]] and [[DRBD]].
 
== Xen Hypervisor ==


'''Note''': These are the tools, not [[dom0]].
'''Note''': These are the tools, not [[dom0]].
Line 37: Line 93:
From mercurial, stable tag.
From mercurial, stable tag.


Get version 4.0.0 (or newer, depending on what the latest stable is):
Get version 4.0.1 (or newer, depending on what the latest stable is):
<source lang="bash">
<source lang="bash">
hg clone -r RELEASE-4.0.0 http://xenbits.xen.org/xen-4.0-testing.hg
hg clone -r RELEASE-4.0.1 http://xenbits.xen.org/xen-4.0-testing.hg
</source>
</source>


Line 59: Line 115:
</source>
</source>


Done.
== dom0 ==


= dom0 =
This is the only way to get Xen 4.0.1 at the time of writing.


== From RPM ==
All of this is from [http://wiki.xensource.com/xenwiki/Xen4.0 here].
 
This uses a kernel built for Fedora 12, but it works on Fedora 13.
 
Add the repo:
 
<source lang="bash">
cd /etc/yum.repos.d/
wget -c http://myoung.fedorapeople.org/dom0/myoung.dom0.repo
</source>
 
Edit the repo file and change the two <span class="code">enabled=0</span> entries to <span class="code">enabled=1</span>.
 
<source lang="bash">
vim /etc/yum.repos.d/myoung.dom0.repo
</source>
<source lang="text">
[myoung-dom0]
name=myoung's repository of Fedora based dom0 kernels - $basearch
baseurl=http://fedorapeople.org/~myoung/dom0/$basearch/
enabled=1
gpgcheck=0
 
[myoung-dom0-source]
name=myoung's repository of Fedora based dom0 kernels - Source
baseurl=http://fedorapeople.org/~myoung/dom0/src/
enabled=1
gpgcheck=0
</source>
 
Install the [[Xen]] [[dom0]] kernel (edit the version number if needed).
 
<source lang="bash">
yum install kernel-2.6.32.17-157.xendom0.fc12.x86_64
</source>
 
The entry in grub's <span class="code">/boot/grub/menu.lst</span> won't work. You will need to edit it to look like this:


'''Note''': Copy and modify the entry created by the RPM. Simply copying this entry will almost certainly not work!
'''Note''': Copy and modify the entry created by the RPM. Simply copying this entry will almost certainly not work!


'''Xen 4.0.0''':
'''Xen 4.0.1''':


<source lang="bash">
<source lang="bash">
title Xen 4.0.0, Linux kernel 2.6.32.17-157.xendom0.fc12.x86_64
title Xen 4.0.1, Linux kernel 2.6.32.17-157.xendom0.fc12.x86_64
root  (hd0,0)
root  (hd0,0)
kernel /xen-4.0.0.gz dom0_mem=1024M
kernel /xen-4.0.1.gz dom0_mem=1024M
module /vmlinuz-2.6.32.17-157.xendom0.fc12.x86_64 ro root=/dev/mapper/vg_01-lv_root rd_MD_UUID=4f48439e:39ec22e8:a6154857:c340036f rd_LVM_LV=vg_01/lv_root rd_LVM_LV=vg_01/lv_swap rd_NO_LUKS rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
module /vmlinuz-2.6.32.17-157.xendom0.fc12.x86_64 ro root=/dev/mapper/vg_01-lv_root rd_MD_UUID=4f48439e:39ec22e8:a6154857:c340036f rd_LVM_LV=vg_01/lv_root rd_LVM_LV=vg_01/lv_swap rd_NO_LUKS rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
module /initramfs-2.6.32.17-157.xendom0.fc12.x86_64.img
module /initramfs-2.6.32.17-157.xendom0.fc12.x86_64.img
</source>
</source>
'''Xen 3.x''':
<source lang="bash">
title Xen 3.4.x, Linux kernel 2.6.32.17-157.xendom0.fc12.x86_64
root  (hd0,0)
kernel /xen.gz dom0_mem=1024M
module /vmlinuz-2.6.32.17-157.xendom0.fc12.x86_64 ro root=/dev/mapper/vg_01-lv_root rd_MD_UUID=4f48439e:39ec22e8:a6154857:c340036f rd_LVM_LV=vg_01/lv_root rd_LVM_LV=vg_01/lv_swap rd_NO_LUKS rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
module /initramfs-2.6.32.17-157.xendom0.fc12.x86_64.img
</source>


Add this to <span class="code">/etc/fstab</span>
Add this to <span class="code">/etc/fstab</span>
Line 133: Line 142:
</source>
</source>


== Make cman and xend play nice ==
= Make cman and xend play nice =


By default under Fedora 13, <span class="code">cman</span> will start before <span class="code">xend</span>. This is a problem because <span class="code">xend</span> takes the network down as part of it's setup. This causes [[totem]] communication to fail which leads to fencing.
By default under Fedora 13, <span class="code">cman</span> will start before <span class="code">xend</span>. This is a problem because <span class="code">xend</span> takes the network down as part of it's setup. This causes [[totem]] communication to fail which leads to fencing.

Revision as of 01:59, 26 August 2010

 AN!Wiki :: How To :: Xen on Fedora 13

Warning: This is currently a dumping ground for notes. DO NOT FOLLOW THIS DOCUMENT'S INSTRUCTIONS. Seriously, it could blow up your computer or cause winter to come early.


Installing from RPM

Note: This method uses the older Xen 3.4.x tools and myoung's dom0, which does not support DRBD.

Xen Hypervisor

Installing Xen (minus dom0) is trivial:

yum install xen

dom0

This uses a kernel built for Fedora 12, but it works on Fedora 13.

Add the repo:

cd /etc/yum.repos.d/
wget -c http://myoung.fedorapeople.org/dom0/myoung.dom0.repo

Edit the repo file and change the two enabled=0 entries to enabled=1.

vim /etc/yum.repos.d/myoung.dom0.repo
[myoung-dom0]
name=myoung's repository of Fedora based dom0 kernels - $basearch
baseurl=http://fedorapeople.org/~myoung/dom0/$basearch/
enabled=1
gpgcheck=0

[myoung-dom0-source]
name=myoung's repository of Fedora based dom0 kernels - Source
baseurl=http://fedorapeople.org/~myoung/dom0/src/
enabled=1
gpgcheck=0

Install the Xen dom0 kernel (edit the version number if needed).

yum install kernel-2.6.32.17-157.xendom0.fc12.x86_64

The entry in grub's /boot/grub/menu.lst won't work. You will need to edit it to look like this:

title Xen 3.4.x, Linux kernel 2.6.32.17-157.xendom0.fc12.x86_64
	root   (hd0,0)
	kernel /xen.gz dom0_mem=1024M
	module /vmlinuz-2.6.32.17-157.xendom0.fc12.x86_64 ro root=/dev/mapper/vg_01-lv_root rd_MD_UUID=4f48439e:39ec22e8:a6154857:c340036f rd_LVM_LV=vg_01/lv_root rd_LVM_LV=vg_01/lv_swap rd_NO_LUKS rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
	module /initramfs-2.6.32.17-157.xendom0.fc12.x86_64.img

Add this to /etc/fstab

vim /etc/fstab
xenfs                   /proc/xen               xenfs   defaults        0 0

Build from source

Install:

Install Requirements

yum -y groupinstall "Development Libraries"
yum -y groupinstall "Development Tools"
yum -y install transfig wget texi2html libaio-devel dev86 glibc-devel e2fsprogs-devel gitk mkinitrd iasl xz-devel bzip2-devel pciutils-libs pciutils-devel SDL-devel libX11-devel gtk2-devel bridge-utils PyXML qemu-common qemu-img mercurial
yum -y install glibc-devel.i686

This is required if you want dom0 and DRBD.

Xen Hypervisor

Note: These are the tools, not dom0.

From mercurial, stable tag.

Get version 4.0.1 (or newer, depending on what the latest stable is):

hg clone -r RELEASE-4.0.1 http://xenbits.xen.org/xen-4.0-testing.hg

Go into the directory and compile the tools:

cd xen-4.0-testing.hg
make xen
make tools
make stubdom

Install the tools (assuming compile worked):

make install-xen
make install-tools
make install-stubdom

dom0

This is the only way to get Xen 4.0.1 at the time of writing.

All of this is from here.

Note: Copy and modify the entry created by the RPM. Simply copying this entry will almost certainly not work!

Xen 4.0.1:

title Xen 4.0.1, Linux kernel 2.6.32.17-157.xendom0.fc12.x86_64
	root   (hd0,0)
	kernel /xen-4.0.1.gz dom0_mem=1024M
	module /vmlinuz-2.6.32.17-157.xendom0.fc12.x86_64 ro root=/dev/mapper/vg_01-lv_root rd_MD_UUID=4f48439e:39ec22e8:a6154857:c340036f rd_LVM_LV=vg_01/lv_root rd_LVM_LV=vg_01/lv_swap rd_NO_LUKS rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
	module /initramfs-2.6.32.17-157.xendom0.fc12.x86_64.img

Add this to /etc/fstab

vim /etc/fstab
xenfs                   /proc/xen               xenfs   defaults        0 0

Make cman and xend play nice

By default under Fedora 13, cman will start before xend. This is a problem because xend takes the network down as part of it's setup. This causes totem communication to fail which leads to fencing.

To avoid this, edit /etc/init.d/cman and tell it to start after xend by adding "xend" to Required-Start and Required-Stop boot facility lists.

When done, the cman LSB header should look like this:

vim /etc/init.d/cman
### BEGIN INIT INFO
# Provides:             cman
# Required-Start:       $network $time xend
# Required-Stop:        $network $time xend
# Default-Start:
# Default-Stop:
# Short-Description:    Starts and stops cman
# Description:          Starts and stops the Cluster Manager set of daemons
### END INIT INFO

Lastly, remove and re-add the cman daemon and add the xend daemon to the start list:

chkconfig cman off
chkconfig cman on
chkconfig xend on

Done. You should be able to reboot into the dom0 kernel now.

Misc

Source RPM: xen-4.0.1-0.1.rc6.fc13.src.rpm

 

Any questions, feedback, advice, complaints or meanderings are welcome.
Alteeve's Niche! Enterprise Support:
Alteeve Support
Community Support
© Alteeve's Niche! Inc. 1997-2024   Anvil! "Intelligent Availability®" Platform
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions.