<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux and Virtualization &#187; dom0</title>
	<atom:link href="http://fclose.com/b/linux/tag/dom0/feed/" rel="self" type="application/rss+xml" />
	<link>http://fclose.com/b/linux</link>
	<description>Clear solutions, tutorials and tips on Linux and virtualization from the author&#039;s experience with clusters.</description>
	<lastBuildDate>Sat, 04 Feb 2012 04:40:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Simple Introduction to paravirt_ops for Xen</title>
		<link>http://fclose.com/b/linux/2683/simple-introduction-to-paravirt_ops-for-xen/</link>
		<comments>http://fclose.com/b/linux/2683/simple-introduction-to-paravirt_ops-for-xen/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 04:50:50 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[dom0]]></category>
		<category><![CDATA[domu]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Server config]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=2683</guid>
		<description><![CDATA[The is a simple introduction to paravirt_ops in Linux kernel for Xen, VMware, etc. We make this introduction from the view of code. We use the function raw_local_irq_disable() and raw_local_irq_enable() functions in Linux kernel to introduce paravirt_ops for Xen and Xenified kernel. Please download the introduction to paravirt_ops pdf file: introduction-to-pv-ops-v3.pdf]]></description>
			<content:encoded><![CDATA[<p>The is a simple introduction to paravirt_ops in Linux kernel for Xen, VMware, etc. We make this introduction from the view of code. We use the function raw_local_irq_disable() and raw_local_irq_enable() functions in Linux kernel<br />
to introduce paravirt_ops for Xen and Xenified kernel.</p>
<p>Please download the introduction to paravirt_ops pdf file:</p>
<p><a href="http://fclose.com/t/go/linux/introduction-to-pv-ops-v3.pdf/" rel="nofollow">introduction-to-pv-ops-v3.pdf</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/2683/simple-introduction-to-paravirt_ops-for-xen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xen DomU&#8217;s I/O Performance of LVM and loopback Backed VBDs</title>
		<link>http://fclose.com/b/linux/2260/xen-domus-io-performance-of-lvm-and-loopback-backed-vbds/</link>
		<comments>http://fclose.com/b/linux/2260/xen-domus-io-performance-of-lvm-and-loopback-backed-vbds/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 16:04:15 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[dom0]]></category>
		<category><![CDATA[domu]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=2260</guid>
		<description><![CDATA[This posts list benchmark (using bonnie++) result of I/O performance of Xen LVM and loopback backed VBDs. The configuration of machines Dom0 VCPU: 2 (Intel(R) Xeon(R) CPU E5520  @ 2.27GHz) Memory: 2GB Xen and Linux kernel: Xen 3.4.3 with Xenified 2.6.32.13 kernel DomU VCPU: 2 Memory: 2GB Linux kernel: Fedora (2.6.32.19-163.fc12.x86_64) DomU&#8217;s profile: name="10.0.1.200" vcps=2 [...]]]></description>
			<content:encoded><![CDATA[<p>This posts list benchmark (using bonnie++) result of I/O performance of Xen LVM and loopback backed VBDs.</p>
<h3>The configuration of machines</h3>
<h4>Dom0</h4>
<p>VCPU: 2 (Intel(R) Xeon(R) CPU E5520  @ 2.27GHz)<br />
Memory: 2GB<br />
Xen and Linux kernel: <a href="http://fclose.com/b/2405/setting-up-stable-xen-dom0-with-fedora-xen-3-4-3-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/">Xen 3.4.3 with Xenified 2.6.32.13 kernel</a></p>
<h4>DomU</h4>
<p>VCPU: 2<br />
Memory: 2GB<br />
Linux kernel: Fedora (2.6.32.19-163.fc12.x86_64)</p>
<p>DomU&#8217;s profile:</p>
<pre>name="10.0.1.200"
vcps=2
memory=2048
disk = ['phy:vg_xen/vm-10.0.1.150/vmdisk0,xvda,w']
#disk = ['tap:aio:/lhome/xen/vm0-f12/vmdisk0,xvda,w']
#disk = ['file:/lhome/xen/vm0-f12/vmdisk0,xvda,w']

vif=['bridge=eth0']
bootloader="/usr/bin/pygrub"
#extra="single"
on_reboot='restart'
on_crash='restart'
</pre>
<p>The &#8220;disk&#8221; lines is changed depending on the driver used.</p>
<h3>Benchmark method</h3>
<p>We use Bonnie++ to test the performance of I/O:</p>
<pre># bonnie++ -u root</pre>
<p>We run bonnie++ on one single VM. We also test the performance change after making a snapshot of LVM for a new VM. For the file backed VMs, we also run two VMs together on the same hard disk and run bonnie++ on them.</p>
<p>Bonnie++&#8217;s result is in this format:</p>
<pre>Version 1.03e       ------Sequential Output------ --Sequential Input- --Random-
 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
localhost.locald 4G 76999  98 107423  21 47522  13 73347  91 159847  16 266.0   0
 ------Sequential Create------ --------Random Create--------
 -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
 files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
 16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++
localhost.localdomain,4G,76999,98,107423,21,47522,13,73347,91,159847,16,266.0,0,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
</pre>
<p>We only list the last line which contains all the result in the result section in this post.</p>
<h3>Benchmark result</h3>
<h4>LVM backed VBD</h4>
<pre>localhost.localdomain,4G,76999,98,107423,21,47522,13,73347,91,159847,16,266.0,0,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
localhost.localdomain,4G,79588,98,120078,22,46140,13,75343,94,150167,15,248.7,0,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
localhost.localdomain,4G,81942,98,113617,22,47736,13,75947,94,152110,15,262.1,0,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++</pre>
<h4>New LVM logical volume made by snapshot</h4>
<pre>localhost.localdomain,4G,11846,15,12044,2,27133,7,71510,92,141408,14,262.7,0,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
localhost.localdomain,4G,12200,15,18147,3,33086,9,66687,89,146550,14,251.9,0,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
localhost.localdomain,4G,58521,73,58482,10,33880,9,69399,90,144237,14,267.4,0,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
localhost.localdomain,4G,62553,78,57576,11,32755,9,70037,89,143462,14,259.9,0,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
localhost.localdomain,4G,66031,84,65640,12,34357,9,66036,86,152171,15,266.4,0,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
localhost.localdomain,4G,58666,75,60092,11,34826,9,72821,91,141328,14,259.7,0,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
</pre>
<h4>File backed VBD</h4>
<pre>vm112,4G,20865,27,23559,4,32913,9,63006,81,128395,13,217.9,0,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
vm112,4G,23022,30,18611,3,30086,8,63784,82,125736,13,197.7,0,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
vm112,4G,21485,27,20366,3,29587,8,72130,92,140957,14,239.6,0,16,+++++,+++,+++++,+++,30751,52,+++++,+++,+++++,+++,+++++,+++
vm112,4G,22375,32,21716,3,30300,8,65488,87,128625,13,221.4,0,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
vm112,4G,21968,28,19298,3,29007,8,68469,88,122111,12,222.5,0,16,26967,94,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
vm112,4G,21477,28,20463,3,38395,10,49312,63,154206,15,241.0,0,16,+++++,+++,+++++,+++,32699,56,+++++,+++,+++++,+++,+++++,+++
</pre>
<h4>Two VMs on the same disk running together</h4>
<p>A:</p>
<pre>vm112,4G,10645,13,9498,1,9606,2,30866,41,86911,8,100.1,0,16,9181,22,20583,6,+++++,+++,+++++,+++,+++++,+++,+++++,+++
vm112,4G,10623,13,10143,1,10485,2,26013,35,77362,7,116.3,0,16,25701,66,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
vm112,4G,10824,14,9558,1,12028,3,27503,36,57196,5,92.1,0,16,9679,28,+++++,+++,9294,15,+++++,+++,+++++,+++,+++++,+++
vm112,4G,15098,19,10485,1,12536,3,22771,30,64679,6,142.2,0,16,32006,82,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
vm112,4G,11315,14,9674,1,12052,3,26453,35,68206,7,121.1,0,16,23789,62,32446,13,+++++,+++,+++++,+++,+++++,+++,+++++,+++
vm112,4G,11865,15,11564,2,11508,3,24945,34,61946,6,102.6,0,16,13297,34,21805,7,+++++,+++,+++++,+++,+++++,+++,+++++,+++
</pre>
<p>B:</p>
<pre>vm119,4G,8963,11,9255,1,10909,3,36446,48,70485,7,125.1,0,16,19701,52,23649,8,9574,16,+++++,+++,+++++,+++,+++++,+++
vm119,4G,9074,12,8410,1,12898,3,35266,47,68469,7,107.4,0,16,6585,17,3206,1,+++++,+++,+++++,+++,+++++,+++,+++++,+++
vm119,4G,9151,13,8664,1,10285,2,20120,28,58011,5,90.9,0,16,22894,59,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
vm119,4G,9053,11,10406,1,12852,3,27618,37,55405,5,108.8,0,16,10144,24,22599,7,+++++,+++,+++++,+++,+++++,+++,+++++,+++
vm119,4G,8987,11,11464,1,12123,3,19278,26,59274,6,104.8,0,16,5357,13,23010,7,+++++,+++,7922,18,+++++,+++,+++++,+++
vm119,4G,9593,12,11450,1,30598,8,57078,73,119884,12,222.2,0,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++
</pre>
<h3>Conclusion</h3>
<p>From the evaluation result, we can see that LVM backed VBD of Xen DomU has a much better performance that file backed. From out experiment in our cluster, LVM backed VBD is also quite stable.</p>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/2260/xen-domus-io-performance-of-lvm-and-loopback-backed-vbds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An Introduction to Xen Source Code Structure and Disk in Xen</title>
		<link>http://fclose.com/b/linux/2600/a-introduction-to-xen-source-code-structure-and-disk-in-xen/</link>
		<comments>http://fclose.com/b/linux/2600/a-introduction-to-xen-source-code-structure-and-disk-in-xen/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 05:16:39 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[dom0]]></category>
		<category><![CDATA[domu]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=2600</guid>
		<description><![CDATA[I have created slides from introducing Xen&#8217;s source code structure and backend and frontend drivers in Xen. Please find the PDF version here: xen-code-disk-v2.pdf Animation is enabled which may help to understand it. Update history Dec. 10, 2010. Update pdf to version 2. Animation is added.]]></description>
			<content:encoded><![CDATA[<p>I have created slides from introducing Xen&#8217;s source code structure and backend and frontend drivers in Xen. Please find the PDF version here:</p>
<p><a href="http://fclose.com/t/g/linux/xen-code-disk-v2.pdf/" rel="nofollow">xen-code-disk-v2.pdf</a></p>
<p>Animation is enabled which may help to understand it.</p>
<p><span style="font-size: x-small;">Update history<br />
Dec. 10, 2010. Update pdf to version 2. Animation is added.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/2600/a-introduction-to-xen-source-code-structure-and-disk-in-xen/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting up Stable Xen Dom0 with Fedora: Xen 3.4.3 with Xenified Linux Kernel 2.6.32.13 in Fedora 12</title>
		<link>http://fclose.com/b/linux/2405/setting-up-stable-xen-dom0-with-fedora-xen-3-4-3-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/</link>
		<comments>http://fclose.com/b/linux/2405/setting-up-stable-xen-dom0-with-fedora-xen-3-4-3-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 00:55:23 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Client config]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[dom0]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Server config]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=2405</guid>
		<description><![CDATA[This is the latest stable and recommended stable Xen Dom0 solution on Fedora 12. No serious bug found till now and we will fix the bugs by ourselves if some appears. It also works on Fedora 14 as well. It should not be hard to use this solution on other versions of Fedora or other [...]]]></description>
			<content:encoded><![CDATA[<p>This is the latest stable and recommended stable Xen Dom0 solution on Fedora 12. No serious bug found till now and we will fix the bugs by ourselves if some appears. It also <a href="http://fclose.com/b/linux/2405/setting-up-stable-xen-dom0-with-fedora-xen-3-4-3-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/comment-page-1/#comment-407">works on Fedora 14 as well</a>. It should not be hard to use this solution on other versions of Fedora or other Linux distribution.</p>
<p>How to set up Xen Dom0 with <em>Xenified</em> Linux kernel in Fedora 12 will be introduced in this post. We use Xen 3.4.3 from xen.org and Xenified Linux kernel 2.6.32.13. This is a very stable Dom0 solution for Fedora 12. Lot&#8217;s DomUs have been tested on this platform.</p>
<h3>Hardware:</h3>
<p>Dom0&#8242;s hardware platform:</p>
<p>Motherboard<em>: INTEL S5500BC S5500 Quad Core Xeon Server Board</em><br />
CPU<em>: 2 x Intel Quad Core Xeon E5520 2.26G (5.86GT/sec,8M,Socket 1366)</em><br />
Memory<em>: 8 x Kingston DDR-3 1333MHz 4GB ECC REG. CL9 DIMM w/Parity &amp; Thermal Sensor</em><br />
HD<em>: 4 x WD WD10EARS 1 TB, SATA II 3Gb/s, 64 MB Cache</em></p>
<h3>Linux system:</h3>
<p>Fedora 12 x86_64</p>
<p>SELinux is disabled. Please refer here for detail: <a href="1233/disable-selinux-in-fedora/" target="_blank">Disabled SELinux on Fedora</a>.</p>
<p><em>ext3</em> is recommended for the file system of disk partition for <em>/boot</em>.</p>
<p>Update the system:</p>
<pre># yum update</pre>
<p>The Xen and libvirt packages in Fedora should not be installed to avoid conflict.</p>
<pre># yum erase xen* libvirt</pre>
<h3>Build and install Xen hypervisor and tools</h3>
<h4>Download Xen 3.4.3</h4>
<pre>$ wget http://bits.xensource.com/oss-xen/release/3.4.3/xen-3.4.3.tar.gz
$ tar xf xen-3.4.3.tar.gz</pre>
<h4>Build Xen and tools</h4>
<p>You may need to install packages depended by this. You can try this for solving the dependencies:</p>
<pre># yum install make gcc -y;
yum groupinstall "Development Libraries" -y;
yum groupinstall "Development Tools" -y;
yum install transfig texi2html
dev86 glibc-devel glibc-devel.i686
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 ed -y</pre>
<p>The we can make Xen and Xen tools:</p>
<pre>$ make xen
$ make tools</pre>
<h4>Install Xen and tools</h4>
<pre>$ make install-xen
$ make install-tools</pre>
<h3>Build and install xenified Linux kernel</h3>
<h4>Download Linux kernel 2.6.32.13</h4>
<pre>$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.13.tar.bz2
$ tar xf linux-2.6.32.13.tar.bz2</pre>
<h4>Download 2.6.32 Xen patches v2</h4>
<pre>$ wget http://gentoo-xen-kernel.googlecode.com/files/xen-patches-2.6.32-2.tar.bz2
$ mkdir xen-patches-2.6.32-2
$ tar xf xen-patches-2.6.32-2.tar.bz2 -C xen-patches-2.6.32-2</pre>
<h4>Apply Xen patches</h4>
<p>Apply all the patches downloaded above following the patch number.</p>
<p>You may need to install <em>patch</em> if it isn&#8217;t installed:</p>
<pre># yum install patch</pre>
<p>This patch.sh script can be used (we assume the patch and the kernel are in the same directory):</p>
<p><em>patch.sh:</em></p>
<pre>#!/bin/bash
for P in `ls ../xen-patches-2.6.32-2/6*.patch1 | sort`
do
    patch -p1 -s -i $P
    if [ $? = 0 ]; then
        echo $P applied
    else
        echo "Error processing "$P
        exit 1
    fi
done</pre>
<p>Put this script into Linux source directory and execute:</p>
<pre>$ sh ./patch.sh</pre>
<p>The structure of these directories are as follows:</p>
<pre>|
|-linux-2.6.32.13
|    |
|    `- patch.sh
` xen-patches-2.6.32-2
      |
      `- 6*.patch1</pre>
<h4>Configure Xenified Linux kernel</h4>
<p>A working configuration file that I used can be downloaded directly from here:</p>
<p><a href="http://fclose.com/f/2010/config-2.6.32.13-xenified">config-for-xenified-linux-2.6.32.13</a></p>
<p>Just download this file, put it into the kernel source code file directory and rename it to <em>.config</em> .</p>
<p>Other than use my configuration file, you can also configure it by yourself by using “<em>make menuconfig”</em>.</p>
<p>Make sure you build the kernel with these components enabled:</p>
<pre>Processor type and features  ---&gt;
 [*] Symmetric multi-processing support
 [*] Support sparse irq numbering
<strong> [*] Enable Xen compatible kernel</strong>
<strong></strong>
Device Drivers  ---&gt;
 XEN  ---&gt;
<strong> [*] Privileged Guest (domain 0)</strong>
 &lt;*&gt; Backend driver support (NEW)
 &lt;*&gt;   Block-device backend driver (NEW)
 &lt;*&gt;   Block-device tap backend driver (NEW)
<strong> &lt; &gt; Block-device tap backend driver 2 (NEW)</strong>
<strong> &lt;*&gt; Network-device backend driver (NEW)</strong>
 (8)     Maximum simultaneous transmit requests (as a power of 2) (NEW)
 [ ]     Pipelined transmitter (DANGEROUS) (NEW)
 &lt; &gt;     Network-device loopback driver (NEW)
<strong> &lt; &gt; PCI-device backend driver (NEW)</strong>
 &lt; &gt;   TPM-device backend driver (NEW)
 &lt;M&gt;   SCSI backend driver (NEW)
 &lt;M&gt;   USB backend driver (NEW)
 &lt;M&gt; Block-device frontend driver
 &lt;M&gt; Network-device frontend driver
 &lt;M&gt;   Network-device frontend driver acceleration for Solarflare NICs (NEW)
 &lt;M&gt; SCSI frontend driver (NEW)
 &lt;M&gt; USB frontend driver (NEW)
 [*]   Taking the HCD statistics (for debug) (NEW)
 [ ]   HCD suspend/resume support (DO NOT USE) (NEW)
 &lt;*&gt; User-space granted page access driver (NEW)
 &lt;*&gt; Framebuffer-device frontend driver (NEW)
 &lt;*&gt;   Keyboard-device frontend driver (NEW)
 [*] Disable serial port drivers (NEW)
 &lt;*&gt; Export Xen attributes in sysfs (NEW)
 (256) Number of guest devices (NEW)
<strong> Xen version compatibility (no compatibility code) ---&gt;</strong>
 [*] Place shared vCPU info in per-CPU storage (NEW)</pre>
<h4>Build kernel</h4>
<pre>$ make -jX</pre>
<p><em>X</em> can be two times of the number of the processor. We use this to let <em>make</em> invoke compilation work in X-way<em> </em>parallel.</p>
<h4>Install modules and kernel</h4>
<pre># make modules_install install</pre>
<h3>Configure grub</h3>
<p>Add one entry for Xen in <em>/boot/grub/grub.conf</em>. This is an example entry:</p>
<pre>title Xen 3.4.3 - Xenified Linux 2.6.32.13
  root (hd0,0)
  kernel /xen-3.4.3.gz console=vga vga=ask noreboot
  module /vmlinuz-2.6.32.13 ro root=/dev/mapper/VolGroup-LogVol_root noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us
  module /initramfs-2.6.32.13.img</pre>
<p>The root and other parameters may be different depending on the configuration.</p>
<h3>Make Xend and Xendomains services automatically start when system boots</h3>
<pre># cd /etc/init.d/
# chkconfig --add xend
# chkconfig --add xendomains</pre>
<p>Check whether Xend and Xendomains services are automatically started in level 3-5:</p>
<pre># chkconfig --list | grep xend</pre>
<p>It should be like this:</p>
<pre>xend               0:off    1:off    2:off    3:on    4:on    5:on    6:off
xendomains         0:off    1:off    2:off    3:on    4:on    5:on    6:off</pre>
<h3>Enjoy the fun now!</h3>
<p>After booting the system, you can try to use <em>xm</em> to check xen info</p>
<pre># xm info</pre>
<p>Then <em>xm</em> command can be used to start up DomUs.</p>
<h3>Making the performance more stable</h3>
<p>Allocating dedicated CPU core and memory for Dom0 may provide more stable performance for the Xen platform. Please refer to <a href="2258/managing-xen-dom0s-cpu-and-memory/" target="_blank">Managing Xen Dom0&#8242;s CPU and Memory/</a> for detailed instruction.</p>
<h3>Problems</h3>
<p>A list of common problems and tips can be found in <a href="2354/problems-during-installing-xen-dom0-in-fedora/" target="_blank">Problems during Installing Xen Dom0 in Fedora</a>.</p>
<p>Please refer to<br />
<a href="2367/xen-solutions/">Xen solution</a><br />
for the DomU solution and more Xen Dom0 solution.</p>
<p><span style="font-size: x-small;"><strong>Update history</strong><br />
Sep. 3, 2010. blktap driver is used instead of blktap2; PCI backend driver is disabled.<br />
Sep. 8, 2010. Add install patch; highlight PCI part in make menuconfig.<br />
Sep. 11, 2010. Delete DomU configure file which is not used.<br />
Oct. 19, 2010. Host config in this site.<br />
May. 1, 2011. Fix corrupted URL.<br />
May. 6, 2011. Add directory structure of Xen patch and Kernel src.<br />
Aug. 11, 2011. Add glibc-devel.i686 for depended packages.<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/2405/setting-up-stable-xen-dom0-with-fedora-xen-3-4-3-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Setting up Stable Xen Dom0 with Fedora: Xen 4.0.1 with Xenified Linux Kernel 2.6.32.13 in Fedora 12</title>
		<link>http://fclose.com/b/linux/2412/setting-up-stable-xen-dom0-with-fedora-xen-4-0-1-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/</link>
		<comments>http://fclose.com/b/linux/2412/setting-up-stable-xen-dom0-with-fedora-xen-4-0-1-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 18:51:15 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Client config]]></category>
		<category><![CDATA[dom0]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Server config]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=2412</guid>
		<description><![CDATA[Please refer to Xen solution for the more latest stable Xen Dom0 solution. How to set up Xen Dom0 with Xenified Linux kernel in Fedora 12 will be introduced in this post. We use Xen 4.0.1 from xen.org and Xenified Linux kernel 2.6.32.13. This solution have been tested quite stable in our cluster. Hardware: Dom0&#8242;s [...]]]></description>
			<content:encoded><![CDATA[<p>Please refer to<br />
<a href="2367/xen-solutions/">Xen solution</a><br />
for the more latest stable Xen Dom0 solution.</p>
<p>How to set up Xen Dom0 with <em>Xenified</em> Linux kernel in Fedora 12 will be introduced in this post. We use Xen 4.0.1 from xen.org and Xenified Linux kernel 2.6.32.13. This solution have been tested quite stable in our cluster.</p>
<h3>Hardware:</h3>
<p>Dom0&#8242;s hardware platform:</p>
<p>Motherboard<em>: INTEL S5500BC S5500 Quad Core Xeon Server Board</em><br />
CPU<em>: 2 x Intel Quad Core Xeon E5520 2.26G (5.86GT/sec,8M,Socket  1366)</em><br />
Memory<em>: 8 x Kingston DDR-3 1333MHz 4GB ECC REG. CL9 DIMM  w/Parity &amp;  Thermal Sensor</em><br />
HD<em>: 4 x WD WD10EARS 1 TB, SATA II 3Gb/s, 64 MB Cache</em></p>
<h3>Linux system:</h3>
<p>Fedora 12 x86_64</p>
<p>SELinux is disabled. Please refer here for detail: <a href="1233/disable-selinux-in-fedora/" target="_blank">Disabled SELinux on Fedora</a>.</p>
<p><em>ext3</em> is recommended for the file system of disk partition for <em>/boot</em>.</p>
<p>Update the system:</p>
<pre># yum update</pre>
<p>The Xen and libvirt packages in Fedora should not be installed to avoid conflict.</p>
<pre># yum erase xen* libvirt</pre>
<h3>Build and install Xen hypervisor and tools</h3>
<h4>Download Xen 4.0.1</h4>
<pre>$ wget http://bits.xensource.com/oss-xen/release/4.0.1/xen-4.0.1.tar.gz
$ tar xf xen-4.0.1.tar.gz</pre>
<h4>Build Xen and tools</h4>
<pre>$ make xen
$ make tools</pre>
<p>You may need to install packages depended by this. You can try this for solving the dependencies:</p>
<pre># yum groupinstall "Development Libraries" -y;
yum groupinstall "Development Tools" -y;
yum install transfig 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 -y</pre>
<h4>Install Xen and tools</h4>
<pre>$ make install-xen
$ make install-tools</pre>
<h3>Build and install xenified Linux kernel</h3>
<h4>Download Linux kernel 2.6.32.13</h4>
<pre>$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.13.tar.bz2
$ tar xf linux-2.6.32.13.tar.bz2</pre>
<h4>Download 2.6.32 Xen patches v2</h4>
<pre>$ wget http://gentoo-xen-kernel.googlecode.com/files/xen-patches-2.6.32-2.tar.bz2
$ mkdir xen-patches-2.6.32-2
$ tar xf xen-patches-2.6.32-2.tar.bz2 -C xen-patches-2.6.32-2</pre>
<h4>Apply Xen patches</h4>
<p>Apply all the patches downloaded above following the patch number. This patch.sh script can be used (we assume the patch and the kernel are in the same directory):</p>
<p>patch.sh:</p>
<pre>#!/bin/bash
for P in `ls ../xen-patches-2.6.32-2/6*.patch1 | sort`
do
    patch -p1 -s -i $P
    if [ $? = 0 ]; then
        echo $P applied
    else
        echo "Error processing "$P
        exit 1
    fi
done</pre>
<p>Put this script into Linux source directory and execute:</p>
<pre>$ sh ./patch.sh</pre>
<h4>Configure Xenified Linux kernel</h4>
<p>A working configuration file that I used can be downloaded directly from here:</p>
<p><a href="https://docs.google.com/leaf?id=0BxXe2zOqYbxmZDMwZGQxMTAtNTVlOS00YTU2LTkyYTEtZmY2MGRhNDc5Nzll&amp;hl=en" target="_blank">config-for-xenified-linux-2.6.32.13</a></p>
<p>Just download this file, put it into the kernel source code file directory and rename it to <em>.config</em> .</p>
<p>Other than use my configuration file, you can also configure it by yourself by using “<em>make menuconfig”</em>.</p>
<p>Make sure you build the kernel with these components enabled:</p>
<pre>Processor type and features  ---&gt;
 [*] Symmetric multi-processing support
 [*] Support sparse irq numbering
<strong> [*] Enable Xen compatible kernel</strong>
<strong> Preemption Model (No Forced Preemption (Server))  ---&gt;</strong>

Device Drivers  ---&gt;
 XEN  ---&gt;
<strong> [*] Privileged Guest (domain 0)</strong>
 &lt;*&gt; Backend driver support (NEW)
 &lt;*&gt;   Block-device backend driver (NEW)
 &lt;*&gt;   Block-device tap backend driver (NEW)
<strong> &lt;*&gt;   Block-device tap backend driver 2 (NEW)</strong>
<strong> &lt;*&gt;   Network-device backend driver (NEW)</strong>
 (8)     Maximum simultaneous transmit requests (as a power of 2) (NEW)
 [ ]     Pipelined transmitter (DANGEROUS) (NEW)
 &lt; &gt;     Network-device loopback driver (NEW)
 &lt;*&gt;   PCI-device backend driver (NEW)
 PCI Backend Mode (Virtual PCI)  ---&gt;
 [ ]     PCI Backend Debugging (NEW)
 &lt; &gt;   TPM-device backend driver (NEW)
 &lt;M&gt;   SCSI backend driver (NEW)
 &lt;M&gt;   USB backend driver (NEW)
 &lt;M&gt; Block-device frontend driver
 &lt;M&gt; Network-device frontend driver
 &lt;M&gt;   Network-device frontend driver acceleration for Solarflare NICs (NEW)
 &lt;M&gt; SCSI frontend driver (NEW)
 &lt;M&gt; USB frontend driver (NEW)
 [*]   Taking the HCD statistics (for debug) (NEW)
 [ ]   HCD suspend/resume support (DO NOT USE) (NEW)
 &lt;*&gt; User-space granted page access driver (NEW)
 &lt;*&gt; Framebuffer-device frontend driver (NEW)
 &lt;*&gt;   Keyboard-device frontend driver (NEW)
 [*] Disable serial port drivers (NEW)
 &lt;*&gt; Export Xen attributes in sysfs (NEW)
 (256) Number of guest devices (NEW)
<strong> Xen version compatibility (no compatibility code)  ---&gt;</strong>
 [*] Place shared vCPU info in per-CPU storage (NEW)</pre>
<h4>Build kernel</h4>
<pre>$ make -j16</pre>
<h4>Install modules and kernel</h4>
<pre># make modules_install install</pre>
<h3>Configure grub</h3>
<p>Add one entry for Xen in <em>/boot/grub/grub.conf</em>. This is an example entry:</p>
<pre>title Xen 4.0.1 - Xenified Linux 2.6.32.13
  root (hd0,0)
  kernel /xen-4.0.1.gz console=vga vga=ask noreboot
  module /vmlinuz-2.6.32.13 ro root=/dev/mapper/VolGroup-LogVol_root noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us
  module /initramfs-2.6.32.13.img</pre>
<p>The root and other parameters may be different depending on the configuration.</p>
<h3>Make Xend and Xendomains services automatically start when system boots</h3>
<pre># cd /etc/init.d/
# chkconfig --add xend
# chkconfig --add xendomains</pre>
<p>Check whether Xend and Xendomains services are automatically started in level 3-5:</p>
<pre># chkconfig --list | grep xend</pre>
<p>It should be like this:</p>
<pre>xend               0:off    1:off    2:off    3:on    4:on    5:on    6:off
xendomains         0:off    1:off    2:off    3:on    4:on    5:on    6:off</pre>
<h3>Enjoy the fun now!</h3>
<p>After booting the system, you can try to use <em>xm</em> to check xen info</p>
<pre># xm info</pre>
<p>Then <em>xm</em> command can be used to start up DomUs.</p>
<p>This is one working configuration file for one DomU that I use:</p>
<pre>name="10.0.1.201"
vcpus=2
memory=16384
disk = ['tap:aio:/lhome/xen/vm-10.0.1.201/vmdisk0,xvda,w' ]
# disk = ['file:/lhome/xen/vm-10.0.1.201/vmdisk0,xvda,w' ]
vif = ['bridge=eth0']
bootloader = "/usr/bin/pygrub"
on_reboot = 'restart'
on_crash = 'restart'</pre>
<p>Here we use the <em>blktap </em>backed VBD device which has much better performance than Linux blkback backed VBD device.</p>
<h3>Making the performance more stable</h3>
<p>Allocating dedicated CPU core and memory for Dom0 may provide more stable performance for the Xen platform. Please refer to <a href="2258/managing-xen-dom0s-cpu-and-memory/" target="_blank">Managing Xen Dom0&#8242;s CPU and Memory/</a> for detailed instruction.</p>
<h3>Problems</h3>
<p>Problems and solutions can be found here: <a href="2354/problems-during-installing-xen-dom0-in-fedora/" target="_blank">Problems during Installing Xen Dom0 in Fedora</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/2412/setting-up-stable-xen-dom0-with-fedora-xen-4-0-1-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Setting up Stable Xen Dom0 with Fedora: Xen 3.4.2 with Xenified Linux Kernel 2.6.32.13 in Fedora 12</title>
		<link>http://fclose.com/b/linux/2388/setting-up-stable-xen-dom0-with-fedora-xen-3-4-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/</link>
		<comments>http://fclose.com/b/linux/2388/setting-up-stable-xen-dom0-with-fedora-xen-3-4-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 05:21:24 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[dom0]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Server config]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=2388</guid>
		<description><![CDATA[Please refer to Xen solution for the more latest stable Xen Dom0 solution. How to set up Xen Dom0 with Xenified Linux kernel in Fedora 12 will be introduced in this post. We use Xen 3.4.2 from xen.org and Xenified Linux kernel 2.6.32.13. This is a very stable Dom0 solution for Fedora 12. Lot&#8217;s DomUs [...]]]></description>
			<content:encoded><![CDATA[<p>Please refer to</p>
<p><a href="http://pkill.info/b/2367/xen-solutions/">Xen solution</a></p>
<p>for the more latest stable Xen Dom0 solution.</p>
<hr />
<p>How to set up Xen Dom0 with <em>Xenified</em> Linux kernel in Fedora 12 will be introduced in this post. We use Xen 3.4.2 from xen.org and Xenified Linux kernel 2.6.32.13. This is a very stable Dom0 solution for Fedora 12. Lot&#8217;s DomUs have been tested on this platform.</p>
<h3>Hardware:</h3>
<p>Dom0&#8242;s hardware platform:</p>
<p>Motherboard<em>: INTEL S5500BC S5500 Quad Core Xeon Server Board</em><br />
CPU<em>: 2 x Intel Quad Core Xeon E5520 2.26G (5.86GT/sec,8M,Socket 1366)</em><br />
Memory<em>: 8 x Kingston DDR-3 1333MHz 4GB ECC REG. CL9 DIMM w/Parity &amp; Thermal Sensor</em><br />
HD<em>: 4 x WD WD10EARS 1 TB, SATA II 3Gb/s, 64 MB Cache</em></p>
<h3>Linux system:</h3>
<p>Fedora 12 x86_64</p>
<p>SELinux is disabled. Please refer here for detail: <a href="http://pkill.info/b/1233/disable-selinux-in-fedora/" target="_blank">Disabled SELinux on Fedora</a>.</p>
<p><em>ext3</em> is recommended for the file system of disk partition for <em>/boot</em>.</p>
<p>Update the system:</p>
<pre># yum update</pre>
<p>The Xen and libvirt packages in Fedora should not be installed to avoid conflict.</p>
<pre># yum erase xen* libvirt</pre>
<h3>Build and install Xen hypervisor and tools</h3>
<h4>Download Xen 3.4.2</h4>
<pre>$ wget http://bits.xensource.com/oss-xen/release/3.4.2/xen-3.4.2.tar.gz
$ tar xf xen-3.4.2.tar.gz</pre>
<h4>Build Xen and tools</h4>
<pre>$ make xen
$ make tools</pre>
<p>You may need to install packages depended by this. You can try this for solving the dependencies:</p>
<pre># yum groupinstall "Development Libraries";
yum groupinstall "Development Tools";
yum install transfig 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</pre>
<h4>Install Xen and tools</h4>
<pre>$ make install-xen
$ make install-tools</pre>
<h3>Build and install xenified Linux kernel</h3>
<h4>Download Linux kernel 2.6.32.13</h4>
<pre>$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.13.tar.bz2
$ tar xf linux-2.6.32.13.tar.bz2</pre>
<h4>Download 2.6.32 Xen patches v2</h4>
<pre>$ wget http://gentoo-xen-kernel.googlecode.com/files/xen-patches-2.6.32-2.tar.bz2
$ mkdir xen-patches-2.6.32-2
$ tar xf xen-patches-2.6.32-2.tar.bz2 -C xen-patches-2.6.32-2</pre>
<h4>Apply Xen patches</h4>
<p>Apply all the patches downloaded above following the patch number. This patch.sh script can be used (we assume the patch and the kernel are in the same directory):</p>
<p>patch.sh:</p>
<pre>#!/bin/bash
for P in `ls ../xen-patches-2.6.32-2/6*.patch1 | sort`
do
    patch -p1 -s -i $P
    if [ $? = 0 ]; then
        echo $P applied
    else
        echo "Error processing "$P
        exit 1
    fi
done</pre>
<p>Put this script into Linux source directory and execute:</p>
<pre>$ sh ./patch.sh</pre>
<h4>Configure Xenified Linux kernel</h4>
<p>A working configuration file that I used can be downloaded directly from here:</p>
<p><a href="https://docs.google.com/leaf?id=0BxXe2zOqYbxmZDMwZGQxMTAtNTVlOS00YTU2LTkyYTEtZmY2MGRhNDc5Nzll&amp;hl=en" target="_blank">config-for-xenified-linux-2.6.32.13</a></p>
<p>Just download this file, put it into the kernel source code file directory and rename it to <em>.config</em> .</p>
<p>Other than use my configuration file, you can also configure it by yourself by using “<em>make menuconfig”</em>.</p>
<p>Make sure you build the kernel with these components enabled:</p>
<pre>Processor type and features  ---&gt;
 [*] Symmetric multi-processing support
 [*] Support sparse irq numbering
<strong> [*] Enable Xen compatible kernel</strong>
<strong> Preemption Model (No Forced Preemption (Server)) ---&gt;</strong>

Device Drivers  ---&gt;
 XEN  ---&gt;
<strong> [*] Privileged Guest (domain 0)</strong>
 &lt;*&gt; Backend driver support (NEW)
 &lt;*&gt;   Block-device backend driver (NEW)
 &lt;*&gt;   Block-device tap backend driver (NEW)
<strong> &lt;*&gt; Block-device tap backend driver 2 (NEW)</strong>
<strong> &lt;*&gt; Network-device backend driver (NEW)</strong>
 (8)     Maximum simultaneous transmit requests (as a power of 2) (NEW)
 [ ]     Pipelined transmitter (DANGEROUS) (NEW)
 &lt; &gt;     Network-device loopback driver (NEW)
 &lt;*&gt;   PCI-device backend driver (NEW)
 PCI Backend Mode (Virtual PCI)  ---&gt;
 [ ]     PCI Backend Debugging (NEW)
 &lt; &gt;   TPM-device backend driver (NEW)
 &lt;M&gt;   SCSI backend driver (NEW)
 &lt;M&gt;   USB backend driver (NEW)
 &lt;M&gt; Block-device frontend driver
 &lt;M&gt; Network-device frontend driver
 &lt;M&gt;   Network-device frontend driver acceleration for Solarflare NICs (NEW)
 &lt;M&gt; SCSI frontend driver (NEW)
 &lt;M&gt; USB frontend driver (NEW)
 [*]   Taking the HCD statistics (for debug) (NEW)
 [ ]   HCD suspend/resume support (DO NOT USE) (NEW)
 &lt;*&gt; User-space granted page access driver (NEW)
 &lt;*&gt; Framebuffer-device frontend driver (NEW)
 &lt;*&gt;   Keyboard-device frontend driver (NEW)
 [*] Disable serial port drivers (NEW)
 &lt;*&gt; Export Xen attributes in sysfs (NEW)
 (256) Number of guest devices (NEW)
<strong> Xen version compatibility (no compatibility code) ---&gt;</strong>
 [*] Place shared vCPU info in per-CPU storage (NEW)</pre>
<h4>Build kernel</h4>
<pre>$ make -j16</pre>
<h4>Install modules and kernel</h4>
<pre># make modules_install install</pre>
<h3>Configure grub</h3>
<p>Add one entry for Xen in <em>/boot/grub/grub.conf</em>. This is an example entry:</p>
<pre>title Xen 3.4.2 - Xenified Linux 2.6.32.13
  root (hd0,0)
  kernel /xen-3.4.2.gz console=vga vga=ask noreboot
  module /vmlinuz-2.6.32.13 ro root=/dev/mapper/VolGroup-LogVol_root noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us
  module /initramfs-2.6.32.13.img</pre>
<p>The root and other parameters may be different depending on the configuration.</p>
<h3>Make Xend and Xendomains services automatically start when system boots</h3>
<pre># cd /etc/init.d/
# chkconfig --add xend
# chkconfig --add xendomains</pre>
<p>Check whether Xend and Xendomains services are automatically started in level 3-5:</p>
<pre># chkconfig --list | grep xend</pre>
<p>It should be like this:</p>
<pre>xend               0:off    1:off    2:off    3:on    4:on    5:on    6:off
xendomains         0:off    1:off    2:off    3:on    4:on    5:on    6:off</pre>
<h3>Enjoy the fun now!</h3>
<p>After booting the system, you can try to use <em>xm</em> to check xen info</p>
<pre># xm info</pre>
<p>Then <em>xm</em> command can be used to start up DomUs.</p>
<p>This is one working configuration file for one DomU that I use:</p>
<pre>name="10.0.1.201"
vcpus=2
memory=2048
disk = ['tap:aio:/lhome/xen/vm-10.0.1.201/vmdisk0,xvda,w' ]
# disk = ['file:/lhome/xen/vm-10.0.1.201/vmdisk0,xvda,w' ]
vif = ['bridge=eth0']
bootloader = "/usr/bin/pygrub"
on_reboot = 'restart'
on_crash = 'restart'</pre>
<p>Here we use the <em>blktap </em>backed VBD device which has much better performance than Linux blkback backed VBD device.</p>
<h3>Making the performance more stable</h3>
<p>Allocating dedicated CPU core and memory for Dom0 may provide more stable performance for the Xen platform. Please refer to <a href="http://pkill.info/b/2258/managing-xen-dom0s-cpu-and-memory/" target="_blank">Managing Xen Dom0&#8242;s CPU and Memory/</a> for detailed instruction.</p>
<h3>Problems</h3>
<p>A list of common problems and tips can be found in <a href="http://pkill.info/b/2354/problems-during-installing-xen-dom0-in-fedora/" target="_blank">Problems during Installing Xen Dom0 in Fedora</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/2388/setting-up-stable-xen-dom0-with-fedora-xen-3-4-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up Stable Xen Dom0 with Fedora: Xen 3.4.3 with Xenified Linux Kernel 2.6.31.12 in Fedora 12</title>
		<link>http://fclose.com/b/linux/2356/setting-up-stable-xen-dom0-with-fedora-xen-3-4-3-with-xenified-linux-kernel-2-6-31-12-in-fedora-12/</link>
		<comments>http://fclose.com/b/linux/2356/setting-up-stable-xen-dom0-with-fedora-xen-3-4-3-with-xenified-linux-kernel-2-6-31-12-in-fedora-12/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 16:05:54 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[dom0]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Server config]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=2356</guid>
		<description><![CDATA[Please refer to Xen solution for the latest stable Xen Dom0 solution. How to set up Xen Dom0 with Xenified Linux kernel in Fedora 12 will be introduced in this post. We use Xen 3.4.3 from xen.org and Xenified Linux kernel 2.6.31.12. Hardware: Dom0&#8242;s hardware platform: Motherboard: INTEL S5500BC S5500 Quad Core Xeon Server Board [...]]]></description>
			<content:encoded><![CDATA[<p>Please refer to</p>
<p><a href="2367/xen-solutions/">Xen solution</a></p>
<p>for the latest stable Xen Dom0 solution.</p>
<hr />
<p>How to set up Xen Dom0 with <em>Xenified</em> Linux kernel in Fedora 12 will be introduced in this post. We use Xen 3.4.3 from xen.org and Xenified Linux kernel 2.6.31.12.</p>
<h3>Hardware:</h3>
<p>Dom0&#8242;s hardware platform:</p>
<p>Motherboard<em>: INTEL S5500BC S5500 Quad Core Xeon Server Board</em><br />
CPU<em>: 2 x Intel Quad Core Xeon E5520 2.26G (5.86GT/sec,8M,Socket  1366)</em><br />
Memory<em>: 8 x Kingston DDR-3 1333MHz 4GB ECC REG. CL9 DIMM  w/Parity &amp;  Thermal Sensor</em><br />
HD<em>: 4 x WD WD10EARS 1 TB, SATA II 3Gb/s, 64 MB Cache</em></p>
<h3>Linux system:</h3>
<p>Fedora 12 x86_64</p>
<p>SELinux is disabled. Please refer here for detail: <a href="1233/disable-selinux-in-fedora/" target="_blank">Disabled SELinux on Fedora</a>.</p>
<p><em>ext3</em> is recommended for the file system of disk partition for <em>/boot</em>.</p>
<p>Update the system:</p>
<pre># yum update</pre>
<p>The Xen and libvirt packages in Fedora should not be installed to avoid conflict.</p>
<pre># yum erase xen* libvirt</pre>
<h3>Build and install Xen hypervisor and tools</h3>
<h4>Download Xen 3.4.3</h4>
<pre>$ wget http://bits.xensource.com/oss-xen/release/3.4.3/xen-3.4.3.tar.gz
$ tar xf xen-3.4.3.tar.gz</pre>
<h4>Build Xen and tools</h4>
<pre>$ make xen
$ make tools</pre>
<p>You may need to install packages depended by this. You can try this for solving the dependencies:</p>
<pre># yum groupinstall "Development Libraries";
yum groupinstall "Development Tools";
yum install transfig 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</pre>
<h4>Install Xen and tools</h4>
<pre>$ make install-xen
$ make install-tools</pre>
<h3>Build and install xenified Linux kernel</h3>
<h4>Download Linux kernel 2.6.31.12</h4>
<pre>$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.31.12.tar.bz2
$ tar xf linux-2.6.31.12.tar.bz2</pre>
<h4>Download 2.6.31 Xen patches v14</h4>
<pre>$ wget http://gentoo-xen-kernel.googlecode.com/files/xen-patches-2.6.31-14.tar.bz2
$ mkdir xen-patches-2.6.31-14
$ tar xf xen-patches-2.6.31-14.tar.bz2 -C xen-patches-2.6.31-14</pre>
<h4>Apply Xen patches</h4>
<p>Apply all the patches downloaded above following the patch number. This patch.sh script can be used (we assume the patch and the kernel are in the same directory):</p>
<p>patch.sh:</p>
<pre>#!/bin/bash
for P in `ls ../xen-patches-2.6.31-14/6*.patch1 | sort`
do
    patch -p1 -s -i $P
    if [ $? = 0 ]; then
        echo $P applied
    else
        echo "Error processing "$P
        exit 1
    fi
done</pre>
<p>Put this script into Linux source directory and execute:</p>
<pre>$ sh ./patch.sh</pre>
<h4>Configure Xenified Linux kernel</h4>
<p>A working configuration file that I used can be downloaded directly from here:</p>
<p><a href="https://docs.google.com/a/pkill.info/uc?id=0BxXe2zOqYbxmM2FmODQxMzEtNmZkZS00ZTNkLWEyN2ItMDI0MjY3YTRjYTk5&amp;export=download&amp;hl=en" target="_blank">config-2.6.31.12-xenified</a></p>
<p>Just download this file, put it into the kernel source code file directory and rename it to <em>.config</em> .</p>
<p>Other than use my configuration file, you can also configure it by yourself by using “<em>make menuconfig”</em>.</p>
<p>Make sure you build the kernel with these components enabled:</p>
<pre>Processor type and features  ---&gt;
 [*] Symmetric multi-processing support
 [*] Support sparse irq numbering
<strong> [*] Enable Xen compatible kernel</strong>
<strong> </strong>
Device Drivers  ---&gt;
 XEN  ---&gt;
<strong> [*] Privileged Guest (domain 0)</strong>
 &lt;*&gt; Backend driver support (NEW)
 &lt;*&gt;   Block-device backend driver (NEW)
<strong> &lt;*&gt;   Block-device tap backend driver (NEW)</strong>
<strong> &lt;*&gt;   Block-device tap backend driver 2 (NEW)</strong>
<strong> &lt;*&gt;   Network-device backend driver (NEW)</strong>
 (8)     Maximum simultaneous transmit requests (as a power of 2) (NEW)
 [ ]     Pipelined transmitter (DANGEROUS) (NEW)
 &lt;*&gt;     Network-device loopback driver (NEW)
 &lt; &gt;   PCI-device backend driver (NEW)
 &lt; &gt;   TPM-device backend driver (NEW)
 &lt; &gt;   SCSI backend driver (NEW)
 &lt; &gt;   USB backend driver (NEW)
 &lt; &gt; Block-device frontend driver
 &lt; &gt; Network-device frontend driver
 &lt; &gt; SCSI frontend driver (NEW)
 &lt; &gt; USB frontend driver (NEW)
 &lt;*&gt; User-space granted page access driver (NEW)
 &lt;*&gt; Framebuffer-device frontend driver (NEW)
 &lt;*&gt;   Keyboard-device frontend driver (NEW)
 [*] Disable serial port drivers (NEW)
 &lt;*&gt; Export Xen attributes in sysfs (NEW)
 (256) Number of guest devices (NEW)
<strong> </strong>Xen version compatibility (3.0.2 and later)  ---&gt;</pre>
<h4>Build kernel</h4>
<pre>$ make -j16</pre>
<p>-jN: N may be 16 or other numbers depending on the number of processors in the system.</p>
<h4>Install modules and kernel</h4>
<pre># make modules_install install</pre>
<h3>Configure grub</h3>
<p>Add one entry for Xen in <em>/boot/grub/grub.conf</em>. This is an example entry:</p>
<pre>title Xen 3.4.3 - Xenified Linux 2.6.31.12
  root (hd0,0)
  kernel /xen-3.4.3.gz console=vga vga=ask noreboot
  module /vmlinuz-2.6.31.12 ro root=/dev/mapper/VolGroup-LogVol_root noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us
  module /initramfs-2.6.31.12.img</pre>
<p>The root and other parameters may be different depending on the configuration.</p>
<h3>Make Xend and Xendomains services automatically start when system boots</h3>
<pre># cd /etc/init.d/
# chkconfig --add xend
# chkconfig --add xendomains</pre>
<p>Check whether Xend and Xendomains services are automatically started in level 3-5:</p>
<pre># chkconfig --list | grep xend</pre>
<p>It should be like this:</p>
<pre>xend               0:off    1:off    2:off    3:on    4:on    5:on    6:off
xendomains         0:off    1:off    2:off    3:on    4:on    5:on    6:off</pre>
<h3>Enjoy the fun now!</h3>
<p>After booting the system, you can try to use <em>xm</em> to check xen info</p>
<pre># xm info</pre>
<p>Then <em>xm</em> command can be used to start up DomUs.</p>
<p>This is one working configuration file for one DomU that I use:</p>
<pre>name="10.0.1.201"
vcpus=2
memory=2048
disk = ['tap:aio:/lhome/xen/vm-10.0.1.201/vmdisk0,xvda,w' ]
# disk = ['file:/lhome/xen/vm-10.0.1.201/vmdisk0,xvda,w' ]
vif = ['bridge=eth0']
bootloader = "/usr/bin/pygrub"
on_reboot = 'restart'
on_crash = 'restart'</pre>
<p>Here we use the <em>blktap </em>backed VBD device which has much better performance than Linux blkback backed VBD device.</p>
<h3>Making the performance more stable</h3>
<p>Allocating dedicated CPU core and memory for Dom0 may provide more stable performance for the Xen platform. Please refer to <a href="2258/managing-xen-dom0s-cpu-and-memory/" target="_blank">Managing Xen Dom0&#8242;s CPU and Memory/</a> for detailed instruction.</p>
<h3>Problems</h3>
<p>A list of common problems and tips can be found in <a href="2354/problems-during-installing-xen-dom0-in-fedora/" target="_blank">Problems during Installing Xen Dom0 in Fedora</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/2356/setting-up-stable-xen-dom0-with-fedora-xen-3-4-3-with-xenified-linux-kernel-2-6-31-12-in-fedora-12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problems during Installing Xen Dom0 in Fedora</title>
		<link>http://fclose.com/b/linux/2354/problems-during-installing-xen-dom0-in-fedora/</link>
		<comments>http://fclose.com/b/linux/2354/problems-during-installing-xen-dom0-in-fedora/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 11:58:36 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[dom0]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Server config]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=2354</guid>
		<description><![CDATA[Here is a list of problem that may occur during installing and configuring Xen Dom0 in Fedora. It is found originally in Fedora systems, but the tips in this post should also be helpful for installing Xen Dom0 on other platforms. BIOS configuration If xen stops at: “I/O virtualization disabled.” We may need to enable [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a list of problem that may occur during installing and configuring Xen Dom0 in Fedora. It is found originally in Fedora systems, but the tips in this post should also be helpful for installing Xen Dom0 on other platforms.</p>
<h3>BIOS configuration</h3>
<p>If xen stops at:</p>
<p>“I/O virtualization disabled.”</p>
<p>We may need to enable VT and I/O virtualization in BIOS.</p>
<p>These options can be enabled in BIOS:</p>
<pre>Intel (R) Virtualization Technology
Intel (R) VT for Directed I/O
Interrupt Remapping
Coherency Support
ATS Support</pre>
<h3>Limited number of loop devices</h3>
<p>The default number of loop device in this kernel is 8. When we are using blkback backed VBDs and we need to have more than 8 virtual machines, we should <a href="223/add-more-loop-device-on-linux/" target="_blank">add more loop devices</a>. You need to use the first method (pass parameter max_loop=32 to vmlinuz) if you use my kernel configuration file.</p>
<h3>initramfs related problem</h3>
<p>The <em>initramfs</em> image under /root generated by <em>dracut </em>doesn’t work on some servers. If you have the similiar problem, you can try to use image generated by <em>mkinitrd</em>:</p>
<p>1) Generate initrd-2.6.32.13.img using mkinitrd</p>
<pre>mkinitrd /boot/initrd-2.6.32.13.img 2.6.32.13</pre>
<p>2) Edit entry in <em>/boot/grub/grub.conf</em></p>
<p>Change</p>
<pre>module /initramfs-2.6.32.13.img</pre>
<p>to</p>
<pre>module /initrd-2.6.32.13.img</pre>
<h3><em>drm</em> related problem</h3>
<p>On one of our servers that uses radeon card we have experienced problem related to <em>drm</em>. The system crashes after the kernel printing out information about <em>drm.</em> We can add <em>nomodeset</em> option to kernel command line to bypass this problem.</p>
<p>The kernel command line in <em>/boot/grub.conf</em> will change to:</p>
<pre>module /vmlinuz-2.6.32.13 ro root=/dev/mapper/VolGroup-LogVol_root <strong>nomodeset</strong> noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us</pre>
<p>If Linux kernel can&#8217;t boot even <em>nomodeset</em> has been set which may happen when use Intel i915 series hardware, a tricky solution is setting Xen&#8217;s vga option to let Xen use gfx console. This method can bypass the <em>drm</em> problem. Just replace <em>&#8220;vga=ask&#8221;</em> in Xen&#8217;s options with:</p>
<pre>vga=gfx-1280x1024x32</pre>
<p>to use 1280 x 1024 resolution with 32 bit color.</p>
<p>Xen&#8217;s graphical video mode codes are different from <a href="2218/configuration-of-linux-kernel-video-mode/" target="_blank">Linux Kernel&#8217;s</a>. This is a list of Xen&#8217;s <em>vga</em> option from [1]:</p>
<pre> 'vga=&lt;mode-specifier&gt;[,keep]' where &lt;mode-specifier&gt; is one of:

   'vga=ask':
      display a vga menu of available modes

   'vga=text-80x&lt;rows&gt;':
      text mode, where &lt;rows&gt; is one of {25,28,30,34,43,50,60}

   'vga=gfx-&lt;width&gt;x&lt;height&gt;x&lt;depth&gt;':
      graphics mode, e.g., vga=gfx-1024x768x16

   'vga=mode-&lt;mode&gt;:
      specifies a mode as specified in 'vga=ask' menu
      (NB. menu modes are displayed in hex, so mode numbers here must
           be prefixed with '0x' (e.g., 'vga=mode-0x0318'))

 The option 'keep' causes Xen to continue to print to the VGA console even
 after domain 0 starts to boot. The default behaviour is to relinquish
 control of the console to domain 0.</pre>
<h3>Build kernel on 32bit platform</h3>
<p>You first need to enable PAE support if you’re building 32 bit version of the kernel. Xen only supports 32 bit PAE kernels nowadays. Xen kernel build options won’t show up if you don’t enable PAE for 32 bit builds.</p>
<p>You can enable PAE in “Processor type and features -&gt; High Memory Support (64GB) -&gt; PAE (Physical Address Extension) Support”</p>
<p>I can find Xen options after enable PAE on my laptop. I have never run Xen Dom0 on a 32bit kernel. I can’t say whether it is stable. Please try it and I will appreciate it if you share your result with me ;)</p>
<p>The <em>clocksource=jiffies </em>kernel parameter may be needed.</p>
<h3>Error message related to <em>ksm</em></h3>
<p>If you get lots error messages generated by ksm, you can disable service <em>ksm</em> and <em>ksmtuned</em> to eliminate these error messages:</p>
<pre># chkconfig ksm off
# chkconfig ksmtuned off</pre>
<h3>Xend conflicts with netplugd</h3>
<p><em>Xend</em> will report error when <em>netplugd</em> is started. <em>Xend</em> will print out a error message after about one minutes:</p>
<pre>/etc/xen/scripts/network-bridge: line 240: "sigerr" command not found.</pre>
<p>And the network interface of Linux doesn&#8217;t change. The new bridge can&#8217;t be started and the physical interface will be change name to pethx.</p>
<p>After disable <em>netplugd</em>, <em>xend </em>can start successfully:</p>
<pre># chkconfig netplugd off</pre>
<p><strong>References</strong></p>
<p>[1] http://lists.xensource.com/archives/html/xen-changelog/2007-06/msg00206.html</p>
<p>&#8211;<br />
Update history<br />
Aug. 22, 2010. Add drm tricky and xen video mode; add netplugd caused problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/2354/problems-during-installing-xen-dom0-in-fedora/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Setting Up Stable Xen Dom0 with Fedora: Xen 4.0.0 with Xenified Linux Kernel 2.6.32.13 in Fedora 12</title>
		<link>http://fclose.com/b/linux/2252/setting-up-stable-xen-dom0-with-fedora-xen-4-0-0-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/</link>
		<comments>http://fclose.com/b/linux/2252/setting-up-stable-xen-dom0-with-fedora-xen-4-0-0-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 16:39:39 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[dom0]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Server config]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=2252</guid>
		<description><![CDATA[Please refer to Xen solution for the more latest stable Xen Dom0 solution. How to set up Xen Dom0 with Xenified Linux kernel in Fedora 12 will be introduced in this post. We use Xen 4.0.0 from xen.org and Xenified Linux kernel 2.6.32.13. This solution have been tested quite stable in our cluster. &#160; Hardware: [...]]]></description>
			<content:encoded><![CDATA[<p>Please refer to<br />
<a href="2367/xen-solutions/">Xen solution</a><br />
for the more latest stable Xen Dom0 solution.</p>
<hr />
<p>How to set up Xen Dom0 with <em>Xenified</em> Linux kernel in Fedora 12 will be introduced in this post. We use Xen 4.0.0 from xen.org and Xenified Linux kernel 2.6.32.13. This solution have been tested quite stable in our cluster.</p>
<p>&nbsp;</p>
<h3>Hardware:</h3>
<p>Dom0&#8242;s hardware platform:</p>
<p>Motherboard<em>: INTEL S5500BC S5500 Quad Core Xeon Server Board</em><br />
CPU<em>: 2 x Intel Quad Core Xeon E5520 2.26G (5.86GT/sec,8M,Socket  1366)</em><br />
Memory<em>: 8 x Kingston DDR-3 1333MHz 4GB ECC REG. CL9 DIMM  w/Parity &amp;  Thermal Sensor</em><br />
HD<em>: 4 x WD WD10EARS 1 TB, SATA II 3Gb/s, 64 MB Cache</em></p>
<h3>Linux system:</h3>
<p>Fedora 12 x86_64</p>
<p>SELinux is disabled. Please refer here for detail: <a href="1233/disable-selinux-in-fedora/" target="_blank">Disabled SELinux on Fedora</a>.</p>
<p><em>ext3</em> is recommended for the file system of disk partition for <em>/boot</em>.</p>
<p>Update the system:</p>
<pre># yum update</pre>
<p>The Xen and libvirt packages in Fedora should not be installed to avoid conflict.</p>
<pre># yum erase xen* libvirt</pre>
<h3>Build and install Xen hypervisor and tools</h3>
<h4>Download Xen 4.0.0</h4>
<pre>$ wget http://bits.xensource.com/oss-xen/release/4.0.0/xen-4.0.0.tar.gz
$ tar xf xen-4.0.0.tar.gz</pre>
<h4>Build Xen and tools</h4>
<pre>$ make xen
$ make tools</pre>
<p>You may need to install packages depended by this. You can try this for solving the dependencies:</p>
<pre># yum groupinstall "Development Libraries" -y;
yum groupinstall "Development Tools" -y;
yum install transfig 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 -y</pre>
<h4>Install Xen and tools</h4>
<pre>$ make install-xen
$ make install-tools</pre>
<h3>Build and install xenified Linux kernel</h3>
<h4>Download Linux kernel 2.6.32.13</h4>
<pre>$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.13.tar.bz2
$ tar xf linux-2.6.32.13.tar.bz2</pre>
<h4>Download 2.6.32 Xen patches v2</h4>
<pre>$ wget http://gentoo-xen-kernel.googlecode.com/files/xen-patches-2.6.32-2.tar.bz2
$ mkdir xen-patches-2.6.32-2
$ tar xf xen-patches-2.6.32-2.tar.bz2 -C xen-patches-2.6.32-2</pre>
<h4>Apply Xen patches</h4>
<p>Apply all the patches downloaded above following the patch number. This patch.sh script can be used (we assume the patch and the kernel are in the same directory):</p>
<p>patch.sh:</p>
<pre>#!/bin/bash
for P in `ls ../xen-patches-2.6.32-2/6*.patch1 | sort`
do
    patch -p1 -s -i $P
    if [ $? = 0 ]; then
        echo $P applied
    else
        echo "Error processing "$P
        exit 1
    fi
done</pre>
<p>Put this script into Linux source directory and execute:</p>
<pre>$ sh ./patch.sh</pre>
<p>The structure of these directories are as follows:</p>
<pre>|
|-linux-2.6.32.13
|    |
|    `- patch.sh
` xen-patches-2.6.32-2
      |
      `- 6*.patch1
</pre>
<h4>Configure Xenified Linux kernel</h4>
<p>A working configuration file that I used can be downloaded directly from here:</p>
<p><a href="https://docs.google.com/leaf?id=0BxXe2zOqYbxmZDMwZGQxMTAtNTVlOS00YTU2LTkyYTEtZmY2MGRhNDc5Nzll&amp;hl=en" target="_blank">config-for-xenified-linux-2.6.32.13</a></p>
<p>Just download this file, put it into the kernel source code file directory and rename it to <em>.config</em> .</p>
<p>Other than use my configuration file, you can also configure it by yourself by using “<em>make menuconfig”</em>.</p>
<p>Make sure you build the kernel with these components enabled:</p>
<pre>Processor type and features  ---&gt;
 [*] Symmetric multi-processing support
 [*] Support sparse irq numbering
<strong> [*] Enable Xen compatible kernel</strong>
<strong> Preemption Model (No Forced Preemption (Server))  ---&gt;</strong>

Device Drivers  ---&gt;
 XEN  ---&gt;
<strong> [*] Privileged Guest (domain 0)</strong>
 &lt;*&gt; Backend driver support (NEW)
 &lt;*&gt;   Block-device backend driver (NEW)
 &lt;*&gt;   Block-device tap backend driver (NEW)
<strong> &lt;*&gt;   Block-device tap backend driver 2 (NEW)</strong>
<strong> &lt;*&gt;   Network-device backend driver (NEW)</strong>
 (8)     Maximum simultaneous transmit requests (as a power of 2) (NEW)
 [ ]     Pipelined transmitter (DANGEROUS) (NEW)
 &lt; &gt;     Network-device loopback driver (NEW)
 &lt;*&gt;   PCI-device backend driver (NEW)
 PCI Backend Mode (Virtual PCI)  ---&gt;
 [ ]     PCI Backend Debugging (NEW)
 &lt; &gt;   TPM-device backend driver (NEW)
 &lt;M&gt;   SCSI backend driver (NEW)
 &lt;M&gt;   USB backend driver (NEW)
 &lt;M&gt; Block-device frontend driver
 &lt;M&gt; Network-device frontend driver
 &lt;M&gt;   Network-device frontend driver acceleration for Solarflare NICs (NEW)
 &lt;M&gt; SCSI frontend driver (NEW)
 &lt;M&gt; USB frontend driver (NEW)
 [*]   Taking the HCD statistics (for debug) (NEW)
 [ ]   HCD suspend/resume support (DO NOT USE) (NEW)
 &lt;*&gt; User-space granted page access driver (NEW)
 &lt;*&gt; Framebuffer-device frontend driver (NEW)
 &lt;*&gt;   Keyboard-device frontend driver (NEW)
 [*] Disable serial port drivers (NEW)
 &lt;*&gt; Export Xen attributes in sysfs (NEW)
 (256) Number of guest devices (NEW)
<strong> Xen version compatibility (no compatibility code)  ---&gt;</strong>
 [*] Place shared vCPU info in per-CPU storage (NEW)</pre>
<h4>Build kernel</h4>
<pre>$ make -j16</pre>
<h4>Install modules and kernel</h4>
<pre># make modules_install install</pre>
<h3>Configure grub</h3>
<p>Add one entry for Xen in <em>/boot/grub/grub.conf</em>. This is an example entry:</p>
<pre>title Xen 4.0.0 - Xenified Linux 2.6.32.13
  root (hd0,0)
  kernel /xen-4.0.0.gz console=vga vga=ask noreboot
  module /vmlinuz-2.6.32.13 ro root=/dev/mapper/VolGroup-LogVol_root noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us
  module /initramfs-2.6.32.13.img</pre>
<p>The root and other parameters may be different depending on the configuration.</p>
<h3>Make Xend and Xendomains services automatically start when system boots</h3>
<pre># cd /etc/init.d/
# chkconfig --add xend
# chkconfig --add xendomains</pre>
<p>Check whether Xend and Xendomains services are automatically started in level 3-5:</p>
<pre># chkconfig --list | grep xend</pre>
<p>It should be like this:</p>
<pre>xend               0:off    1:off    2:off    3:on    4:on    5:on    6:off
xendomains         0:off    1:off    2:off    3:on    4:on    5:on    6:off</pre>
<h3>BIOS configuration</h3>
<p>If xen stops at:</p>
<p>“I/O virtualization disabled.”</p>
<p>We may need to enable VT and I/O virtualization in BIOS.</p>
<p>These options can be enabled in BIOS:</p>
<pre>Intel (R) Virtualization Technology
Intel (R) VT for Directed I/O
Interrupt Remapping
Coherency Support
ATS Support</pre>
<h3>Enjoy the fun now!</h3>
<p>After booting the system, you can try to use <em>xm</em> to check xen info</p>
<pre># xm info</pre>
<p>Then <em>xm</em> command can be used to start up DomUs.</p>
<p>This is one working configuration file for one DomU that I use:</p>
<pre>name="10.0.1.201"
vcpus=2
memory=16384
disk = ['tap:aio:/lhome/xen/vm-10.0.1.201/vmdisk0,xvda,w' ]
# disk = ['file:/lhome/xen/vm-10.0.1.201/vmdisk0,xvda,w' ]
vif = ['bridge=eth0']
bootloader = "/usr/bin/pygrub"
on_reboot = 'restart'
on_crash = 'restart'</pre>
<p>Here we use the <em>blktap </em>backed VBD device which has much better performance than Linux blkback backed VBD device.</p>
<h3>Making the performance more stable</h3>
<p>Allocating dedicated CPU core and memory for Dom0 may provide more stable performance for the Xen platform. Please refer to <a href="2258/managing-xen-dom0s-cpu-and-memory/" target="_blank">Managing Xen Dom0&#8242;s CPU and Memory/</a> for detailed instruction.</p>
<h3>Problems</h3>
<p>Here is a list of problem that may occur during the configuration.</p>
<h4>Limited number of loop devices</h4>
<p>The default number of loop device in this kernel is 8. When we are using blkback backed VBDs and we need to have more than 8 virtual machines, we should <a href="223/add-more-loop-device-on-linux/" target="_blank">add more loop devices</a>. You need to use the first method (pass parameter max_loop=32 to vmlinuz) if you use my kernel configuration file.</p>
<h4>initramfs related problem</h4>
<p>The <em>initramfs</em> image under /root generated by <em>dracut </em>doesn’t work on some servers. If you have the similiar problem, you can try to use image generated by <em>mkinitrd</em>:</p>
<p>1) Generate initrd-2.6.32.13.img using mkinitrd</p>
<pre>mkinitrd /boot/initrd-2.6.32.13.img 2.6.32.13</pre>
<p>2) Edit entry in <em>/boot/grub/grub.conf</em></p>
<p>Change</p>
<pre>module /initramfs-2.6.32.13.img</pre>
<p>to</p>
<pre>module /initrd-2.6.32.13.img</pre>
<h4>drm related problem</h4>
<p>On one of our servers that uses radeon card we have experienced problem related to <em>drm</em>. The system crashes after the kernel printing out information about <em>drm.</em> We can add <em>nomodeset</em> option to kernel command line to bypass this problem.</p>
<p>The kernel command line in <em>/boot/grub.conf</em> will change to:</p>
<pre>module /vmlinuz-2.6.32.13 ro root=/dev/mapper/VolGroup-LogVol_root <strong>nomodeset</strong> noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us</pre>
<h4>Build kernel on 32bit platform</h4>
<p>You first need to enable PAE support if you’re building 32 bit version of the kernel. Xen only supports 32 bit PAE kernels nowadays. Xen kernel build options won’t show up if you don’t enable PAE for 32 bit builds.</p>
<p>You can enable PAE in “Processor type and features -&gt; High Memory Support (64GB) -&gt; PAE (Physical Address Extension) Support”</p>
<p>I can find Xen options after enable PAE on my laptop. I have never run Xen Dom0 on a 32bit kernel. I can’t say whether it is stable. Please try it and I will appreciate it if you share your result with me ;)</p>
<p>The <em>clocksource=jiffies </em>kernel parameter may be needed. Please refer to Larry Matter&#8217;s reply below. He installed Xen with 32bit kernel successfully.<cite><strong> </strong></cite></p>
<h4>Error message about ksm</h4>
<p>If you get lots error messages generated by ksm, you can disable service <em>ksm</em> and <em>ksmtuned</em> to eliminate these error messages:</p>
<pre># chkconfig ksm off
# chkconfig ksmtuned off</pre>
<p>More problems and solutions can be found here: <a href="2354/problems-during-installing-xen-dom0-in-fedora/" target="_blank">Problems during Installing Xen Dom0 in Fedora</a></p>
<p><span style="font-size: x-small;"><strong>Update history</strong><br />
Aug. 10, 2010. Add clocksource kernel parameter for 32bit; Add dependency list;<br />
May. 6, 2011. Add directory structure when compiling Xen and kernel.<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/2252/setting-up-stable-xen-dom0-with-fedora-xen-4-0-0-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Managing Xen Dom0&#8242;s CPU and Memory</title>
		<link>http://fclose.com/b/linux/2258/managing-xen-dom0s-cpu-and-memory/</link>
		<comments>http://fclose.com/b/linux/2258/managing-xen-dom0s-cpu-and-memory/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 15:12:54 +0000</pubDate>
		<dc:creator>Zhiqiang Ma</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[dom0]]></category>
		<category><![CDATA[domu]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Server config]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://pkill.info/b/?p=2258</guid>
		<description><![CDATA[The performance of Xen&#8217;s Dom0 is important for the overall system. The disk and network drivers are running on Dom0. I/O intensive guests&#8217; workloads may consume lots Dom0&#8242;s CPU cycles. The Linux kernel calculates various network related parameters based on the amount of memory at boot time. The kernel also allocate memory for storing memory [...]]]></description>
			<content:encoded><![CDATA[<p>The performance of Xen&#8217;s Dom0 is important for the overall system. The disk and network drivers are running on Dom0. I/O intensive guests&#8217; workloads may consume lots Dom0&#8242;s CPU cycles. The Linux kernel calculates various network related parameters based on the amount of memory at boot time. The kernel also allocate memory for storing memory metadata (per page info structures) is also based on the boot time amount of memory. After ballooning down Dom0&#8242;s memory, the network related parameters will not be correct. Ballooning down busy Dom0&#8242;s memory sometimes cause SSH to die from our observation, which is a nightmare for the administrator since SSH is usually the only way for remote control of the server. Another bed effect is that it&#8217;s a waste of memory with a large memory metadata for a smaller memory amount.</p>
<p>Please refer to <a href="2367/xen-solutions/">Xen solution</a> for the more latest <strong>stable Xen Dom0 solution</strong>.</p>
<p>Now let&#8217;s look at how to menage Xen Dom0&#8242;s CPU and memory in a better way.</p>
<h3>Dedicate a CPU core for Dom0</h3>
<p>Dom0 will have free CPU time to process the I/O requests from the DomUs if it has dedicated CPU core(s). Better performance may be achieved by this since there are less CPU context switches to do in Dom0.</p>
<p>We can dedicate CPU core for Dom0 by passing &#8220;<strong><em>dom0_max_vcpus=X dom0_vcpus_pin</em></strong>&#8221; options to Xen hypervisor (<em>xen.gz</em>) in <em>/boot/grub/grub.conf</em>. <em>X</em> is the number of vcpus dedicated to Dom0.</p>
<p>As hyperthreading technology is enabled in most modern CPUs, we need to specify two processors to dedicate one CPU core. So the <em>&#8220;X&#8221;</em> above should usually be <em>2</em> for one CPU core.</p>
<pre>kernel /xen.gz console=vga vga=ask noreboot <strong>dom0_max_vcpus=2 dom0_vcpus_pin</strong></pre>
<p>After booting the system, the VCPU list can be got on Dom0 by this command:</p>
<pre># xm vcpu-list</pre>
<p>Even after booting the system, the VCPU number can be configured by <em>xm</em> command. We can set Domain-0 have two VCPUs and processor 0 and 1 to be dedicated to Dom0 by these commands:</p>
<pre># xm vcpu-set Domin-0 2
# xm vcpu-pin Domain-0 0
# xm vcpu-pin Domain-0 1</pre>
<h3>Dedicate memory for Dom0</h3>
<p>We should always dedicate fixed amount of memory for Xen Dom0.</p>
<p>We can set the initial memory size of Dom0 by passing &#8220;<em>dom0_mem=xxx&#8221;</em> (in KB) option to Xen hypervisor (<em>gen.gz</em>) in <em>/boot/grub/grub.conf.</em> &#8220;<em>xxx&#8221; </em>is the amount of memory for Dom0 in KB.</p>
<p>If we set the initial memory size of Dom0 to 2GB, just change the entry in <em>grub.conf</em> to:</p>
<pre>kernel /xen.gz console=vga vga=ask noreboot dom0_max_vcpus=2 dom0_vcpus_pin <strong>dom0_mem=2097152</strong></pre>
<h4>Set lowest permissible memory for Dom0</h4>
<p>The option dom0-min-mem in Xend configuration file <em>/etc/xen/xend-config.sxp</em> is used to specify the lowest permissible memory for Dom0.</p>
<p>The value of <em>dom0-min-mem</em> (in MB) is the lowest permissible memory level for Dom0. The default value is 256. If we limit the memory size of Dom0 to 2G, just set:</p>
<pre>(dom0-min-mem 2048)</pre>
<h4>Preventing dom0 memory ballooning</h4>
<p>The &#8220;<em>enable-dom0-ballooning</em>&#8221; option in Xend configuration file is used to specify whether Dom0&#8242;s memory can be ballooned out. Setting<em> &#8220;enable-dom0-ballooning&#8221; </em>to <em>&#8220;no&#8221;</em> will make sure Xend never takes any memory away from Dom0:</p>
<pre>(enable-dom0-ballooning no)</pre>
]]></content:encoded>
			<wfw:commentRss>http://fclose.com/b/linux/2258/managing-xen-dom0s-cpu-and-memory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

