<?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>experimental &#187; XEN</title>
	<atom:link href="http://www.tajidyakub.com/tag/xen/feed" rel="self" type="application/rss+xml" />
	<link>http://www.tajidyakub.com</link>
	<description>Experience the Experiment</description>
	<lastBuildDate>Sat, 10 Oct 2009 19:32:38 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>XEN 3.2.0 on Debian Etch</title>
		<link>http://www.tajidyakub.com/virtualization/xen-320-on-debian-etch-2008-02-02.html</link>
		<comments>http://www.tajidyakub.com/virtualization/xen-320-on-debian-etch-2008-02-02.html#comments</comments>
		<pubDate>Fri, 01 Feb 2008 23:53:57 +0000</pubDate>
		<dc:creator>Tajid Yakub</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[XEN]]></category>

		<guid isPermaLink="false">http://tajidyakub.com/?p=12</guid>
		<description><![CDATA[For server function which is not requiring a huge dedicated resources, virtualization become an efficient option. With virtualization we could divide physical hardware nodes to be used by several Virtual Server each having their own function, their own shared resource (dedicated RAM in XEN case).
You could look google up for detailed info on XEN, like [...]]]></description>
			<content:encoded><![CDATA[<p>For server function which is not requiring a huge dedicated resources, virtualization become an efficient option. With virtualization we could divide physical hardware nodes to be used by several Virtual Server each having their own function, their own shared resource (dedicated RAM in XEN case).</p>
<p>You could look google up for detailed info on XEN, like these URLs;</p>
<p><a href="http://xen.org">http://xen.org</a> Xen opensource site<br />
<a href="http://en.wikipedia.org/wiki/Xen">http://en.wikipedia.org/wiki/Xen</a> Xen on Wikipedia</p>
<p>This article will sums the steps required to install Xen 3.2.0 release inside a Debian Etch Box. The installation will begin on the node with base install + of course ssh server, configure and install the Host Domain (Dom0) and then creates Guest (DomU) using xen-tools from <a title="xen-tools" href="http://xen-tools.org" target="_blank">http://xen-tools.org</a>.</p>
<p><span id="more-12"></span></p>
<p>After you install base Debian Etch, let&#8217;s install ssh server;</p>
<pre class="brush: bash">apt-get install ssh openssh-server</pre>
<p><strong>Debian Etch</strong></p>
<p>This is my partition scheme, taken from; <a title="How to Forge" href="http://www.howtoforge.com/debian_etch_xen_3.1" target="_blank">http://www.howtoforge.com/debian_etch_xen_3.1</a></p>
<pre class="brush: bash">/boot partiotion 200 MB
swap with 4 GB size (my RAM in this machine is 2GB, adjust with your box)
/ 10 GB
the rest is /vserver dan /vserver2 (my machine has 2×250 GB HDD Sata II)</pre>
<p>In further production host, I would highly recommend the Node HDD in RAID mode, I prefer RAID 1 or RAID 10 if you have plenty of HDD, simply because it read faster (the smaller the disks size would be better), nothing wrong with software RAID if you don&#8217;t have enough budget for a Hardware RAID. And then use LVM based partition for your Guest (phy:lvm) for easier storage management.</p>
<p>These are the final partition scheme;</p>
<pre class="brush: bash">idayu:/# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             9.2G  1.2G  7.6G  14% /
tmpfs                1013M     0 1013M   0% /lib/init/rw
udev                   10M   60K   10M   1% /dev
tmpfs                1013M     0 1013M   0% /dev/shm
/dev/sda1             183M   12M  161M   7% /boot
/dev/sda4             217G  188M  206G   1% /vserver
/dev/sdb1             230G  188M  218G   1% /vserver2</pre>
<p><strong>Dom0 (host) Installation</strong></p>
<p>Now we install, configure, and load Xen into the node / host / dom0;</p>
<pre class="brush: bash">cd /usr/src/

wget http://mirror.lintaswave.net.id/oss-xen/release/3.2.0/xen-3.2.0.tar.gz
tar xzvf xen-3.2.0.tar.gz
cd /usr/src/xen-3.2.0
install mercurial
apt-get install mercurial

% # Download the xenifid kernel tree manually, but NOT in xen-3.2.0/
% # because the buildconfig/select-repository script would skip it.

hg clone http://xenbits.xensource.com/linux-2.6.18-xen.hg
</pre>
<p>Watch the step carefully, since the 3.2.0 release doesn&#8217;t provide patches which make it possible for us to build from the source, read more about it on <a title="xensource list" href="http://lists.xensource.com/archives/html/xen-users/2008-01/msg00699.html" target="_self">http://lists.xensource.com/archives/html/xen-users/2008-01/msg00699.html</a> or in the README file (inside the source).</p>
<p>Install another package</p>
<pre class="brush: bash">apt-get install screen ssh debootstrap python python-twisted iproute bridge-utils libcurl3-dev libssl0.9.7 iproute bridge-utils binutils zlib1g-dev python-dev transfig bzip2 libncurses5-dev x-dev build-essential gettext

install gawk

apt-get install gawk

make dist
</pre>
<p>This will take quite some time.</p>
<pre class="brush: bash">cd /usr/src/xen-3.2.0/dist
./install.sh
mv /lib/tls /lib/tls.disabled

## do this so your Debian Will load Xen kernel during startup

update-rc.d xend defaults 20 21
update-rc.d xendomains defaults 21 20
</pre>
<p>The Xen kernel will need ramdisk, build the ramdisk, don&#8217;t forget to check your /boot directory to make sure the newly created ramdisk exists.</p>
<pre class="brush: bash">depmod 2.6.18.8-xen
apt-get install yaird
mkinitrd.yaird -o /boot/initrd.img-2.6.18.8-xen 2.6.18.8-xen</pre>
<p>Update grub config and restart your machine; watch that the Machine is now powered by Xen, your Dom0 is ready.</p>
<pre class="brush: bash">update-grub
shutdown -r now

idayu:~# uname -a
Linux idayu.magnet-id.com 2.6.18.8-xen #1 SMP Sun Feb 17 01:18:25 WIT 2008 i686 GNU/Linux</pre>
<p><strong>Create DomU / Virtual Machine / Guest</strong></p>
<p>We are going to use xen-tools;</p>
<pre class="brush: bash">apt-get install xen-tools</pre>
<p>Adjust /etc/xen-tools/xen-tools.conf, modify these entries;</p>
<pre class="brush: bash"># Insert the Gateway IP Address and Netmask used by your Domu

gateway   = 117.103.52.xx
netmask   = 255.255.255.248

# Will ask for root password on DomU creation

passwd = 1

# Comment out initrd if you don&#039;t need to make different ramdisk for different DomU

# kernel = /boot/vmlinuz-2.6.16-2-xen-686
# initrd = /boot/initrd.img-2.6.16-2-xen-686

kernel = /boot/vmlinuz-2.6.18.8-xen

# Insert your favorite etch repo

mirror = http://debian.indika.net.id/debian/</pre>
<p>Now let&#8217;s create a DomU using xen-create-image command, the parameter on the command shows the specification of the DomU;</p>
<pre class="brush: bash">xen-create-image -hostname=tuban.magnet-id.com -size=10Gb -swap=512Mb -ide -ip=117.103.52.61 -netmask=255.255.255.248 -gateway=117.103.52.57 -force -dir=/vserver -memory=128Mb -arch=i386 -kernel=/boot/vmlinuz-2.6.18.8-xen -debootstrap -dist=etch -mirror=http://debian.indika.net.id/debian/ -passwd

General Infomation
-------
Hostname       :  tuban.magnet-id.com
Distribution   :  etch
Fileystem Type :  ext3

Size Information
------
Image size     :  10Gb
Swap size      :  512Mb
Image type     :  sparse
Memory size    :  128Mb
Kernel path    :  /boot/vmlinuz-2.6.18.8-xen

Networking Information
--------
IP Address 1   : 117.103.52.xx
Netmask        : 255.255.255.248
Gateway        : 117.103.52.xx

WARNING
---
Loopback module not loaded and you&#039;re using loopback images
Run the following to load the module:

modprobe loop loop_max=255

Creating swap image: /vserver/domains/tuban.magnet-id.com/swap.img
Done

Creating disk image: /vserver/domains/tuban.magnet-id.com/disk.img
Done

Creating ext3 filesystem on /vserver/domains/tuban.magnet-id.com/disk.img
Done

Installing your system with debootstrap mirror http://debian.indika.net.id/debian/
Done

Running hooks
Done

No role script specified.  Skipping

Creating Xen configuration file
Done
Setting up root password
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
All done

Logfile produced at:
/var/log/xen-tools/tuban.magnet-id.com.log
</pre>
<p>This will create a DomU using file based (image) storage. The image will be mounted on a loop devices, I read somewhere that this configuration will be risky for the integrity of DomU data, so again, I would not recommend this kind of setup.</p>
<p>After the DomU creation you are going to find the DomU configuration file in /etc/xen/hostname.cfg, in this case is /etc/xen/tuban.magnet-id.com.cfg. Fire up the DomU;</p>
<pre class="brush: bash"> idayu:~# xm create /etc/xen/tuban.magnet-id.com.cfg
Using config file &quot;/etc/xen/tuban.magnet-id.com.cfg&quot;.
Started domain tuban.magnet-id.com </pre>
<p>To auto boot the virtual machine during Dom0 startup, make a symlink to the DomU config file inside /etc/xen/auto/</p>
<pre class="brush: bash"> idayu:~# ln -s /etc/xen/tuban.magnet-id.com.cfg /etc/xen/auto/ </pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tajidyakub.com/virtualization/xen-320-on-debian-etch-2008-02-02.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
