<?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>Scienco.org &#187; Xen</title>
	<atom:link href="http://www.scienco.org/tag/xen/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scienco.org</link>
	<description>Life&#039;s too short to be unenthusiastic</description>
	<lastBuildDate>Wed, 14 Jul 2010 19:06:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
	<atom:link rel="next" href="http://www.scienco.org/tag/xen/feed/?page=2" />

		<item>
		<title>FreeBSD 7.0 on Xen 3.2</title>
		<link>http://www.scienco.org/2008/freebsd-70-on-xen-32/</link>
		<comments>http://www.scienco.org/2008/freebsd-70-on-xen-32/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 16:05:31 +0000</pubDate>
		<dc:creator>Mikkel Meyer Andersen</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://www.scienco.org/?p=184</guid>
		<description><![CDATA[After I got Xen installed on Ubuntu Server 8.04, I wanted to install FreeBSD 7.0, too. But this was in no regards as easy as installing Ubuntu Server 8.04 as a domU! To run a domU you have to possibilities with Xen: either with a modified kernel or using the so-called HVM (Hardware Virtual Machine) [...]]]></description>
			<content:encoded><![CDATA[<p>After I got Xen installed on Ubuntu Server 8.04, I wanted to install FreeBSD 7.0, too. But this was in no regards as easy as installing Ubuntu Server 8.04 as a domU!<span id="more-184"></span> To run a domU you have to possibilities with Xen: either with a modified kernel or using the so-called HVM (Hardware Virtual Machine) possibility. The latter has to be used when using operating systems on which the kernel cannot be changed, e.g. Windows. To be able to use the HVM-method, a compatible processor is required (please refer to <a href="http://wiki.xensource.com/xenwiki/HVM_Compatible_Processors">http://wiki.xensource.com/xenwiki/HVM_Compatible_Processors</a> for a list of these, but generally speaking Intel VT or AMD-V is required). The downside with HVM is that it doesn&#8217;t yield as high performance as a modified kernel &#8211; generally speaking (optimized device drivers for some operating systems, e.g. Windows 2003 Server, should be available). On the other hand, the fact that you&#8217;re able to use operating systems as domU without modifying the kernel is rather applicable! In general, please refer to <a href="http://wiki.xensource.com/xenwiki/OSCompatibility">http://wiki.xensource.com/xenwiki/OSCompatibility</a> in order to review operating system compatibility.</p>
<p>I, of course, prefer the use a modified kernel given the performance difference. In Ubuntu the same Xen-enabled kernel can be used for both dom0 and for domUs (and often is, too). It can be a bit tough to understand how it works, but don&#8217;t mind about that.</p>
<p>Well, as said I wanted to use FreeBSD 7.0 as domU, so I needed to find an appropriate Xen-enabled kernel to use. As a starting point, I consulted section 21.2.2.2 in the Handbook at <a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/virtualization-guest.html">http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/virtualization-guest.html</a>. Here it was possible to download a kernel for Xen 3.0, but I have Xen 3.2 &#8211; and the link to the kernel has broken anyway. Well, not much success here. And after several hours of search the web I hadn&#8217;t find anything usable. Not besides noticing the fact that it didn&#8217;t seemed like a task with high priority for the FreeBSD-folks to maintain a usable kernel for the newest version of Xen. Sad but true, apparently.</p>
<p>I accepted that fact, although it&#8217;s laborious. So instead I used the HVM-method. As mentioned, you can use this method to install other operating systems with a unmodified kernel like Windows, too. </p>
<p>Firsty download the iso-file you want to use as a installation source. I did this on dom0:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> iso
<span style="color: #7a0874; font-weight: bold;">cd</span> iso
<span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftp.freebsd.org<span style="color: #000000; font-weight: bold;">/</span>pub<span style="color: #000000; font-weight: bold;">/</span>FreeBSD<span style="color: #000000; font-weight: bold;">/</span>releases<span style="color: #000000; font-weight: bold;">/</span>i386<span style="color: #000000; font-weight: bold;">/</span>ISO-IMAGES<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">7.0</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">7.0</span>-RELEASE-i386-bootonly.iso</pre></div></div>

<p>As with other domUs you have to decide whether to use a file, partition or whatever as a disk. Again I use a LV (logical volume) as the root file system, i.e. <code>/dev/lvmstore/lv2</code>, and a partition as swap, i.e. <code>/dev/sda7</code>. First create a configuration file <code>/etc/xen/domU2.cfg</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">name         = <span style="color: #ff0000;">'domU2'</span>
builder      = <span style="color: #ff0000;">'hvm'</span>
device_model = <span style="color: #ff0000;">'/usr/lib/xen/bin/qemu-dm'</span>
kernel       = <span style="color: #ff0000;">'/usr/lib/xen/boot/hvmloader'</span>
acpi         = <span style="color: #ff0000;">'0'</span>
memory       = <span style="color: #ff0000;">'512'</span>
maxmem       = <span style="color: #ff0000;">'1536'</span>
disk         = <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">'phy:/dev/lvmstore/lv2,hda,w'</span>,<span style="color: #ff0000;">'phy:/dev/sda7,hdb,w'</span>,<span style="color: #ff0000;">'file:/root/iso/7.0-RELEASE-i386-bootonly.iso,hdc:cdrom,r'</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
vif          = <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">'type=ioemu,bridge=eth0'</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
boot         = <span style="color: #ff0000;">'d'</span> 
vnc          = <span style="color: #ff0000;">'1'</span>
serial       = <span style="color: #ff0000;">'pty'</span>
on_poweroff  = <span style="color: #ff0000;">'destroy'</span>
on_reboot    = <span style="color: #ff0000;">'restart'</span>
on_crash     = <span style="color: #ff0000;">'restart'</span>
vcpus        = <span style="color: #ff0000;">'2'</span>
extra        = <span style="color: #ff0000;">'xencons=tty1'</span></pre></div></div>

<p>If you want a 64 bit domU, you can instead use this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">device_model = <span style="color: #ff0000;">&quot;/usr/lib64/xen/bin/qemu-dm&quot;</span></pre></div></div>

<p>And then start the machine:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">xm create <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>domU2.cfg</pre></div></div>

<p>If you get an error like <code>losetup -r /dev/loop17 /root/iso/7.0-RELEASE-i386-bootonly.iso failed</code>, you can try run the command manually and use the newly create loop-device instead of the iso. First setup the device:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">losetup <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>loop17 <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>iso<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">7.0</span>-RELEASE-i386-bootonly.iso</pre></div></div>

<p>And then change the cfg-file accordingly:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#disk         = ['phy:/dev/lvmstore/lv2,hda,w','phy:/dev/sda7,hdb,w','file:/root/iso/7.0-RELEASE-i386-bootonly.iso,hdc:cdrom,r']</span>
disk         = <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">'phy:/dev/lvmstore/lv2,hda,w'</span>,<span style="color: #ff0000;">'phy:/dev/sda7,hdb,w'</span>,<span style="color: #ff0000;">'phy:/dev/loop17,hdc:cdrom,r'</span><span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>Now verify that the machine is running &#8211; and destroy it afterwards (we need to setup some things before actually installing FreeBSD):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">xm list
xm destroy domU2</pre></div></div>

<p>Please notice that with HVM we don&#8217;t attach the console with the <code>-c</code>-parameter with <code>xm create</code> &#8211; instead we use VNC to connect to it until the system is installed. Because there&#8217;s no X on dom0, we use X11-forwarding. From your workstation log into dom0 like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-X</span> root<span style="color: #000000; font-weight: bold;">@</span>dom0</pre></div></div>

<p>Now add this line to <code>/etc/xen/xend-config.sxp</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#40;</span>vnc-listen <span style="color: #ff0000;">'0.0.0.0'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>And restart the service:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>xend restart</pre></div></div>

<p>On your own workstation, you now use <code>vncviewer</code> to connect &#8211; just enter the address of your dom0-server and you&#8217;ll automatically get connected to the FreeBSD-installation! This is of course a security issue, but you can deal with this in several ways, e.g. restrict which host that are able to connect to VNC. No matter what I highly recommend to disable VNC-access after the installation is done &#8211; at that time you can just connect with ssh to the domU. This is simply done by deleting <code>(vnc-listen '0.0.0.0')</code> in <code>/etc/xen/xend-config.sxp</code>.</p>
<p>When you have installed FreeBSD (or whatever system you&#8217;ve just installed), please remember to modify the config-file in order to unmount the iso-file and boot from the disk, i.e. on the parameters:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">disk         = <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">'phy:/dev/lvmstore/lv2,hda,w'</span>,<span style="color: #ff0000;">'phy:/dev/sda7,hdb,w'</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
boot         = <span style="color: #ff0000;">'c'</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.scienco.org/2008/freebsd-70-on-xen-32/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu Server 8.04 as domU</title>
		<link>http://www.scienco.org/2008/ubuntu-server-804-as-domu/</link>
		<comments>http://www.scienco.org/2008/ubuntu-server-804-as-domu/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 10:23:32 +0000</pubDate>
		<dc:creator>Mikkel Meyer Andersen</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Xen]]></category>
		<category><![CDATA[Hetzner]]></category>
		<category><![CDATA[network bridge]]></category>

		<guid isPermaLink="false">http://www.scienco.org/?p=161</guid>
		<description><![CDATA[If you have followed the guide in &#8220;Xen on Ubuntu Server 8.04 (Hardy Heron) with complex disk setup&#8221; or have an environment similar to that, please read on &#8211; if not please read on, too . Since my server is hosted at Hetzner, this guide will be based on that. I want to use network [...]]]></description>
			<content:encoded><![CDATA[<p>If you have followed the guide in <a href="http://www.scienco.org/2008/xen-on-ubuntu-server-804-hardy-heron-with-complex-disk-setup/">&#8220;Xen on Ubuntu Server 8.04 (Hardy Heron) with complex disk setup&#8221;</a> or have an environment similar to that, please read on &#8211; if not please read on, too <img src='http://www.scienco.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . Since my server is hosted at Hetzner, this guide will be based on that. I want to use network bridging.<span id="more-161"></span> To do that you need additional IP-addresses. My host has <code>213.x.x.6</code> and besides that I&#8217;ve got <code>78.x.x.1</code>, <code>78.x.x.2</code>, &#8230;, <code>78.x.x.6</code> (plus a broadcasting address).On my host I&#8217;ve got this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>host:~<span style="color: #666666; font-style: italic;"># cat /etc/network/interfaces </span>
<span style="color: #666666; font-style: italic;">### Hetzner Online AG - installimage</span>
<span style="color: #666666; font-style: italic;"># Loopback device:</span>
auto lo
iface lo inet loopback
&nbsp;
<span style="color: #666666; font-style: italic;"># device: eth0</span>
auto eth0
iface eth0 inet static
  address 213.x.x.6
  broadcast 213.x.x.31
  netmask 255.255.255.224
  gateway 213.x.x.1
&nbsp;
<span style="color: #666666; font-style: italic;"># default route to access subnet</span>
up route add <span style="color: #660033;">-net</span> 213.x.x.0 netmask 255.255.255.224 gw 213.x.x.1 eth0
&nbsp;
auto eth0:<span style="color: #000000;">1</span>
iface eth0:<span style="color: #000000;">1</span> inet static
  address 78.x.x.1
  broadcast 78.x.x.7
  netmask 255.255.255.248</pre></div></div>

<p>The plan is that the guests will get <code>78.x.x.2</code>, <code>78.x.x.3</code>, etc. and will use <code>78.x.x.1</code> as gateway (you&#8217;ll see this later) &#8211; that&#8217;s why I&#8217;ve assigned it to the host.</p>
<p>Well, after you have found out that Xen kernel is loaded with</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">uname</span> <span style="color: #660033;">-r</span>
xm list</pre></div></div>

<p>you&#8217;ll be ready to proceed.</p>
<p>Now we want to make a domU with Ubuntu Server 8.04 with the program <code>debootstrap</code>. First identify the partitions you want to use. For the root filesystem I&#8217;ll use <code>/dev/lvmstore/lv1</code> and for swap I&#8217;ll use <code>/dev/sda6</code>. To prepare the partitions, please</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mkfs.xfs <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>lvmstore<span style="color: #000000; font-weight: bold;">/</span>lv1
mkswap <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda6</pre></div></div>

<p>Now it&#8217;s time to install the guest system. First mount the root file system like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>lvmstore<span style="color: #000000; font-weight: bold;">/</span>lv1 <span style="color: #000000; font-weight: bold;">/</span>mnt</pre></div></div>

<p>Now just install it with this simple command (depending on your environment you might have to change the <code>--arch</code>-parameter):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">debootstrap <span style="color: #660033;">--arch</span> amd64 hardy <span style="color: #000000; font-weight: bold;">/</span>mnt http:<span style="color: #000000; font-weight: bold;">//</span>archive.ubuntu.com<span style="color: #000000; font-weight: bold;">/</span>ubuntu</pre></div></div>

<p>Now you should copy a couple of files:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>resolv.conf <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>resolv.conf
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>sources.list <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>sources.list
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/`</span><span style="color: #c20cb9; font-weight: bold;">uname</span> -r<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-R</span> <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/`</span><span style="color: #c20cb9; font-weight: bold;">uname</span> -r<span style="color: #000000; font-weight: bold;">`/*</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/`</span><span style="color: #c20cb9; font-weight: bold;">uname</span> -r<span style="color: #000000; font-weight: bold;">`/</span></pre></div></div>

<p>Now you should change a couple of files. Now</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>network<span style="color: #000000; font-weight: bold;">/</span>interfaces</pre></div></div>

<p>should have the content</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>host:~<span style="color: #666666; font-style: italic;"># cat /mnt/etc/network/interfaces </span>
auto lo
iface lo inet loopback
&nbsp;
auto eth0
iface eth0 inet static
  address 78.x.x.2
  broadcast 78.x.x.7
  netmask 255.255.255.248
  gateway 78.x.x.1</pre></div></div>

<p>Here you see that I&#8217;m using the host as gateway.</p>
<p>And</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">hostname</span></pre></div></div>

<p>to change the hostname of the guest.</p>
<p>We also need to change the <code>fstab</code> &#8211; mine looks like this (remember to change <code>xfs</code> to <code>ext3</code> or similar if you&#8217;re not using xfs):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>host:~<span style="color: #666666; font-style: italic;"># cat /mnt/etc/fstab </span>
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda1 <span style="color: #000000; font-weight: bold;">/</span>    xfs  defaults <span style="color: #000000;">1</span> <span style="color: #000000;">2</span>
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda2 none swap sw       <span style="color: #000000;">0</span> <span style="color: #000000;">0</span></pre></div></div>

<p>The names <code>/dev/sda1</code> and <code>/dev/sda2</code> is assigned on a Xen configuration file  we&#8217;ll get to that i a minute.</p>
<p>Now we prepare the network bridge at the host by:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sysctl.conf</pre></div></div>

<p>and change</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#net.ipv4.ip_forward=1</span></pre></div></div>

<p>to</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">net.ipv4.ip_forward=<span style="color: #000000;">1</span></pre></div></div>

<p>We also start the network bridge:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>scripts<span style="color: #000000; font-weight: bold;">/</span>network-bridge start</pre></div></div>

<p>Now reboot the host to enable the changes in <code>/etc/sysctl.conf</code>. After reboot please check that the bridge is okay:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">brctl show</pre></div></div>

<p>Now we create the file <code>/etc/xen/domU1.conf</code> with this content:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>host:~<span style="color: #666666; font-style: italic;"># cat /etc/xen/domu1.cfg </span>
kernel      = <span style="color: #ff0000;">'/boot/vmlinuz-2.6.24-19-xen'</span>
ramdisk     = <span style="color: #ff0000;">'/boot/initrd.img-2.6.24-19-xen'</span>
memory      = <span style="color: #ff0000;">'512'</span>
maxmem      = <span style="color: #ff0000;">'1536'</span>
&nbsp;
root        = <span style="color: #ff0000;">'/dev/sda1 ro'</span>
disk        = <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">'phy:/dev/lvmstore/lv1,sda1,w'</span>,<span style="color: #ff0000;">'phy:/dev/sda6,sda2,w'</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;
name        = <span style="color: #ff0000;">'domU1'</span>
&nbsp;
vif	     = <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #ff0000;">'bridge=eth0'</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;
on_poweroff = <span style="color: #ff0000;">'destroy'</span>
on_reboot   = <span style="color: #ff0000;">'restart'</span>
on_crash    = <span style="color: #ff0000;">'restart'</span>
&nbsp;
vcpus	     = <span style="color: #ff0000;">'2'</span>
extra       = <span style="color: #ff0000;">'xencons=tty1'</span></pre></div></div>

<p>This is the specs of the guest. This is a configuration making you able to ballon the amount of memory to 1,5 GB instead of the initial 512 MB. Please view <code>man xmdomain.cfg</code> for further details.</p>
<p>Now start the guest (the <code>-c</code> means that the console is attached to the guest immediately):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">xm create <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>domu1.cfg <span style="color: #660033;">-c</span></pre></div></div>

<p>When the environment is started, login with the same password as on your host. Now check the network is okay, change the password, and update the system, respectively:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ping</span> 78.x.x.1
<span style="color: #c20cb9; font-weight: bold;">passwd</span>
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> upgrade
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> dist-upgrade</pre></div></div>

<p>You&#8217;ll probably see some locales errors. For my case (da_DK) it&#8217;s fixed by this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">locale-gen da_DK.UTF8
tzselect
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;export LANG=C&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bashrc</pre></div></div>

<p>Please refer to <a href="https://wiki.ubuntu.com/DebootstrapChroot">https://wiki.ubuntu.com/DebootstrapChroot</a> for details regarding this and debootstrap in general.</p>
<p>To shut it down, use</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">init <span style="color: #000000;">0</span></pre></div></div>

<p>You can start the guest without the <code>-c</code>-parameter to start it without the console. Then you can use</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">xm list</pre></div></div>

<p>to check that it&#8217;s running.</p>
<p>At this point I&#8217;d strongly recommend to shut the guest down, reboot the host (dom0) and start everything again. This is to verify that everything is also working after a reboot (before using it in production).</p>
<p>I followed <a href="http://www.howtoforge.com/high-performance-xen-on-ubuntu-8.04-amd64">http://www.howtoforge.com/high-performance-xen-on-ubuntu-8.04-amd64</a> when I installed the guest, but I&#8217;ve done it slightly different and avoided some of the errors.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scienco.org/2008/ubuntu-server-804-as-domu/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Xen on Ubuntu Server 8.04 (Hardy Heron) with complex disk setup</title>
		<link>http://www.scienco.org/2008/xen-on-ubuntu-server-804-hardy-heron-with-complex-disk-setup/</link>
		<comments>http://www.scienco.org/2008/xen-on-ubuntu-server-804-hardy-heron-with-complex-disk-setup/#comments</comments>
		<pubDate>Sun, 03 Aug 2008 16:58:43 +0000</pubDate>
		<dc:creator>Mikkel Meyer Andersen</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Xen]]></category>
		<category><![CDATA[Hetzner]]></category>
		<category><![CDATA[LVM]]></category>
		<category><![CDATA[mdadm]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[xfs]]></category>

		<guid isPermaLink="false">http://www.scienco.org/?p=58</guid>
		<description><![CDATA[This is a tutorial about how to use Ubuntu Server 8.04 as dom0 (host) for Xen, i.e. how to install Xen on Ubuntu Server. In a later post I&#8217;ll show how to install domUs (guests). The whole setup is done with a rather complex disk configuration using both raid 1 (mirroring) and LVM. It requires [...]]]></description>
			<content:encoded><![CDATA[<p>This is a tutorial about how to use Ubuntu Server 8.04 as dom0 (host) for Xen, i.e. how to install Xen on Ubuntu Server. In a later post I&#8217;ll show how to install domUs (guests). The whole setup is done with a rather complex disk configuration using both raid 1 (mirroring) and LVM. It requires some knowledge about Xen (e.g. I&#8217;ll not try to convince you to use Xen &#8211; I assume it&#8217;s already your plan and you had read of all the advantages it gives you <img src='http://www.scienco.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ).<span id="more-58"></span></p>
<h3>Disk-layout considerations</h3>
<p>In order to use Windows with Xen you also need to have Intel VT or AMD-V &#8211; and have it enabled, too. My &#8220;metal&#8221; is a AMD-V enabled CPU, 4 GB RAM, 2 x 400 GB SATA II disks, and a 1 GBit NIC (network interface card) &#8211; a DS5000 at Hetzner. I&#8217;ve chosen to have a rather complex disk setup based on a lot of reading different places at the web (and for fun, too), e.g. [1], [2], [3], and [4]. First of all I want protection (raid 1 &#8211; mirroring) because I&#8217;m going to use the system in a production environment, but I don&#8217;t want to pay the money for a real hardware RAID controller, hence I&#8217;ve decided to use software raid, i.e. mdadm. I know it&#8217;s expensive in CPU-time, but I&#8217;m willing to &#8220;pay&#8221; for the protection this way. I want LVM for the domUs because it among other things enables me to take snapshots and easily grow/shrink the size of the disk.</p>
<p>The only thing I don&#8217;t want mirrored, is the swap-partitions. I know it might cause the system to crash if a disk fails, but only data in memory can be lost this way. If a swap-partition crashes it&#8217;s likely because the disk is dead, and as a back-up I want extra swap-partitions on the other disk so that I can use those until a new disk is installed. I don&#8217;t want the swap-partitions to be LVM &#8211; only normal partitions that can be mapped directly to domUs through Xen. Because of my metal, it&#8217;s not likely that I&#8217;m going to have more than 5 domUs running, hence I need 12 swap-partitions in total (the 5 plus 1 for dom0 and doubleing it to encounter the extra ones if a disk crashes). Because I don&#8217;t know if the memory of dom0 or a domU is going to be ballooned (resized &#8211; and yes, among many other things Xen i capable of that), I&#8217;ve decided to go with a size of 4GB of all the swap-partitions. It may be a little oversized, but better safe than sorry and I have plenty of disk space for my needs.</p>
<p>Of course the root file system of dom0 needs to be mirrored, but I don&#8217;t want to use LVM with this, because I&#8217;m not going to use any of the advantages with dom0. So this is going to be an ordinary raid 1 xfs partition. The rest of the disk space is used to make a VG (volume group) in LVM, and this pool can then be used to make LV (logical volumes) to disks for the domUs.</p>
<p>At this point please be aware that I&#8217;m going to map a LV to a domU to its root file system and a &#8220;normal&#8221; partition to its swap. Xen gives other possibilities, e.g. map a file on dom0 to the root file system of a domU or simply use a &#8220;normal&#8221; partition. All three choices have advantages and disadvantages; I&#8217;ve made my mind up and chosen to use the LVM-approach. I&#8217;ve also chosen to use xfs instead of ext3, but this choice really makes no difference in this tutorial: if you like ext3 better, then please use it.</p>
<h3>Disk layout</h3>
<p>If the two psysical 400GB disks are called /dev/sda and /dev/sdb, the disk-layout can be depicted as follows:</p>
<pre>disk	partition	size	usage/mount		pri/log
---------------------------------------------------------------
/dev/sda
	/dev/sda1	  1GB	/dev/md0 (bootable)	primary
	/dev/sda2	 20GB	/dev/md1 (dom0 -&gt; /)	primary
	/dev/sda5	  4GB	swap dom0		logical
	/dev/sda6	  4GB	dnu* (swap domU1)	logical
	/dev/sda7	  4GB	dnu* (swap domU2)	logical
	/dev/sda8	  4GB	dnu* (extra swap domU3)	logical
	/dev/sda9	  4GB	dnu* (extra swap domU4)	logical
	/dev/sda10	  4GB	dnu* (extra swap domU5)	logical
	/dev/sda11	 rest	/dev/md2 (LVM)		logical

/dev/sdb
	/dev/sdb1	  1GB	/dev/md0 (bootable)	primary
	/dev/sdb2	 20GB	/dev/md1 (dom0 -&gt; /)	primary
	/dev/sdb5	  4GB	dnu* (extra swap dom0)	logical
	/dev/sdb6	  4GB	dnu* (extra swap domU1)	logical
	/dev/sdb7	  4GB	dnu* (extra swap domU2)	logical
	/dev/sdb8	  4GB	dnu* (swap domU3)	logical
	/dev/sdb9	  4GB	dnu* (swap domU4)	logical
	/dev/sdb10	  4GB	dnu* (swap domU5)	logical
	/dev/sdb11	 rest	/dev/md2 (LVM)		logical

*dnu = DO NOT USE (is going to be mounted by the domUs)

/dev/md0 (bootable)
	/boot		  1GB	raid 1 (dom0 -&gt; /boot)

/dev/md1
	/		 20GB	raid 1 (dom0 -&gt; /)

/dev/md2
	/dev/lvmstore/lv1 15GB	/ (dom1)
	/dev/lvmstore/lv2 15GB	/ (dom2)
	/dev/lvmstore/lv3 15GB	/ (dom3)
	/dev/lvmstore/lv4 20GB	/ (dom4)
	...		 ... 	...</pre>
<h3>Installation</h3>
<p>The task of making this configuration in Ubuntu can be a bit confusing. How to make this configuration depends on the way you&#8217;re installing Ubuntu. I&#8217;ve had quite some troubles with LILO, so I recommend that you use GRUB instead! That&#8217;s also what [6] recommends.</p>
<p>As earlier mentioned, my server is hosted at Hetzner. Here you can only manipulate the installation through a configuration file. This means that the disk configuration has to be performed a bit different. You could of course also make this disk layout with the ordinary Ubuntu installer, but I&#8217;ll not get into details how to do that in this tutorial. First reboot into rescue mode and execute</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">installimage</pre></div></div>

<p>Now choose to edit the configuration file. First you need to enable software raid (thanks, [5]) and choose GRUB:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">SWRAID <span style="color: #000000;">1</span>
BOOTLOADER grub</pre></div></div>

<p>Furthermore I configured the hostname. I made the initial partitioning scheme like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">PART <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">/</span>boot ext3  1G
PART <span style="color: #000000;">2</span> <span style="color: #000000; font-weight: bold;">/</span>     xfs  20G
PART <span style="color: #000000;">3</span> swap  swap  4G</pre></div></div>

<p>And then I installed the system. After this was done, the disk layout needed to be modified heavily to get what we wanted.</p>
<p>Because we are going to modify the harddisk layout on a running system, be aware that you might delete data! Please make sure you have a backup of all important data. Also do not do this if you&#8217;re not able to restore the server somehow (boot it to rescue mode or similar if something should fail)!</p>
<p>First launch</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">cfdisk <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda</pre></div></div>

<p>And perform these steps:</p>
<ul>
<li>Select sda3 and delete it</li>
<li>Create a new locigal partition of 4301.83 MB at the beginning and change type to 82 (Linux swap)</li>
<li>Create five new locigal partition of 4301.83 MB at the beginning and don&#8217;t change the type</li>
<li>Create a partition on the rest of space of type FD (Linux raid autodetect) &#8211; it&#8217;s going to be used for a mirrored LVM</li>
<li>Write  (don&#8217;t mind about the warning &#8220;No primary partitions are marked as bootable&#8221; &#8211; cfdisk doesn&#8217;t know the /dev/md0 is bootable)</li>
<li>Quit</li>
</ul>
<p>Now do almost the same with <code>/dev/sdb</code> by</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">cfdisk <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb</pre></div></div>

<p>And perform these steps:</p>
<ul>
<li>Select sdb3 and delete it</li>
<li>Create six new locigal partition of 4301.83 MB at the beginning and don&#8217;t change the type</li>
<li>Create a partition on the rest of space of type FD (Linux raid autodetect) &#8211; it&#8217;s going to be used for a mirrored LVM</li>
<li>Write (again, don&#8217;t mind about the warning &#8211; cfdisk doesn&#8217;t know the /dev/md0 is bootable)</li>
<li>Quit</li>
</ul>
<p>After this, my disk layout was like this:<br />
<a href="http://www.scienco.org/wp-content/dev-sda.png"><img class="aligncenter size-medium wp-image-143" title="/dev/sda" src="http://www.scienco.org/wp-content/dev-sda-300x172.png" alt="" width="300" height="172" /></a></p>
<p><a href="http://www.scienco.org/wp-content/dev-sdb.png"><img class="aligncenter size-medium wp-image-144" title="/dev/sdb" src="http://www.scienco.org/wp-content/dev-sdb-300x172.png" alt="" width="300" height="172" /></a></p>
<p>Use your favorite text editor (vim, nano or whatever) and:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>fstab</pre></div></div>

<p>Change</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md2 none swap sw <span style="color: #000000;">0</span> <span style="color: #000000;">0</span></pre></div></div>

<p>to</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda5 none swap sw <span style="color: #000000;">0</span> <span style="color: #000000;">0</span></pre></div></div>

<p>We also need to get <code>/dev/md2</code> removed from <code>mdadm</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mdadm<span style="color: #000000; font-weight: bold;">/</span>mdadm.conf</pre></div></div>

<p>Comment the line with <code>/dev/md2</code> out.</p>
<p>Now</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md2
mdadm <span style="color: #660033;">--manage</span> <span style="color: #660033;">--remove</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md2</pre></div></div>

<p>Again: be sure that if something fails, you&#8217;re able to enter some kind of rescue mode! If you are sure, please reboot to activate the new partiotions etc.</p>
<p>And now we check that /dev/md2 is gone:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>mdstat
mdadm <span style="color: #660033;">--detail</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md2
<span style="color: #c20cb9; font-weight: bold;">dmesg</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> md2</pre></div></div>

<p>Now please verify that the new swap is used be using</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">free</span></pre></div></div>

<p>to see how much free swap space is available (if it says 0 the system doesn&#8217;t use the swap). If there&#8217;s no swap space, try to initialize the new swap by</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mkswap <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda5</pre></div></div>

<p>and then reboot.</p>
<p>To create the mirroring of the LVM-storage, we perform:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mdadm <span style="color: #660033;">--create</span> <span style="color: #660033;">--verbose</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md2 <span style="color: #660033;">--level</span>=<span style="color: #000000;">1</span> <span style="color: #660033;">--raid-devices</span>=<span style="color: #000000;">2</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda11 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb11</pre></div></div>

<p>In order to get the array started on system start-up, execute this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mdadm <span style="color: #660033;">--brief</span> <span style="color: #660033;">--examine</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda11 <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mdadm<span style="color: #000000; font-weight: bold;">/</span>mdadm.conf</pre></div></div>

<p>Now we need to create the LVM (the lvmstore is the name, and LVs &#8211; logical volumes &#8211; will be located at /dev/lvmstore/name-of-lv):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">pvcreate <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md2
vgcreate lvmstore <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md2</pre></div></div>

<p>The output should be something like:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>host:~<span style="color: #666666; font-style: italic;"># pvcreate /dev/md2</span>
  Physical volume <span style="color: #ff0000;">&quot;/dev/md2&quot;</span> successfully created
root<span style="color: #000000; font-weight: bold;">@</span>host:~<span style="color: #666666; font-style: italic;"># vgcreate lvmstore /dev/md2</span>
  Volume group <span style="color: #ff0000;">&quot;lvmstore&quot;</span> successfully created</pre></div></div>

<p>Now you&#8217;re ready to create LVs. In my case I&#8217;m going to create three of 15 GB and one on 20 GB:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>host:~<span style="color: #666666; font-style: italic;"># lvcreate -n lv1 -L 15G lvmstore</span>
  Logical volume <span style="color: #ff0000;">&quot;lv1&quot;</span> created
root<span style="color: #000000; font-weight: bold;">@</span>host:~<span style="color: #666666; font-style: italic;"># lvcreate -n lv2 -L 15G lvmstore</span>
  Logical volume <span style="color: #ff0000;">&quot;lv2&quot;</span> created
root<span style="color: #000000; font-weight: bold;">@</span>host:~<span style="color: #666666; font-style: italic;"># lvcreate -n lv3 -L 15G lvmstore</span>
  Logical volume <span style="color: #ff0000;">&quot;lv3&quot;</span> created
root<span style="color: #000000; font-weight: bold;">@</span>host:~<span style="color: #666666; font-style: italic;"># lvcreate -n lv4 -L 20G lvmstore</span>
  Logical volume <span style="color: #ff0000;">&quot;lv4&quot;</span> created
root<span style="color: #000000; font-weight: bold;">@</span>host:~<span style="color: #666666; font-style: italic;"># ls -l /dev/lvmstore</span>
total <span style="color: #000000;">0</span>
lrwxrwxrwx <span style="color: #000000;">1</span> root root <span style="color: #000000;">24</span> <span style="color: #000000;">2008</span>-08-02 <span style="color: #000000;">13</span>:<span style="color: #000000;">55</span> lv1 -<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>lvmstore-lv1
lrwxrwxrwx <span style="color: #000000;">1</span> root root <span style="color: #000000;">24</span> <span style="color: #000000;">2008</span>-08-02 <span style="color: #000000;">13</span>:<span style="color: #000000;">55</span> lv2 -<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>lvmstore-lv2
lrwxrwxrwx <span style="color: #000000;">1</span> root root <span style="color: #000000;">24</span> <span style="color: #000000;">2008</span>-08-02 <span style="color: #000000;">13</span>:<span style="color: #000000;">55</span> lv3 -<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>lvmstore-lv3
lrwxrwxrwx <span style="color: #000000;">1</span> root root <span style="color: #000000;">24</span> <span style="color: #000000;">2008</span>-08-02 <span style="color: #000000;">13</span>:<span style="color: #000000;">55</span> lv4 -<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>mapper<span style="color: #000000; font-weight: bold;">/</span>lvmstore-lv4</pre></div></div>

<p>Please reboot to be sure that everything&#8217;s alright.</p>
<h3>Post install</h3>
<p>First we&#8217;ll upgrade the system:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> upgrade
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> dist-upgrade
reboot</pre></div></div>

<p>This will reboot the machine in order to use a new kernel.</p>
<p>After the reboot, install Xen and tools for:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> ubuntu-xen-server xen-tools xfsprogs</pre></div></div>

<p>Add this to <code>/etc/modules</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">loop <span style="color: #007800;">max_loop</span>=<span style="color: #000000;">64</span></pre></div></div>

<p>Now you need to deactivate a startup-script (by moving it), that makes it impossible for the machine to boot properly &#8211; at least everywhere I&#8217;ve tried (thanks to [7] for the solution!):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>loadcpufreq <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>loadcpufreq.backup</pre></div></div>

<p>If you don&#8217;t do this, the machine probably will not boot. At my server with Hetzner I was able to ping it though, but when I tried to SSH, I got a &#8220;Connection Resufed&#8221;.</p>
<p>Now reboot and verify running the Xen-kernel:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">uname</span> <span style="color: #660033;">-r</span>
xm list</pre></div></div>

<h3>Sources</h3>
<p>[1]: <a href="http://forums.novell.com/novell-product-support-forums/suse-linux-enterprise-server-sles/sles-virtualization/331444-suggest-swap-size-dom0.html">http://forums.novell.com/novell-product-support-forums/suse-linux-enterprise-server-sles/sles-virtualization/331444-suggest-swap-size-dom0.html</a><br />
[2]: <a href="http://www.gagme.com/greg/linux/raid-lvm.php">http://www.gagme.com/greg/linux/raid-lvm.php</a><br />
[3]: <a href="http://video.dkuug.dk/2007-10-16-xen/mr-xen.pdf">http://video.dkuug.dk/2007-10-16-xen/mr-xen.pdf</a><br />
[4]: <a href="http://www.howtoforge.com/high-performance-xen-on-ubuntu-8.04-amd64">http://www.howtoforge.com/high-performance-xen-on-ubuntu-8.04-amd64</a><br />
[5]: <a href="http://www.afterschool.dk/documents/hetzner/raid_hetzner_server/">http://www.afterschool.dk/documents/hetzner/raid_hetzner_server/</a><br />
[6]: <a href="http://wiki.debian.org/Xen">http://wiki.debian.org/Xen</a><br />
[7]: <a href="http://ubuntuforums.org/showthread.php?t=819404">http://ubuntuforums.org/showthread.php?t=819404</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scienco.org/2008/xen-on-ubuntu-server-804-hardy-heron-with-complex-disk-setup/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Xen vs. VMware ESXi vs. VMware Server</title>
		<link>http://www.scienco.org/2008/xen-vs-vmware-esxi-vs-vmware-server/</link>
		<comments>http://www.scienco.org/2008/xen-vs-vmware-esxi-vs-vmware-server/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 21:12:29 +0000</pubDate>
		<dc:creator>Mikkel Meyer Andersen</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[VMware ESXi]]></category>
		<category><![CDATA[VMware Workstation]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://www.scienco.org/?p=59</guid>
		<description><![CDATA[The case is that I have a server on which I want to run some sort of virtualization - I don't think it's appropriate to discuss why virtualization is a go (if you think so, search the web for articles regarding this subject - there are more than plenty discussing this matter). I need at least to host a web server and a mail server - and it would be great to be able to have some sort of playground, too. My mind's almost made up in regards to the software for the web server and mail server: Ubuntu Server (or maybe FreeBSD - time will show :-)). But what about the virtualization software?]]></description>
			<content:encoded><![CDATA[<p>Yesterday I wrote an entry regarding ESXi. More precisely I described how to try VMware ESXi in VMware Workstation. My argument was on one side to try ESXi out (I&#8217;ve never installed nor tried it) and on the other side investigate whether it was a product I would use.</p>
<p>The case is that I have a server on which I want to run some sort of virtualization &#8211; I don&#8217;t think it&#8217;s appropriate to discuss why virtualization is a go (if you think so, search the web for articles regarding this subject &#8211; there are more than plenty discussing this matter). I need at least to host a web server and a mail server &#8211; and it would be great to be able to have some sort of playground, too. My mind&#8217;s almost made up in regards to the software for the web server and mail server: Ubuntu Server (or maybe FreeBSD &#8211; time will show <img src='http://www.scienco.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ). But what about the virtualization software?<span id="more-59"></span></p>
<p>Besides ESXi I&#8217;m comtemplating Xen and VMware Server. Why those three &#8211; why not Microsoft&#8217;s new software, Hyper-V? Well, I&#8217;m not going to use Microsoft servers so I don&#8217;t really want to mix this into the environment. Besides that, Hyper-V is quite new compared to the others and still misses some features (and testing, I guess &#8211; but it&#8217;s a statement without proof).</p>
<p>Since this server with virtualization is a hobby-project I don&#8217;t want to spend too much money on software &#8211; preferably none. On top of this I like the idea of open source software. Because of this, my interest for ESXi came the moment I read that I would become free (as in money, not beer).</p>
<p>My server is hosted at a Hetzner (http://www.hetzner.de/), so in order to install ESXi I need to order  something called LARA at a price of 25â‚¬ (it&#8217;s a  way of making it possible to install custom software like ESXi since they &#8220;only&#8221; provides recoverbility of different Linux flavours). As mentioned this is needed to install ESXi, whereas both Xen and VMware Server run on ordinary server software, e.g. Ubuntu Server, which doesn&#8217;t require a LARA-setup (and hence not the 25â‚¬).</p>
<h3>Comparison</h3>
<p>The already mentioned arguments are just practical matter &#8211; what about the software? I have certain requirements such as mirroring of my data (raid 1), but this would yield an expend of several euro each month as it would cost if it should be done in real hardware raid. Because of that I&#8217;m willing to offer CPU-time and instead use software raid, i.e. mdadm in the world of Linux and FreeBSD.</p>
<p>Well, they all have both advantages and disadvantages in regards to my requirements:</p>
<ul>
<li>VMware ESXi, see [1]
<ul>
<li>Advantages
<ul>
<li>Only a 32 MB footprint ought to yield a good performance</li>
<li>The technology (ESX) is widely used and mature (but refer to the disadvantages to view this in perspective)</li>
</ul>
</li>
<li>Disadvantages
<ul>
<li>Not open source</li>
<li>Would require a LARA-setup to install on a hosted server</li>
<li>Doesn&#8217;t support software raid</li>
<li>To quote [1]:<br />
<blockquote><p>VMware states that the ESX Server product runs on &#8220;bare metal&#8221;. In contrast to other VMware products, it does not run atop a third-party operating system, but instead includes its own kernel. In ESX version 3 and older, a Linux kernel is started first and is used to load a variety of specialized virtualization components, including VMware&#8217;s &#8216;vmkernel&#8217; component.</p></blockquote>
</li>
<li>The full virtualization technique is ancient [2] &#8211; or to quote [2] for some of the explanation:<br />
<blockquote><p>Of course, those with the most market share will continue to sell their solutions as &#8220;more mature&#8221; and/or &#8220;enterprise ready&#8221; while continuing to improve their tools. Unfortunately, they will continue to lean on an outdated, albeit refined technology core. The core may continue to evolve, but the approach is fundamentally less efficient, and will therefore never achieve the performance of the more logical solution. It reminds me of the ice farmers&#8217; response to the refrigerator &#8211; rather than evolving their business, they tried to find better, more efficient ways to make ice, and ultimately went out of business because the technology simply wasnâ€™t as good.</p></blockquote>
</li>
</ul>
</li>
</ul>
</li>
<li>VMware Server
<ul>
<li>Advantages
<ul>
<li>Looks easy and straight-forward with the flashy tools and wizards &#8211; seems very user friendly</li>
<li>The technology is widely used and mature (but refer to the disadvantages to view this in perspective)</li>
</ul>
</li>
<li>Disadvantages
<ul>
<li>The same as for VMware ESXi (quotes inclusive), exept for the LARA-requirement</li>
<li>Requires an underlaying operating system (but if this doesn&#8217;t run other services this doesn&#8217;t seem to be a huge problem)</li>
</ul>
</li>
</ul>
</li>
<li>Xen, see [3]
<ul>
<li>Advantages
<ul>
<li>Open source</li>
<li>The virtualization technique is called integrated virtualization or paravirtualization. This means that unlike with VMware ESXi and Server, the virtualized operating systems are aware that they are being virtualized. This means that there&#8217;s no need for a SBE-mechanism (Scan-Before-Execution) to handle special or privileged CPU instructions. This is an expensive operation because every instruction has to be scanned before the execution of it, and making that expensive scan unnecessary yields greater performance</li>
</ul>
</li>
<li>Disadvantages
<ul>
<li>As far as I&#8217;ve experienced, the learning-curve can seem more steep than both the one of VMware ESXi and Server (but I&#8217;ve also used VMware Workstation for some time). But that something is harder doesn&#8217;t mean that it isn&#8217;t as good <img src='http://www.scienco.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . But I mainly think it&#8217;s because of quite a lot new concepts &#8211; after getting my hands dirty, I&#8217;m actually very impressed of the simplicity of Xen! For reference, navigate to [4] and review the installtion process &#8211; it&#8217;s not that complex after all.</li>
<li>Requires an underlaying operating system (but if this doesn&#8217;t run other services this doesn&#8217;t seem to be a huge problem)</li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Conclusion</h3>
<p>After quite a lot reading on the web (much more than refered to in this blog entry), I&#8217;ve finally decided!</p>
<p>If I had hardware raid, the battle between ESXi and Xen was very, very close! I would not be able to distinctly answer whether I would use ESXi or Xen. In this regard I see ESXi as an old, experienced giant and Xen as a new actor (although they in no ways are inmature!). If the short-term period is weighted the most, I&#8217;d go with ESXi, but if I should you think a on the future, I&#8217;d pick Xen.</p>
<p>With software raid there&#8217;s really no doubt after this reseach: Xen is here to stay &#8211; and I look forward to join this field of evolution!</p>
<p>Disclaimer: virtualization is a huge area, and I&#8217;ve not nearly said enough about it, nor did I compared the products in-depth for this to be a complete comparison! But besides the points in this entry, I&#8217;ve read a lot on the web and had a lecture in virtualization. Altogether I&#8217;ve been convienced to go for it with Xen, based on my requirements and needs. Maybe yours a different or have read other sites saying something else. After all there is not a definte right answer for which virtualization software to use, but the least you can do is some research on the basis of your requirements, needs, hardware etc. (and since you&#8217;re reading this, you&#8217;ve probably already started <img src='http://www.scienco.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ).</p>
<p>Within a week I&#8217;ll post a detailed guide of how to install Xen on Ubuntu Server 8.04 with Ubuntu Server 8.04, FreeBSD, and Windows as guests &#8211; with a complex disk setup including software raid mirroring (raid 1) and LVM.</p>
<p>Once again: if I&#8217;ve missed or misunderstood something, please make me aware of it by leaving a comment!</p>
<h3>Sources</h3>
<p>[1]: <a href="http://en.wikipedia.org/wiki/ESXi">http://en.wikipedia.org/wiki/ESXi</a><br />
[2]: <a href="http://servervirtualization.blogs.techtarget.com/2007/07/23/is-xen-ready-for-the-data-center-is-that-the-right-question/">http://servervirtualization.blogs.techtarget.com/&#8230;/is-xen-ready-&#8230;/</a><br />
[3]: <a href="http://en.wikipedia.org/wiki/Xen">http://en.wikipedia.org/wiki/Xen</a><br />
[4]: <a href="http://www.howtoforge.com/high-performance-xen-on-ubuntu-8.04-amd64">http://www.howtoforge.com/high-performance-xen-on-ubuntu-8.04-amd64</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scienco.org/2008/xen-vs-vmware-esxi-vs-vmware-server/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
