<?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>Lance Albertson &#187; gentoo</title>
	<atom:link href="http://www.lancealbertson.com/tag/gentoo/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lancealbertson.com</link>
	<description>Musings of a geek, jazz performer, and an OSUOSL sysadmin</description>
	<lastBuildDate>Tue, 03 May 2011 06:09:36 +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>Networking with Ganeti</title>
		<link>http://www.lancealbertson.com/2011/03/networking-with-ganeti/</link>
		<comments>http://www.lancealbertson.com/2011/03/networking-with-ganeti/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 02:07:33 +0000</pubDate>
		<dc:creator>lance</dc:creator>
				<category><![CDATA[ganeti]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[osuosl]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[bridge interface]]></category>
		<category><![CDATA[network setup]]></category>
		<category><![CDATA[vlan]]></category>

		<guid isPermaLink="false">http://www.lancealbertson.com/?p=366</guid>
		<description><![CDATA[I&#8217;ve been asked quite a bit about how I do our network setup with Ganeti. I admit that it did take me a bit to figure out a sane way to do it in Gentoo. Unfortunately (at least in baselayout-1.x) bringing up VLANs with bridge interfaces in Gentoo is rather a pain. What I&#8217;m about [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been asked quite a bit about how I do our network setup with Ganeti. I admit that it did take me a bit to figure out a sane way to do it in Gentoo. Unfortunately (at least in baselayout-1.x) bringing up VLANs with bridge interfaces in Gentoo is rather a pain. What I&#8217;m about to describe is basically a hack and there&#8217;s probably a better way to do this. I hope it gets improved in baselayout-2.x but I haven&#8217;t had a chance to take a look. Please feel free to add comments on what you feel will work better.</p>
<p>The key problem I ran into was dealing with starting up the vlan interfaces first, then starting up the bridged interfaces in the correct order. Here&#8217;s a peek at the network config on one of our Ganeti hosts on Gentoo:</p>
<pre class="brush: bash; title: ; notranslate">
# bring up bridge interfaces manually after eth0 is up
postup() {
    local vlans=&quot;42 113&quot;
    if [ &quot;${IFACE}&quot; = &quot;eth0&quot; ] ; then
        for vlan in $vlans ; do
            /etc/init.d/net.br${vlan} start
            if [ &quot;${vlan}&quot; = &quot;113&quot; ] ; then
                # make sure the bridges get going first
                sleep 10
            fi
        done
    fi
}
# bring down bridge interfaces first
predown() {
    local vlans=&quot;42 113&quot;
    if [ &quot;${IFACE}&quot; = &quot;eth0&quot; ] ; then
        for vlan in $vlans ; do
            /etc/init.d/net.br${vlan} stop
        done
    fi
}

# Setup trunked VLANs
vlans_eth0=&quot;42 113&quot;
config_eth0=( &quot;null&quot; )
vconfig_eth0=( &quot;set_name_type VLAN_PLUS_VID_NO_PAD&quot; )
config_vlan42=( &quot;null&quot; )
config_vlan113=( &quot;null&quot; )

# Bring up primary IP on eth0 via the bridged interface
bridge_br42=&quot;vlan42&quot;
config_br42=( &quot;10.18.0.150 netmask 255.255.254.0&quot; )
routes_br42=( &quot;default gw 10.18.0.1&quot; )

# Setup bridged VLAN interfaces
bridge_br113=&quot;vlan113&quot;
config_br113=( &quot;null&quot; )

# Backend drbd network
config_eth1=( &quot;192.168.19.136 netmask 255.255.255.0&quot; )
</pre>
<p>The latter portion of the config its fairly normal. I setup eth0 to null, set the VLAN&#8217;s to null, then I add settings to the bridge interfaces. In our case we have the IP for the node itself on br42. The rest of the VLAN&#8217;s are just set to null. Finally we setup the backend secondary IP.</p>
<p>The first part of the config is the &#8220;fun stuff&#8221;. In order for this to work you need to only add net.eth0 and net.eth1 to the default enabled level. The post_up() function will start the bridge interfaces after eth0 has started and iterates through the list of vlans/bridges. Since I&#8217;m using the bridge interface as the primary host connection, I added a simple sleep at the end to let it see the traffic first.</p>
<p>That&#8217;s it! A fun hack that seems to work. I would love to hear feedback on this :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lancealbertson.com/2011/03/networking-with-ganeti/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Installing Ganeti on Gentoo</title>
		<link>http://www.lancealbertson.com/2010/05/installing-ganeti-on-gentoo/</link>
		<comments>http://www.lancealbertson.com/2010/05/installing-ganeti-on-gentoo/#comments</comments>
		<pubDate>Sat, 22 May 2010 05:52:07 +0000</pubDate>
		<dc:creator>lance</dc:creator>
				<category><![CDATA[gentoo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[drbd]]></category>
		<category><![CDATA[ganeti]]></category>
		<category><![CDATA[kvm]]></category>

		<guid isPermaLink="false">http://www.lancealbertson.com/?p=153</guid>
		<description><![CDATA[Installing Ganeti is a relatively simple process on Gentoo. This post will go over the basics on getting it running on Gentoo. Its based primarily on a wiki page at the OSUOSL so check it out for more detailed instructions. I also recommend you read the upstream docs on Ganeti prior to installing it on [...]]]></description>
			<content:encoded><![CDATA[<p>Installing Ganeti is a relatively simple process on Gentoo. This post will go over the basics on getting it running on Gentoo. Its based primarily on a <a href="http://dokuwiki.osuosl.org/public/ganeti_cluster_gentoo">wiki page at the OSUOSL</a> so check it out for more detailed instructions. I also recommend you read the <a href="http://ganeti-doc.googlecode.com/svn/ganeti-2.1/html/index.html">upstream docs</a> on Ganeti prior to installing it on your own. It will cover a lot more topics in detail and this post is intended just as a diff from that doc.</p>
<p>I should note that I have only installed Ganeti with KVM and have not tested it with Xen on Gentoo. I appreciate feedback if you have installed and used Xen with Ganeti on Gentoo. I&#8217;m also the current package maintainer for Ganeti and the related packages in Gentoo such as:</p>
<ul>
<li><a href="http://packages.gentoo.org/package/app-emulation/ganeti">app-emulation/ganeti</a> (primary package)</li>
<li><a href="http://packages.gentoo.org/package/app-emulation/ganeti"></a><a href="http://packages.gentoo.org/package/app-emulation/ganeti-htools">app-emulation/ganeti-htools</a> (automatic allocation)</li>
<li><a href="http://packages.gentoo.org/package/app-emulation/ganeti-htools"></a><a href="http://packages.gentoo.org/package/app-emulation/ganeti-instance-debootstrap">app-emulation/ganeti-instance-debootstrap</a> (instance creation)</li>
</ul>
<p>The first step is to install a base Gentoo system using the standard profile. You can use a hardened profile however if you intend to use ganeti-htools, it requires haskell which seems to have issues in hardened.</p>
<h2>Configuring DNS</h2>
<p>Ganeti requires the following names to resolve before you can set it up.</p>
<ul>
<li>A master name for the cluster, this IP must be available (ganeti.example.org)</li>
<li>A name for each node or Dom0 (node1.example.org)</li>
<li>A name for each instance or virtual machine (instance1.example.org)</li>
</ul>
<h2>Kernel</h2>
<p><a href="http://www.drbd.org/">DRBD</a> is optional in Ganeti so you can skip this step if you&#8217;re not planning on using it. DRBD was recently included in the mainline kernel in 2.6.33 however Gentoo&#8217;s DRBD packages do not currently reflect that. I hope to get that changed soon but for now you have two options.</p>
<ol>
<li>Install gentoo-sources, drbd, and drbd-kernel</li>
<li>Install gentoo-sources &amp; enable drbd, install drbd without deps</li>
</ol>
<p>For simplicity, I&#8217;ll describe option #2 above below. Check out the <a href="http://dokuwiki.osuosl.org/public/ganeti_cluster_gentoo">wiki page</a> for #1.</p>
<p>DRBD requires you have the following option enabled. Make sure you&#8217;ve rebooted using a kernel with these options above before you continue.</p>
<pre class="brush: plain; title: ; notranslate">
Device Drivers ---&gt;
    &lt;*&gt; Connector - unified userspace &lt;-&gt; kernelspace linker
</pre>
<p>We recommend that you keyword both <code>sys-cluster/drbd</code> and <code>sys-cluster/drbd-kernel</code> so that you pull in the latest 8.3.x version.</p>
<pre class="brush: bash; title: ; notranslate">
echo &quot;sys-cluster/drbd&quot; &gt;&gt; /etc/portage/package.keywords
echo &quot;sys-cluster/drbd-kernel&quot; &gt;&gt; /etc/portage/package.keywords
</pre>
<p>Install DRBD.</p>
<pre class="brush: bash; title: ; notranslate">emerge drbd</pre>
<p>Ganeti uses DRBD in a unique way and requires the module to be loaded with specific settings. Add the autoload settings and load the module.</p>
<pre class="brush: bash; title: ; notranslate">
echo &quot;drbd minor_count=255 usermode_helper=/bin/true&quot; &gt;&gt; /etc/modules.autoload.d/kernel-2.6
modprobe drbd
</pre>
<p>If you forget this step, you will get an error similar to the one mentioned in <a href="http://groups.google.com/group/ganeti/browse_thread/thread/b811f2ba6c898570/f22f4eda4cab62ce">this email thread</a>.</p>
<h2>Install Ganeti</h2>
<p>Set the appropriate USE flags. In this case we will be using kvm with drbd.</p>
<pre class="brush: bash; title: ; notranslate">echo &quot;app-emulation/ganeti kvm drbd&quot; &gt;&gt; /etc/portage/package.use</pre>
<p>Install Ganeti (you might need to keyword other dependencies)</p>
<pre class="brush: bash; title: ; notranslate">emerge ganeti</pre>
<h2>Configure Networking</h2>
<p>There&#8217;s currently two methods for <a href="http://ganeti-doc.googlecode.com/svn/ganeti-2.1/html/install.html#configuring-the-network">setting up networking</a>: <strong>bridged</strong> or <strong>routed.</strong> I picked the bridged method mainly because I&#8217;m familiar with the setup and it seemed to be the simplest.</p>
<p>Ideally you should have a <em>public</em> network that will be used for communicating with the nodes and instances from the outside, and a <em>backend</em> private network that will be used by ganeti for DRBD, migrations, etc. Assuming your <em>public</em> IP (which node1.example.org should resolve to) is 10.1.0.11 and your <em>backend</em> IP is 192.168.1.11, you should edit /etc/conf.d/net to look something like this:</p>
<pre class="brush: bash; title: ; notranslate">
bridge_br0=&quot;eth0&quot;
config_eth0=( &quot;null&quot; )

config_br0=( &quot;10.1.0.11 netmask 255.255.254.0&quot; )
routes_br0=( &quot;default gw 10.1.0.1&quot; )

# make sure eth0 is up before configuring br0
depend_br0() {
        need net.eth0
}

config_eth1=( &quot;192.168.1.11 netmask 255.255.255.0&quot; )
</pre>
<p>You can have a more complicated networking setup using VLAN tagging and bridging but I&#8217;ll go over that in another blog post.</p>
<h2>Set the Hostname</h2>
<p>Ganeti is picky about hostnames, and requires that the output of hostname be fully qualified. So make sure /etc/conf.d/hostname uses the FQDN and looks like this:</p>
<pre class="brush: bash; title: ; notranslate">HOSTNAME=&quot;node1.example.org&quot;</pre>
<p><strong>NOT like this:</strong></p>
<pre class="brush: bash; title: ; notranslate">HOSTNAME=&quot;node1&quot;</pre>
<h2>Configure LVM</h2>
<p>It is recommended that you edit this line in /etc/lvm/lvm.conf</p>
<pre class="brush: bash; title: ; notranslate">filter = [ &quot;r|/dev/nbd.*|&quot;, &quot;a/.*/&quot;, &quot;r|/dev/drbd[0-9]+|&quot; ]</pre>
<p>The important part is the</p>
<pre class="brush: bash; title: ; notranslate">r|/dev/drbd[0-9]+|</pre>
<p>entry, which will prevent LVM from scanning drbd devices.</p>
<p>Now, go ahead and create an LVM volume group with the disks you plan to use for instance storage. The default name that Ganeti prefers is <em>xenvg</em> but we recommend you choose something more useful for your infrastructure (we use <em>ganeti</em>).</p>
<pre class="brush: bash; title: ; notranslate">
pvcreate /dev/sda3
vgcreate ganeti /dev/sda3
</pre>
<h2>Initialize the Cluster</h2>
<p>Now we can initialize the cluster on the first node. The command below will do the following:</p>
<ul>
<li>Set br0 as the primary interface for Ganeti communication</li>
<li>Set 192.168.1.11 as the DRBD ip for the node</li>
<li>Enable KVM</li>
<li>Set the default bridged interface for instances to br0</li>
<li>Set the default KVM settings to 2 vcpus &amp; 512M RAM</li>
<li>Set the default kernel path to /boot/guest/vmlinuz-x86_64</li>
<li>Set the master DNS name is ganeti.example.org</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
gnt-cluster init --master-netdev=br0 \
  -g ganeti \
  -s 192.168.1.11 \
  --enabled-hypervisors=kvm \
  -N link=br0 \
  -B vcpus=2,memory=512M \
  -H kvm:kernel_path=/boot/guest/vmlinuz-x86_64
  ganeti.example.org
</pre>
<p>Now you have a ganeti cluster! Lets verify everything is setup correctly.</p>
<pre class="brush: bash; title: ; notranslate">
$ gnt-cluster verify
Sun May 16 22:43:00 2010 * Verifying global settings
Sun May 16 22:43:00 2010 * Gathering data (1 nodes)
Sun May 16 22:43:02 2010 * Verifying node status
Sun May 16 22:43:02 2010 * Verifying instance status
Sun May 16 22:43:02 2010 * Verifying orphan volumes
Sun May 16 22:43:02 2010 * Verifying remaining instances
Sun May 16 22:43:02 2010 * Verifying N+1 Memory redundancy
Sun May 16 22:43:02 2010 * Other Notes
Sun May 16 22:43:02 2010 * Hooks Results
</pre>
<p>Yay!</p>
<h2>SSH Keys</h2>
<p>Ganeti uses ssh to run some tasks but not for all tasks. During the initialization, it generated a new ssh key for the root user and installs it in <code>/root/.ssh/authorized_keys</code>. In our case, we manage that file with cfengine, so to work around it we copy the key as <code>/root/.ssh/authorized_keys2</code> which ssh will automatically pick up.</p>
<h2>Adding nother node</h2>
<p>To add an additional node, you duplicate the setup steps above skipping initializing the cluster. Instead run the following command:</p>
<pre class="brush: plain; title: ; notranslate">gnt-node add -s &lt;node drbd_ip&gt; &lt;node hostname&gt;</pre>
<h2>Next steps&#8230;</h2>
<p>The next steps is actually deploying new virtual machines using Ganeti. I wrote a new instance creation script called <a href="http://git.osuosl.org/?p=ganeti-instance-image.git;a=summary">ganeti-instance-image</a> which uses disk images for deployment. I&#8217;m currently working on a new project website with detailed documentation and a blog post about it as well. We&#8217;re able to deploy new virtual machines (such as Ubuntu, Centos, or Gentoo) in under 30 seconds using this method!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lancealbertson.com/2010/05/installing-ganeti-on-gentoo/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>The EeePC netbooks are awesome!</title>
		<link>http://www.lancealbertson.com/2009/02/the-eeepc-netbooks-are-awesome/</link>
		<comments>http://www.lancealbertson.com/2009/02/the-eeepc-netbooks-are-awesome/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 01:36:08 +0000</pubDate>
		<dc:creator>lance</dc:creator>
				<category><![CDATA[eeepc]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[eeepc 1000]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[netbook]]></category>

		<guid isPermaLink="false">http://test.lancealbertson.com/?p=55</guid>
		<description><![CDATA[As some of you may have noticed, I usually carry around a tiny little black laptop when I&#8217;m at Beer and Blog or at a coffee shop. Since people ask about it so much, I decided to write a few blog posts about it with this being the first. What is it? Its an EeePC [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-59" title="eeepc1000" src="http://test.lancealbertson.com/wp-content/uploads/2009/02/eeepc1000-299x300.png" alt="eeepc1000" width="246" height="246" />As some of you may have noticed, I usually carry around a tiny little black laptop when I&#8217;m at <a href="http://corvallis.beerandblog.com">Beer and Blog</a> or at a coffee shop. Since people ask about it so much, I decided to write a few blog posts about it with this being the first.</p>
<p>What is it? Its an <a href="http://eeepc.asus.com/global/product1000.html"><span><span>EeePC</span> 1000 </span></a>from <a href="http://asus.com/">ASUS</a> (the same guys that make motherboards). Its a new type of laptop that is generally referred to as a <a href="http://en.wikipedia.org/wiki/Netbook"><strong><em><span><span>netbook</span></span></em></strong></a><span> mainly because it lacks some of the features that a normal laptop has such as a <span>cdrom</span>, being heavy, a multi-core power sucking CPU, and a huge screen. Outside of that, its like any other laptop with a few other enhancements. In my case, this EeePC has these features which I love about it.</span></p>
<ul>
<li>Long battery life, claims one day computing (6+hrs)</li>
<li>Solid State Drives (<a href="http://en.wikipedia.org/wiki/Solid-state_drive">SSD</a>) &#8211; no moving parts &amp; better battery life!</li>
<li><span>Multi-touch track pad</span></li>
<li>Very usable keyboard (92% from a normal laptop)</li>
<li>Lightweight (2lbs 15oz)</li>
<li><span>Fast 1.6 <span>Ghz</span> Intel Atom processor</span></li>
<li><span>802.11n <span>Wi</span>-<span>Fi</span> and Blue-tooth</span></li>
<li><span>1.3MP web cam</span></li>
</ul>
<p><span>I&#8217;ve used my trusty 15&#8243; <span>PowerBook</span> for many years and I still use it, but its become more of a hassle to carry around with me. I&#8217;m a UNIX Admin, so I don&#8217;t need much on my laptop (xterm, Firefox, Thunderbird, and pidgin) to get work done and the <span>EeePC</span> was a perfect fit. The </span><a href="http://en.wikipedia.org/wiki/Eeepc#History">first models</a><span> that ASUS releases for the <span>EeePC</span> didn&#8217;t appeal to me since they had a screen and keyboard that was too small for me to deal with. A good friend of mine (who also has the habit of being an enabler for me :P) purchased one for himself and kept raging about it. I was actually considering getting an upgrade for my <span>PowerBook</span> but didn&#8217;t want to pay $2K for a new <span>MacBook</span>, so instead I decided to get this <span>EeePC</span> forÂ  around $500 (its down to $430 now).</span></p>
<p><span><span>Asus</span> gives you two options for Operating Systems on these laptops: Windows XP or Linux (</span><a href="http://en.wikipedia.org/wiki/Xandros"><span><span>Xandros</span></span></a>). Since I&#8217;m a <a href="http://gentoo.org">Gentoo</a> developer, I decided to give it a try on this laptop. I encountered a few issues of course, but overall I have all the hardware working. The only annoying thing so far is the wireless driver not being included in the mainline kernel, but that&#8217;s going to change soon I hope. There is an open source driver but its a little finicky to deal with on networks using any form of security passwords. But it <strong>does</strong> work!</p>
<p>In the upcoming posts, I plan to write about the following:</p>
<ul>
<li>How I installed Gentoo on it</li>
<li>Gentoo tweaks I use on it</li>
<li><span>Window management</span></li>
<li><span><span>Firefox</span> tweaks (yes, you need them!)</span></li>
<li><span>How <span>netbooks</span> are helping promote Linux to the masses</span></li>
</ul>
<p><span>I love my <span>EeePC</span> and you should get one too! :)</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lancealbertson.com/2009/02/the-eeepc-netbooks-are-awesome/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

