<?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>hacksqnd.com &#187; Sysadmin</title>
	<atom:link href="http://www.hacksqnd.com/category/sysadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hacksqnd.com</link>
	<description>Life, the universe, and everything</description>
	<lastBuildDate>Thu, 31 Dec 2009 16:04:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Xen on Ubuntu 8.04 (Hardy Heron) with Software Raid and LVM</title>
		<link>http://www.hacksqnd.com/sysadmin/xen-on-ubuntu-8-04-hardy-heron-with-software-raid-and-lvm/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=xen-on-ubuntu-8-04-hardy-heron-with-software-raid-and-lvm</link>
		<comments>http://www.hacksqnd.com/sysadmin/xen-on-ubuntu-8-04-hardy-heron-with-software-raid-and-lvm/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 15:59:36 +0000</pubDate>
		<dc:creator>don</dc:creator>
				<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://www.hacksqnd.com/?p=14</guid>
		<description><![CDATA[This is a short guide to configuring XEN on Ubuntu 8.04 LTS using RAID and LVM. It is designed as a stable and efficient configuration for a single server with two hard disks. Building the Dom0 (Host) Download the Latest Ubuntu 8.04 server installation DVD. Boot off the CD and select the first install option [...]]]></description>
			<content:encoded><![CDATA[<p>This is a short guide to configuring XEN on Ubuntu 8.04 LTS using RAID and LVM. It is designed as a stable and efficient configuration for a single server with two hard disks.</p>
<h3> Building the Dom0 (Host) </h3>
<ol>
<li> Download the Latest Ubuntu 8.04 server installation DVD. </li>
<p></p>
<li> Boot off the CD and select the first install option
<ul>
<li> At the partitioning screen create two raid partitions on each disk. The first should be 1024MB in size. The second should use the rest of the disk. </li>
<li> Now generate two raid volumes using the partitions you've created. </li>
<li> On the first (1024MB) raid volume create an ext3 filesystem. Select for it to be mounted on /boot </li>
<li> On the second raid device create a large LVM partition the uses the entire device </li>
<li> Within the LVM partition create two logical volumes. The first should be of type "swap". The second should be a 15GB ext3 filesystem with a mountpoint of /. </li>
<li> When prompted for services select the SSH server option. Nothing else should need to run on the Dom0 (the host OS). </li>
</ul>
</li>
<li> Update the system
<ul>
<li> <i> aptitude update &#038;& aptitude dist-upgrade </i> </li>
</ul>
</li>
<li> Install necessary packages
<ul>
<li> <i> aptitude install ubuntu-xen-server vim xfsprogs ssh </i> </li>
</ul>
</li>
<li> Reboot and check XEN is working
<ul>
<li> <i> uname -r </i></li>
<li> <i> xm list </i> </li>
</ul>
</li>
<li>
</ol>
<h3> Manually creating a DOMU (Guest) </h3>
<ol>
<li> Create the LVM partitions for the guest
<ul>
<li> <i> lvcreate -L 20G -n test1 SYSTEMVG </i> </li>
<li> <i> lvcreate -L 2G -n test1_swap SYSTEMVG </i> </li>
<li> <i> mkfs.xfs /dev/SYSTEMVG/test1 </i> </li>
<li> <i> mkswap /dev/SYSTEMVG/test1_swap </i> </li>
</ul>
</li>
<li> Build the base system in the guest
<ul>
<li><i>mount /dev/SYSTEMVG/test1 /mnt </i></li>
<li><i> cd /mnt </i></li>
<li><i>debootstrap --arch amd64 hardy /mnt http://archive.ubuntu.com/ubuntu </i>
<li>
<li><i>mount --bind /dev/ /mnt/dev </i></li>
<li><i>mount proc /mnt/proc -t proc </i></li>
</ul>
</li>
<li> Copy some critical files into the guest filesystem
<ul>
<li><i> mkdir -p /mnt/lib/modules/ </i></li>
<li><i> cp -a /lib/modules/`uname -r` /mnt/lib/modules </i></li>
<li><i> cp /etc/resolv.conf /mnt/etc/resolv.conf </i></li>
<li><i> cp /etc/apt/sources.list /mnt/etc/apt/sources.list </i> </li>
</ul>
</li>
<li> Chroot into the newly created guest filesystem
<ul>
<li><i> chroot /mnt </i></li>
<ul>
<li><i>aptitude update &#038;& aptitude dist-upgrade </i></li>
<li> <i>aptitude install vim ssh xfsprogs </i></li>
<li> <i>passwd </i> (set a root password) </li>
<li> Edit /etc/fstab to look like the following<br />
                 <code><br />
                 /dev/xvda1              /               xfs     defaults        1 2<br />
                 /dev/xvda2              none            swap    sw              0 0<br />
                 proc                    /proc           proc    defaults        0 0<br />
                 </code><br />
                 <br/>
                 </li>
<li> Create an /etc/network/interfaces to look like the following (substituting the relevant details for your network).<br />
                 <code><br />
                 auto lo<br />
                 iface lo inet loopback<br />
                 </code><br />
                 <code><br />
                 auto eth0<br />
                 iface eth0 inet static<br />
                 address 192.168.0.16<br />
                 netmask 255.255.255.0<br />
                 gateway 192.168.0.1<br />
                 </code><br />
                 <br/>
                 </li>
<li> Create an /etc/hostname file with the short hostname of the guest </li>
<li> <i> exit </i> (exit from the chroot) </li>
</ul>
</ul>
</li>
<li> Now we need to create an XEN config file
<ul>
<li> Create the file /etc/xen/test1 (substituting test1 with the short hostname of your guest)<br />
                        <code><br />
                         kernel = '/boot/vmlinuz-2.6.24-24-xen'<br />
                         ramdisk = '/boot/initrd.img-2.6.24-24-xen'<br />
                         memory  = '512'<br />
                         name    = 'Hardy_xentest1'<br />
                         vif     = [ '' ]<br />
                        dhcp    = "dhcp"<br />
                        extra   = 'xencons=tty'<br />
                       disk = ['phy:SYSTEM_VG/test1,xvda1,w','phy:SYSTEM_VG/test1_swap,xvda2,w']<br />
                       root = "/dev/xvda1 ro"<br />
                       </code><br />
                       <br/>
                </li>
<li> Start the XEN guest
<ul>
<li> <i> xm create /etc/xen/test1 -c </i> (the -c attaches a console so we can see the guest boot) </li>
</ul>
</li>
<ul>
</li>
</ol>
<h3> Useful XEN commands </h3>
<ul>
<li> List running XEN instances - <i> xm list </i> </li>
<li> Connect a console to a running DOMU <i> xm console &lt;DOMU_name&gt;</i> (to escape from a console use <i>ctrl-]</i> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.hacksqnd.com/sysadmin/xen-on-ubuntu-8-04-hardy-heron-with-software-raid-and-lvm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

