<?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>pixelchaos.net &#187; Xen</title>
	<atom:link href="http://www.pixelchaos.net/category/xen/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pixelchaos.net</link>
	<description>random bits for your terminal</description>
	<lastBuildDate>Tue, 29 Sep 2009 11:38:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>openais: an alternative to clvm with cman</title>
		<link>http://www.pixelchaos.net/2009/04/23/openais-an-alternative-to-clvm-with-cman/</link>
		<comments>http://www.pixelchaos.net/2009/04/23/openais-an-alternative-to-clvm-with-cman/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 17:24:29 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=106</guid>
		<description><![CDATA[I&#8217;ve been battling lately with a lot of problems with cman, part of Red Hat Cluster Suite. Specifically, the fencing tool (fenced) is pretty much junk when you try to start using it with Xen dom0&#8217;s. After much searching and gnashing of teeth I happened upon this mailing list post. The promise there is that [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been battling lately with a lot of problems with cman, part of Red Hat Cluster Suite. Specifically, the fencing tool (fenced) is pretty much junk when you try to start using it with Xen dom0&#8217;s. After much searching and gnashing of teeth I happened upon <a href="http://xen.markmail.org/message/xrrvmcl7bq6p4pvk?q=clvm+openais">this</a> mailing list post. The promise there is that you could take clvm and compile it against openais and get a cluster aware LVM which doesnt require the rest of Red Hat Cluster Suite (and its crappy documentation, crappy fencing, and general all around crappiness). A little more searching turned up <a href="http://h2o.glou.fr/post/2009/04/20/clvm-openais-on-Debian/Lenny">this</a> web site from Olivier Le Cam which pretty much did 90% of the work for me.</p>
<p>After some testing I&#8217;m happy to say it appears to work smashingly. What follows is a somewhat more complete version of how to achieve the same results on Debian Lenny. Enjoy :)</p>
<p><span id="more-106"></span><br />
The first thing that needs to be done is to get the debian sources for clvm and modify then to use openais. After that we will recompile new packages from that source, then set up openais on our cluster nodes.</p>
<p>Install all the dependencies we need to compile clvm</p>
<pre class="brush: plain;">
root@host:~# apt-get build-dep clvm
root@host:~# apt-get install libopenais-dev
</pre>
<p>Now download the source files and cd into our working directory</p>
<pre class="brush: plain;">
root@host:~# cd /usr/src/
root@host:/usr/src# apt-get source clvm
root@host:/usr/src# cd lvm2-2.02.39
</pre>
<p>Now we&#8217;ll modify a few files in the source:</p>
<ul>
<li> The first is debian/clvm.init. You&#8217;ll need to remove any references to cman or cluster.conf. You can download an already edited version <a href='http://www.pixelchaos.net/wp-content/uploads/2009/04/clvm.init'>here</a>.</li>
<li>The next is debian/control. Modify the dependies (lvm2 without the version number, openais in place of cman) and modify the comments accordingly. A pre-edited version is <a href='http://www.pixelchaos.net/wp-content/uploads/2009/04/control'>here</a>.</li>
<li> The last file is debian/rules. Replace cman by openais in the configure options, and add the PATH where to find the openais libs. Again, a pre-made version is <a href='http://www.pixelchaos.net/wp-content/uploads/2009/04/rules'>here</a>.</li>
</ul>
<p>For clarities sake, here is the actual code block from debian/rules:</p>
<pre class="brush: plain;">
$(STAMPS_DIR)/setup-deb: SOURCE_DIR = $(BUILD_DIR)/source
$(STAMPS_DIR)/setup-deb: DIR = $(BUILD_DIR)/build-deb
$(STAMPS_DIR)/setup-deb: $(STAMPS_DIR)/source
        rm -rf $(DIR)
        cp -al $(SOURCE_DIR) $(DIR)
        cd $(DIR); \
        ./configure CFLAGS=&quot;$(CFLAGS)&quot; \
		LDFLAGS=&quot;-L/usr/lib/openais&quot; \
                $(CONFIGURE_FLAGS) \
                --with-optimisation=&quot;&quot; \
                --with-clvmd=openais \
                --enable-readline
        touch $@
</pre>
<p>The last thing to do is update the internal version number of the clvm package and add some comments to the changelog:</p>
<pre class="brush: plain;">
root@host:/usr/src/lm2-2.02.39# dch -i
</pre>
<p>Now go ahead and compile the package:</p>
<pre class="brush: plain;">
root@host:/usr/src/lm2-2.02.39# dpkg-buildpackage -rfakeroot -uc -b
</pre>
<p>After the compliation completes you should have some shiny new .deb files in /usr/src. The one we are interested in is clvm_2.02.39-7.1_i386.deb (the actual version of yours may vary depending on what you put in the debian changelog in the previous step).</p>
<p>So now that weve got our custom version of clvm compiled, its time to move on the cluster nodes. On each node in the cluster, do the following&#8230;</p>
<p>Install openais and add a user for it:</p>
<pre class="brush: plain;">
root@node:~# apt-get install openais
root@node:~# mkdir -p /etc/ais
root@node:~# adduser --no-create-home --disabled-password --disabled-login --gecos openAIS ais
</pre>
<p>Now create the following config in /etc/ais/openais.conf. This is the most basic config you can have. All you need to do is set 192.168.1.0 to be your actual network address.</p>
<pre class="brush: plain;">
totem {
        version: 2
        secauth: off
        threads: 0
        interface {
                ringnumber: 0
                bindnetaddr: 192.168.1.0
                mcastaddr: 226.94.1.1
                mcastport: 5405
        }
}
</pre>
<p>openais does not include a proper debian init sript so you can download one <a href="http://www.pixelchaos.net/wp-content/uploads/2009/04/openais.init">here</a> and save it as /etc/init.d/openais. After that is done, add it to the proper runlevels by issuing:</p>
<pre class="brush: plain;">
root@node:~# update-rc.d openais start 62 S . start 50 0 6 .
</pre>
<p>Now we can install our custom deb and turn on LVM clustering</p>
<pre class="brush: plain;">
root@node:~# dpkg -i clvm_2.02.39-7.1_i386.deb
root@node:~# sed -i 's/^    locking_type = 1$/    locking_type = 3/' /etc/lvm/lvm.conf
</pre>
<p>Thats it! Reboot your cluster nodes and they should all be cluster aware now :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2009/04/23/openais-an-alternative-to-clvm-with-cman/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>VLAN Bridging in Xen</title>
		<link>http://www.pixelchaos.net/2008/07/16/vlan-bridging-in-xen/</link>
		<comments>http://www.pixelchaos.net/2008/07/16/vlan-bridging-in-xen/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 00:47:22 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=53</guid>
		<description><![CDATA[Recently I came upon the need to do all my network routing and firewalling inside a Xen domU. I am not the first to do this but I thought I&#8217;d do a little write up on it to help others trying to accomplish the same thing in Debian.
The idea here is to end up with [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I came upon the need to do all my network routing and firewalling inside a Xen domU. I am not the first to do this but I thought I&#8217;d do a little write up on it to help others trying to accomplish the same thing in Debian.</p>
<p>The idea here is to end up with (at least) two VLANs on the network with the dom0 and domU&#8217;s being able to choose one or both networks on which to exist. In the case of both, you can set up a handy domU firewall/gateway :)</p>
<p><a href='http://www.pixelchaos.net/wp-content/uploads/2008/07/xen_vlans.png'><img src="http://www.pixelchaos.net/wp-content/uploads/2008/07/xen_vlans-300x226.png" alt="" title="xen_vlans" width="300" height="226" class="aligncenter size-medium wp-image-54" /></a></p>
<p>As you can see from the diagram above, we will end up with three bridges in the dom0 with all the appropriate glue to tie everything together. Best of all, this is all assembled on the fly during bootup.</p>
<p><span id="more-53"></span></p>
<p>Now, you obviously need to have a Xen dom0 set up and running properly. Once you are at that point, adding VLAN bridging is fairly straightforward:</p>
<p>First we need to install the vlan package to get the tools for manipulating vlans. Crazy, huh?</p>
<pre class="brush: plain;">apt-get install vlan</pre>
<p>Now we set up the interfaces we will need in /etc/network/interfaces. The seasoned admins out there will note that we only bring up the eth0 interface automatically but leave it unconfigured. It will not have an IP or any of the other usual information. The other two (VLAN) interfaces are defined but are NOT brought up during boot. This is important!</p>
<p>In this example the “vlan100″ interface is the replacement for your old “eth0″ interface. Its the interface you’ll be able to reach the dom0 on from the internal VLAN. The “vlan99″ interface is defined but is left unconfigured since there will be no publicly routeable path to the dom0.</p>
<pre class="brush: plain;">auto eth0
iface eth0 inet manual
        pre-up ifconfig $IFACE up
        post-down ifconfig $IFACE down

iface vlan99 inet manual
        mtu 1500
        vlan_raw_device eth0

iface vlan100 inet static
        address 192.168.1.100
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        dns-nameservers 192.168.1.254
        dns-search pixelchaos.net
        mtu 1500
        vlan_raw_device eth0</pre>
<p>Now we create a new network script for xen located at /etc/xen/scripts/network-multi:</p>
<pre class="brush: plain;">#!/bin/sh
#============================================================================
# Xen vlan bridge start/stop script.
# Xend calls a network script when it starts.
# The script name to use is defined in /etc/xen/xend-config.sxp
# in the network-script field.
#
# This script creates multiple bridges to segregate individual domUs to
# separate VLANs. Customize to fit your needs.
#
# Usage:
#
# network-multi (start|stop|status)
#
#============================================================================

dir=$(dirname &quot;$0&quot;)

##
# To make the tagged interface available to some DomUs, create the default
# bridge. Comment this out to only make vlan-based bridges available.
&quot;$dir/network-bridge&quot; &quot;$@&quot; vifnum=0 netdev=eth0 bridge=&quot;xbr_trunk&quot;

# Once the &quot;normal&quot; bridge is active, bring up the vlan interfaces.
# They will be attached to the virtual eth0 interface, and not the
# physical one.
ifup vlan99
ifup vlan100

# Create any vlan-based briges.
&quot;$dir/network-bridge&quot; &quot;$@&quot; vifnum=1 bridge=&quot;xbr_vl99&quot; netdev=&quot;vlan99&quot;
&quot;$dir/network-bridge&quot; &quot;$@&quot; vifnum=2 bridge=&quot;xbr_vl100&quot; netdev=&quot;vlan100&quot;

# bring up the interfaces again? why do we need to do this? they should have been brought back up by the previous network-bridge call…
ip link set vlan100 up
route add default gw 192.168.1.1 vlan100</pre>
<p>That script basically just calls the standard “network-bridge” script supplied with Xen three times &#8211; once for each VLAN we are setting up. You’ll notice some interesting bits at the end &#8211; We call “ip link” and “route” to bring the vlan100 interface up again. I’m not sure yet why the previous “network-bridge” call doesnt do that on its own… it should as far as I know but I havent dug into why it doesnt. This is just a quick hack to bring “vlan100″ back up again and fix the routes.</p>
<p>Go ahead and add the call to that script in the place of network-bridge in /etc/xen/xend-config.sxp.</p>
<p>Now we need to do one final thing to another Xen script. By default, the xen-network-common.sh script calls “ifdown” directly to take an interface down. Unfortunately, this has the undesirable side effect of destroying any VLANs associated with that interface. This causes all kinds of problems when we call our “network-multi” script so we need to patch /etc/xen/scripts/xen-network-common.sh with the following section:</p>
<pre class="brush: plain;"># do not call ifdown directly
  ifdown()  {
    ip addr flush $1
    ip link set $1 down
    true
  }</pre>
<p>To see exactly where that chunk of code goes you can download my already modified script <a href='http://www.pixelchaos.net/wp-content/uploads/2008/07/xen-network-common.sh'>here</a>, or get a diff <a href='http://www.pixelchaos.net/wp-content/uploads/2008/07/xen-network-common.patch'>here</a> if you prefer.</p>
<p>After youve done all that, reboot your dom0. You should now be up and running on the vlan100 interface. The output of &#8220;brctl show&#8221; should show this:</p>
<pre class="brush: plain;">root@atlas:~# brctl show
bridge name  bridge id          STP enabled    interfaces
xbr_trunk    8000.feffffffffff  no             vif0.0
                                               peth0
xbr_vl100    8000.feffffffffff  no             vif0.2
                                               pvlan100
xbr_vl99     8000.feffffffffff  no             vif0.1
                                               pvlan99</pre>
<p>If so, you should be all ready to go. Now edit the vif line in your config file for a given domU to link its ethernet interface to a bridge. My domU firewall is linked to two bridges so it looks like this:</p>
<pre class="brush: plain;">vif= [ 'mac=00:16:3E:44:F9:9C, bridge=xbr_vl99', 'mac=00:16:3E:41:16:51, bridge=xbr_vl100' ]</pre>
<p>Thats it! Easy, huh?</p>
<p>Many, many thanks go to <a href="http://mike.neir.org">Mike Neir</a> for holding my hand through figuring this all out since he&#8217;d already set up a functional system that is very similar. Thanks also go to <a href="http://www.firstserved.net/blog/2007/07/19/bridging-vlan-interfaces-in-xen/trackback">firstserved.net</a> for the ifdown patch and <a href="http://renial.net/weblog/2007/02/27/xen-vlan/trackback">renial.net</a> for other ideas on ways to set up VLAN bridging in Xen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/07/16/vlan-bridging-in-xen/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Coraid Odyssey: Part 3 (performance testing)</title>
		<link>http://www.pixelchaos.net/2008/04/08/coraid-odyssey-part-3/</link>
		<comments>http://www.pixelchaos.net/2008/04/08/coraid-odyssey-part-3/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 16:15:46 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[AoE]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Xen]]></category>
		<category><![CDATA[iSCSI]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=48</guid>
		<description><![CDATA[Performance and failure testing are next up in building our kickin&#8217; iSCSI/AoE device.
The Debian Etch installer supports building and installing onto software RAID arrays. Because of that&#8230;
during installation I configured the initial RAID1 boot volume with hot spare, consisting of three WD 160GB SATA 3Gbps disks. mdadm sees / and swap as /dev/md0 and /dev/md1 [...]]]></description>
			<content:encoded><![CDATA[<p>Performance and failure testing are next up in building our kickin&#8217; iSCSI/AoE device.</p>
<p>The Debian Etch installer supports building and installing onto software RAID arrays. Because of that&#8230;</p>
<p><span id="more-48"></span>during installation I configured the initial RAID1 boot volume with hot spare, consisting of three WD 160GB SATA 3Gbps disks. mdadm sees / and swap as /dev/md0 and /dev/md1 respectively. There was some remaining space on the drives which I set up as /dev/md2 for future use. The remaining arrays I decided to create manually using mdadm after getting a usable system up and running.</p>
<p>First of all we need figure out what devices we want in the arrays by probing /dev. The ultimate goal here is to build three arrays: 1 x RAID1 with 1 hot spare (8GB root, 1GB swap, 151GB extra), 1 x RAID6 with 1 hot spare (4TB Xen LVM&#8217;s + 2TB Bacula LVM), 1 x RAID5 (2TB offsite mirror).</p>
<p>I was forward thinking enough to label all the drive carriers with the serial number of the disk in it so all we need to do is get the disk-by-id name from /dev/disk/by-id/ and then build our test array like so:</p>
<p><code type="text"><br />
mdadm --create /dev/md3 --level=6 --raid-devices=8 \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ09HZR \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ09JV3 \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ06913 \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ08XHB \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ09KNM \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ09JHQ \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ0817T \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ09B9P \<br />
--spare-devices=1 \<br />
/dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ07CF3<br />
</code></p>
<p>This assembles our /dev/md3 device with the default options for RAID6 (64k chunk, left-symmetric parity)</p>
<p><code type="text"><br />
stor01:~# cat /proc/mdstat<br />
Personalities : [raid1] [raid6] [raid5] [raid4]<br />
md3 : active raid6 sdl[8](S) sdk[7] sdj[6] sdf[5] sdh[4] sdg[3] sdi[2] sde[1] sdd[0]<br />
5860574976 blocks level 6, 64k chunk, algorithm 2 [8/8] [UUUUUUUU]<br />
[>....................]  resync =  0.8% (8790864/976762496) finish=217.3min speed=74238K/sec<br />
</code></p>
<p>Here you can see that CPU load is moderate doing the first full sync of that array:</p>
<p><code type="text"><br />
Cpu0  :  0.0%us, 33.3%sy,  0.0%ni, 63.3%id,  0.0%wa,  1.3%hi,  2.0%si,  0.0%st<br />
Cpu1  :  0.0%us,  7.0%sy,  0.0%ni, 91.0%id,  0.0%wa,  0.3%hi,  1.7%si,  0.0%st<br />
</code></p>
<p>So, we wait about 4 hours&#8230; and its done :-)</p>
<p>For formatting the volume, I decided to use the stride= option to mkfs.ext3. This provides for optimal striping across a raid array. The secret here is to make $stride = $chunks / $block_size. In our case, thats 4096 byte (4k) blocks divided by 64k chunks. So 16 would be our optimal stride value.</p>
<p><code type="text"><br />
root@stor01:~# mkfs.ext3 -E stride=16 /dev/md3<br />
</code></p>
<p>So how does it perform? Well enough to saturate the dual gigabit NIC ports &#8211; which is all that matters :-)</p>
<p><code type="text"><br />
root@stor01:~# dd bs=4M if=/dev/zero of=/dev/md3<br />
4469+0 records in<br />
4469+0 records out<br />
18744344576 bytes (19 GB) copied, 97.583 seconds, 192 MB/s<br />
</code></p>
<p>I also ran a more real-world test with bonnie++</p>
<p><code type="text"><br />
/usr/sbin/bonnie++ -d /mnt -s 4096Mb -n 100 -x 10 -q<br />
</code></p>
<p>This test showed approximately 335MB/s read, 170MB/s write. You can download the actual data <a href="http://www.pixelchaos.net/?attachment_id=49">here</a> if you wish.</p>
<p>For failure testing the array, its as simple as removing and inserting disks while the array is up and running. Both tests work fine for the onboard SATA II controller but alas, the sata_mv kernel module does not yet support hotplug so all we can do on the remaining drives is simulate a drive failure by removing one disk. This does work fine but I need to see if there is a way to refresh the SATA bus to get any replacement drive to show up and be added back into the running array. Otherwise, we will need to power down the array to replace a faulty disk which kind of ruins the whole project, dont you think? ;-)</p>
<p>So while we wait for sata_mv to start working (or find a different SATA controller to use in this project) we will move on to the remaining issues. Up next; getting port trunking working with a cisco switch&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/04/08/coraid-odyssey-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coraid Odyssey: Part 2 (sata_mv hotplug)</title>
		<link>http://www.pixelchaos.net/2008/04/01/coraid-odyssey-part-2/</link>
		<comments>http://www.pixelchaos.net/2008/04/01/coraid-odyssey-part-2/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 15:33:28 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[AoE]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Xen]]></category>
		<category><![CDATA[iSCSI]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/?p=47</guid>
		<description><![CDATA[Todays adventure with building a SAN on the cheap involves attempting to get hotplug working and changing device mappings.
First of all, hotplug. I have discovered that&#8230;
hotplug doesn&#8217;t seem to work on the Supermicro AOC-SAT2-MV8 cards. The controllers do work, but unless a drive is plugged in during bootup they will not be subsequently detected&#8230;

root@stor01:~# lspci
05:01.0 [...]]]></description>
			<content:encoded><![CDATA[<p>Todays adventure with building a SAN on the cheap involves attempting to get hotplug working and changing device mappings.</p>
<p>First of all, hotplug. I have discovered that&#8230;</p>
<p><span id="more-47"></span>hotplug doesn&#8217;t seem to work on the Supermicro AOC-SAT2-MV8 cards. The controllers do work, but unless a drive is plugged in during bootup they will not be subsequently detected&#8230;</p>
<p><code type="text"><br />
root@stor01:~# lspci<br />
05:01.0 SCSI storage controller: Marvell Technology Group Ltd. MV88SX6081 8-port SATA II PCI-X Controller (rev 09)<br />
05:02.0 SCSI storage controller: Marvell Technology Group Ltd. MV88SX6081 8-port SATA II PCI-X Controller (rev 09)<br />
</code></p>
<p>You can see that the Linux kernel sees these cards as Marvell MV88SX6081 devices. Further probing reveals that the sata_mv driver is claiming them:</p>
<p><code type="text"><br />
root@stor01:~$ dmesg | grep 05:01.0<br />
sata_mv 0000:05:01.0: version 0.7<br />
ACPI: PCI Interrupt 0000:05:01.0[A] -> GSI 24 (level, low) -> IRQ 233<br />
sata_mv 0000:05:01.0: 32 slots 8 ports SCSI mode IRQ via INTx<br />
</code></p>
<p>So off we go <a href="http://lkml.org">lkml.org</a> and other sources to find out why&#8230; Basically, hotplug support in the sata_mv module is still a work in progress. A <a href="http://lkml.org/lkml/2007/12/12/143">post</a> to the lkml claims that its slated for inclusion in the 2.6.26 kernel. There is also more information <a href="http://linux-ata.org/driver-status.html">here</a>.</p>
<p>So hotplug isnt going to work for us today :-( On the bright side, 2.6.25-rc7 is the current development kernel so I can&#8217;t imagine that 2.6.26 is too far off.</p>
<p>The second (perceived) issue of getting all the hot swap bays to be mapped to /dev/sd* entries in a particular order doesnt seem to be as much of an issue as I&#8217;d thought.</p>
<p>The Linux kernel will initialize PCI devices in a strange fashion depending on what is plugged in to the bus. For example, if all fifteen bays have drives plugged into them, the leftmost bay always shows up at /dev/sda. Unplug just one drive and reboot the machine and it will be mapped to /dev/sdl for example. The reason this isnt really an issue is that newer Linux kernels have not only udev (which is great but not really a solution for this particular problem) but the /dev/disk/by-* tree. You can find all your disks in there with handy names like /dev/disk/by-id/scsi-SATA_ST31000340NS_5QJ06913. That name belongs to that particular drive and only that particular drive, ever.</p>
<p><code type="text"><br />
root@stor01:~# ls -l /dev/disk/by-id/ | grep scsi | grep -v part<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ06913 -> ../../sde<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ07CF3 -> ../../sdi<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ0817T -> ../../sdb<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ08T21 -> ../../sdh<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ08XHB -> ../../sdc<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ09B9P -> ../../sda<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ09GMW -> ../../sdd<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ09HZR -> ../../sdg<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ09JHQ -> ../../sdk<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ09JV3 -> ../../sdj<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ09KNM -> ../../sdl<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_ST31000340NS_5QJ09LLA -> ../../sdf<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_WDC_WD1600AAJS-_WD-WCAP93952468 -> ../../sdm<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_WDC_WD1600AAJS-_WD-WMAS20341446 -> ../../sdo<br />
lrwxrwxrwx 1 root root  9 2008-04-01 11:15 scsi-SATA_WDC_WD1600AAJS-_WD-WMAS20366839 -> ../../sdn<br />
</code></p>
<p>Cool, huh?</p>
<p>So we will just let mdadm do its job of assembling /dev/md* devices on the fly at bootup and use the /dev/disk/by-id entries to do stuff to particular disks (like temperature monitoring, etc.).</p>
<p>Coming up in my next post &#8211; performance and failure testing the array.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/04/01/coraid-odyssey-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coraid Odyssey: Part 1 (building the chassis)</title>
		<link>http://www.pixelchaos.net/2008/03/28/coraid-odyssey-part-1/</link>
		<comments>http://www.pixelchaos.net/2008/03/28/coraid-odyssey-part-1/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 21:17:03 +0000</pubDate>
		<dc:creator>jcl</dc:creator>
				<category><![CDATA[AoE]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Xen]]></category>
		<category><![CDATA[iSCSI]]></category>

		<guid isPermaLink="false">http://www.pixelchaos.net/index.php/archives/46</guid>
		<description><![CDATA[AoE (ATA over Ethernet) and iSCSI are the hot new things. Xen is the hot new thing. I like using hot new things as long as they can be made rock solid.
There happens to be a company (Coraid) that makes a turnkey AoE device. Its far cheaper than a true fibre channel SAN or something [...]]]></description>
			<content:encoded><![CDATA[<p>AoE (ATA over Ethernet) and iSCSI are the hot new things. <a href="http://xen.org">Xen</a> is the hot new thing. I like using hot new things as long as they can be made rock solid.</p>
<p>There happens to be a company (<a href="http://www.coraid.com">Coraid</a>) that makes a turnkey AoE device. Its far cheaper than a true fibre channel SAN or something similar. Perfect for setting up a SAN over Ethernet device that can serve Xen domU filesystems out to &#8220;thin&#8221; dom0&#8217;s on the network.</p>
<p>Well that&#8217;s all well and good but you see I&#8217;m always looking to save a buck&#8230;</p>
<p><span id="more-46"></span> So I asked myself; why not build my own &#8220;coraid&#8221; with off the shelf parts and save 50% in the process? Herein I&#8217;ll do my best to chronicle my adventures in getting this thing built, tested, and (hopefully) deployed.</p>
<p>First of all the hardware. Thanks to the ever-brilliant <a href="http://mike.neir.org">Mike Neir</a> for helping me figure out what Coraid uses to build these suckers. Here are the parts I ended up ordering:</p>
<ul>
<li> 2 x Supermicro 8-Port SATA Card (AOC-SAT2-MV8)</li>
<li> 1 x Supermicro Xeon Dual-Core Blackford VS ServerBoard (X7DVL-E)</li>
<li> 1 x Supermicro Black 3U Rackmount Case 760W (SC933T-R760B)</li>
<li> 1 x Kingston 2GB 240-Pin DDR2 FB-DIMM ECC (KVR667D2D8F5K2/2G)</li>
<li> 1 x Intel Xeon 5130 Woodcrest 2.0GHz 4M (BX805565130A)</li>
<li> 15 x Seagate Barracuda ES.2 1TB (ST31000340NS)</li>
<li> 3 x Supermicro Drive Carrier (CSE-PT39B)</li>
<li> 3 x Western Digital 7K 8M SATA2 160GB (WD1600AAJS)</li>
</ul>
<p>Now you may ask, why buy 18 drives for a chassis that has 15 hot swap bays? Well, I&#8217;ll be using the three WD drives as a RAID1 boot device with one hot spare, then setting nine of the 1TB drives up into a RAID6 device with one hot spare. The remaining three drives will be in RAID5 and swapped with the last three drives on a regular basis to go off site as part of a hard disk based backup system.</p>
<p>Now that we have all of that out of the way; how did the assembly go? Flawless almost ;-)</p>
<p>There are two gotcha&#8217;s to be dealt with in the assembly of the aforementioned motherboard and server chassis; first of all, the EPS12V connector for CPU power that comes out of the power distribution block wont reach its molex connector on the motherboard. Second, the ribbon cable that connects the front panel controls to the their motherboard header just *barely* reaches which makes me uncomfortable.</p>
<p>To resolve the first problem I ordered up a StarTech 8&#8243; EPS 8 Pin Power Extension Cable (EPS8EXT) which did the job nicely. To fix the second issue, I ordered twenty feet of 16 conductor ribbon cable (might need extra!), some cable ends and a crimper. Problem solved.</p>
<p>With all that taken care of its time to get an operating system installed and test this thing out. I did go ahead and power up the system and test the redundant PSU&#8217;s and fans. The alarm features of both seem to work fine with audible alarms when any of them are removed from the system. After that I plugged an old CD-ROM into the ATA header on the mobo and installed a <a href="http://www.debian.org">rockin Linux distro</a>.</p>
<p>Some things I discovered:</p>
<ul>
<li>The BIOS and the Linux kernel both initialize the two SATA PCI cards first. Some fiddling will need to be done to make the three WD drives (plugged into the motherboard SATA headers) show up as sda, sdb, and sdc.</li>
<li>You must turn off &#8220;compatibility mode&#8221; in the BIOS for the onboard SATA controllers or hotplug will not work for drives on those headers. After turning it off, hotplug works just dandy. Yay!</li>
<li>Hotplug isnt working for the two PCI SATA cards at this point. I suspect its something to do with the sata_mv kernel module but havent gotten to look into it much. That will be the first order of business when next I work on this project.</li>
</ul>
<p>So thats it for now. Things are coming together nicely. My next post will detail getting hotplug working for the two PCI SATA cards and getting device detection and mapping working correctly in the Linux kernel (I smell some udev tomfoolery most likely).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pixelchaos.net/2008/03/28/coraid-odyssey-part-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
