<?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; kvm</title>
	<atom:link href="http://www.lancealbertson.com/tag/kvm/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lancealbertson.com</link>
	<description>Musings of a UNIX SysAdmin, jazz lover, and wine/beer snob</description>
	<lastBuildDate>Thu, 10 Jun 2010 16:37:34 +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>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'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're not planning on using it. DRBD was recently included in the mainline kernel in 2.6.33 however Gentoo'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'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've rebooted using a kernel with these options above before you continue.</p>
<pre class="brush: plain;">
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;">
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;">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;">
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;">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;">emerge ganeti</pre>
<h2>Configure Networking</h2>
<p>There'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'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;">
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'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;">HOSTNAME=&quot;node1.example.org&quot;</pre>
<p><strong>NOT like this:</strong></p>
<pre class="brush: bash;">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;">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;">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;">
pvcreate /dev/sda3
lvcreate 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;">
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;">
$ 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;">gnt-node add -s &lt;node drbd_ip&gt; &lt;node hostname&gt;</pre>
<h2>Next steps...</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'm currently working on a new project website with detailed documentation and a blog post about it as well. We'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>13</slash:comments>
		</item>
		<item>
		<title>Power Outage: A true test for Ganeti</title>
		<link>http://www.lancealbertson.com/2010/05/power-outage-a-true-test-for-ganeti/</link>
		<comments>http://www.lancealbertson.com/2010/05/power-outage-a-true-test-for-ganeti/#comments</comments>
		<pubDate>Fri, 21 May 2010 00:06:09 +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>
		<category><![CDATA[power outage]]></category>

		<guid isPermaLink="false">http://www.lancealbertson.com/?p=169</guid>
		<description><![CDATA[Nothing like a power outage gone wrong to test a new virtualization cluster. Last night we lost power in most of Corvallis and our UPS &#38; Generator functioned properly in the machine room. However we had an unfortunate sequence of issues that caused some of our machines to go down, including all four of our [...]]]></description>
			<content:encoded><![CDATA[<p>Nothing like a power outage gone wrong to test a new virtualization cluster. Last night we lost power in most of Corvallis and our UPS &amp; Generator functioned properly in the machine room. However we had an unfortunate sequence of issues that caused some of our machines to go down, including all <strong>four</strong> of our ganeti nodes hosting <strong>62 virtual machines</strong> went down hard. If this had happened with our old xen cluster with iSCSI, it would have taken us over an hour to get the infrastructure back in a normal state by manually restarting each VM.</p>
<p>But when I checked the <a href="http://code.google.com/p/ganeti/">ganeti</a> cluster shortly after the outage, I noticed that all four nodes rebooted without any issues and the master node was <strong>already</strong> rebooting virtual machines <strong>automatically</strong> and fixing all of the <a href="http://www.drbd.org/">DRBD</a> block devices. Ganeti has a nice app called <strong><code>ganeti-watcher</code></strong> which is run every five minutes via cron. It has two primary functions currently (taken from <code>ganeti-watcher(8))</code>:</p>
<ol>
<li>Keep running all instances as marked (i.e. if they were running, restart them)</li>
<li>Repair DRBD links by reactivating the block devices of instances which have secondaries on nodes that have rebooted.</li>
</ol>
<p>The watcher app took around 30 minutes to bring all 62 VMs back online. The load on most of the nodes didn't go over 4 during the recovery which is quite impressive considering how much I/O its doing while VMs are booting. Normally the nodes have loads between 0.3 and 0.5. There were only 3 VMs that didn't boot cleanly because of incorrect fstab entries or incorrect kernel path settings in ganeti which was easy to fix. I was surprised we didn't have more issues like that.</p>
<p>While ganeti is bringing instances back online you can tail watcher.log which is generally at <code>/var/log/ganeti/watcher.log</code> and will show output similar to this:</p>
<pre class="brush: plain;">
2010-05-20 04:06:25,077:  pid=10202 INFO Restarting busybox.osuosl.org (Attempt #1)
2010-05-20 04:07:16,311:  pid=10202 INFO Restarting driverdev.osuosl.org (Attempt #1)
2010-05-20 04:07:18,346:  pid=10202 INFO Restarting pcc.osuosl.org (Attempt #1)
</pre>
<p>And once its finished will show output like this:</p>
<pre class="brush: plain;">
2010-05-20 04:35:04,066:  pid=22741 INFO Restart of busybox.osuosl.org succeeded
2010-05-20 04:35:04,066:  pid=22741 INFO Restart of driverdev.osuosl.org succeeded
2010-05-20 04:35:04,066:  pid=22741 INFO Restart of pcc.osuosl.org succeeded
</pre>
<p>It was great watching this system recover everything automatically with little issues and quickly. Needless to say, outages are a bad thing and its our fault that our cluster went down like this but it was great seeing this system work nearly flawlessly. We'll soon fix the power situation for our cluster so this shouldn't happen again.</p>
<p>Take that ESX ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lancealbertson.com/2010/05/power-outage-a-true-test-for-ganeti/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating a scalable virtualization cluster with Ganeti</title>
		<link>http://www.lancealbertson.com/2010/05/creating-a-scalable-virtualization-cluster-with-ganeti/</link>
		<comments>http://www.lancealbertson.com/2010/05/creating-a-scalable-virtualization-cluster-with-ganeti/#comments</comments>
		<pubDate>Sun, 16 May 2010 00:39:31 +0000</pubDate>
		<dc:creator>lance</dc:creator>
				<category><![CDATA[gentoo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[drbd]]></category>
		<category><![CDATA[ganeti]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://www.lancealbertson.com/?p=140</guid>
		<description><![CDATA[Creating a virtualization cluster that is scalable, cheap, and easy to manage usually doesn't happen in the same sentence. Generally it involves a combination of a complex set of tools tied together, expensive storage, and difficult to scale. While I think that the suite of tools that use libvirt are great and are headed in [...]]]></description>
			<content:encoded><![CDATA[<p>Creating a virtualization cluster that is scalable, cheap, and easy to manage usually doesn't happen in the same sentence. Generally it involves a combination of a complex set of tools tied together, expensive storage, and difficult to scale. While I think that the suite of tools that use <a href="http://www.libvirt.org">libvirt</a> are great and are headed in the right direction, they're still not quite the right tool for the right job in some situations. There's also commercial solutions such as <a href="http://www.vmware.com">VMWare</a> and <a href="http://www.citrix.com/English/ps2/products/product.asp?contentID=683148&amp;ntref=prod_top">Xen Server</a> that are great but both cost money (especially if you want cluster features). If you're looking for a completely open source solution, then you may have found it.</p>
<p>Enter <a href="http://code.google.com/p/ganeti/">Ganeti</a>, an open source virtualization management platform created by Google engineers. I never heard of it until one of the students that works for me at the <a href="http://osuosl.org">OSUOSL</a> mentioned it while he was being an intern at Google. The design and goal of Ganeti is to create a virtualization cluster that is stable, easy to use, and doesn't require expensive hardware.</p>
<p>So what makes it so awesome?</p>
<ul>
<li>A master node controls all instances (virtual machines)</li>
<li>Built-in support for <a href="http://en.wikipedia.org/wiki/DRBD">DRBD</a> backed storage on all instances</li>
<li>Automated instance (virtual machine) deployment</li>
<li>Simple management tools all written in easy to read python</li>
<li>Responsive and helpful developer community</li>
<li>Works with both Xen and <a href="http://www.linux-kvm.org/page/Main_Page">KVM</a></li>
</ul>
<h2>DRBD</h2>
<p>The key feature that got me interested was the built-in DRBD support which enables us to have a "poor man's" SAN using local server storage. DRBD is essentially like having RAID1 over the network between two servers. It duplicates data between two block devices and keeps them in sync. Until recently, DRBD had to be built as an externel kernel module, but it was recently added to the mainline kernel in 2.6.33. Ganeti has a seamless DRBD integration and requires you to have little knowledge in the specific details of setting it up.</p>
<h2>Centralized Instance Management</h2>
<p>Before Ganeti, we had to look up which node an instance was located and it was difficult to see the whole cluster's state as a whole. During a crisis we would lose valuable time trying to locate a virtual machine, especially if it had been moved because of a hardware failure. Ganeti sets one node as a master and controls the other nodes via remote ssh commands and a restful API. You can switch which node is the master with one simple command and also recover a master node if it went offline. All ganeti commands must run on the master node.</p>
<p>Ganeti currently uses command line based interactions for all management tasks. However, it would not be difficult to create a web frontend to manage it. The OSUOSL actually has a working prototype of a django based web frontend that we'll eventually release once its out of alpha testing.</p>
<h2>Automated Deployment</h2>
<p>Ganeti uses a set of bash scripts to create an instance on the fly. Each of these scripts is considered an OS definition and they include a debootstrap package by default. Since we use several different distributions, I decided to write my own OS definition using file system dumps instead of direct OS install scripts. This reduced the deployment time considerably to the point where we can deploy a new virtual machine in 30 seconds (not counting DRBD sync time). You can optionally use scripts to setup grub, serial, and networking during the deployment.</p>
<h2>Developer Community</h2>
<p>The developer community surrounding Ganeti is still quite small but they are very helpful and responsive. I've sent in several feature and bug requests on their tracker and usually have a response within 24hrs and even a committed patch withing 48 hours. The end users on the mailing lists are quite helpful and usually response quickly as well. Nothing is more important to me in a project than the health and responsiveness of the community.</p>
<h2>OSUOSL use of Ganeti</h2>
<p>We recently migrated all of our virtual machines to Ganeti using KVM from Xen. We went from using a 14 blade servers and 3 disk nodes to 4 1U servers with faster processors, disks, and RAM. We instantly noticed a 2 to 3 times performance boost in I/O and CPU. A part of boost was the change in the backend storage, another is KVM.</p>
<p>We currently host around 60 virtual machines total (~15 per node) and can host up to 90 VMS with our current hardware configuration. Adding an additional node is a simple task and takes only minutes once all the software is installed. The new server doesn't need to have the exact same specs however I would recommend using at least have similar types and speeds of disks and CPUs.</p>
<h2>Summary</h2>
<p>Ganeti is still young but has matured very quickly over the last year or so. It may not be the best solution for everyone but it seems to fit quite well at the OSUOSL. I'll be writing several posts that cover the basics of installing and using Ganeti. Additionally I'll cover some of the specific steps we took to deploy our cluster.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lancealbertson.com/2010/05/creating-a-scalable-virtualization-cluster-with-ganeti/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Upcoming Talks</title>
		<link>http://www.lancealbertson.com/2010/05/upcoming-talks/</link>
		<comments>http://www.lancealbertson.com/2010/05/upcoming-talks/#comments</comments>
		<pubDate>Tue, 11 May 2010 05:16:36 +0000</pubDate>
		<dc:creator>lance</dc:creator>
				<category><![CDATA[gentoo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[conferences]]></category>
		<category><![CDATA[ganeti]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://www.lancealbertson.com/?p=114</guid>
		<description><![CDATA[I'm going to be speaking at several open source conferences this summer. Most of my talks will be centered around a virtualization management tool called Ganeti. I plan to write several blog posts in the coming weeks going over Ganeti in preparation to my talk at Open Source Bridge.
Here's the list of conferences I will be [...]]]></description>
			<content:encoded><![CDATA[<p>I'm going to be speaking at several open source conferences this summer. Most of my talks will be centered around a virtualization management tool called <a href="http://code.google.com/p/ganeti/">Ganeti</a>. I plan to write several blog posts in the coming weeks going over Ganeti in preparation to my talk at <a href="http://opensourcebridge.org">Open Source Bridge</a>.</p>
<p>Here's the list of conferences I will be speaking at:</p>

<table id="wp-table-reloaded-id-1-no-1" class="wp-table-reloaded wp-table-reloaded-id-1">
<tbody class="row-hover">
	<tr class="row-1 odd">
		<td class="column-1">When</td><td class="column-2">Conference</td><td class="column-3">Where</td><td class="column-4">Talk Title</td><td class="column-5">Slides</td>
	</tr>
	<tr class="row-2 even">
		<td class="column-1">June 1-4, 2010</td><td class="column-2"><a href="http://opensourcebridge.org">Open Source Bridge</a></td><td class="column-3">Portland, OR</td><td class="column-4"><a href="http://opensourcebridge.org/sessions/368">Creating a low-cost clustered virtualization environment using Ganeti</a></td><td class="column-5"><a href=http://lancealbertson.com/slides/ganeti-osb10/>ganeti-osb10</a></td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">July 19-23, 2010</td><td class="column-2"><a href="http://www.oscon.com/oscon2010">OSCON</a></td><td class="column-3">Portland, OR</td><td class="column-4"><a href="http://www.oscon.com/oscon2010/public/schedule/detail/13789">Scaling your Open-Source Project Infrastructure on a Shoestring (panel)</a></td><td class="column-5"></td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">August 10-12, 2010</td><td class="column-2"><a href="http://events.linuxfoundation.org/events/linuxcon/schedule">LinuxCon</a></td><td class="column-3">Boston, MA</td><td class="column-4"><a href="http://events.linuxfoundation.org/linuxcon2010/albertson">Creating a low-cost clustered virtualization environment using Ganeti</a></td><td class="column-5"></td>
	</tr>
</tbody>
</table>

<p>Let me know if you will be attending any of these conferences so we can hang out!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lancealbertson.com/2010/05/upcoming-talks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a simple progress bar to dd</title>
		<link>http://www.lancealbertson.com/2009/04/adding-a-simple-progress-bar-to-dd/</link>
		<comments>http://www.lancealbertson.com/2009/04/adding-a-simple-progress-bar-to-dd/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 05:35:27 +0000</pubDate>
		<dc:creator>lance</dc:creator>
				<category><![CDATA[gentoo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[bar]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[migration]]></category>

		<guid isPermaLink="false">http://test.lancealbertson.com/?p=93</guid>
		<description><![CDATA[I recently ran into an issue where I wanted to move several KVM based virtual machines from one server to another server. There's several ways you can accomplish this depending on what you want to do. In my case I was using LVM for the disk backend, so simply copying the disk image files wasn't [...]]]></description>
			<content:encoded><![CDATA[<p>I recently ran into an issue where I wanted to move several <a href="http://www.linux-kvm.org/page/Main_Page">KVM</a> based virtual machines from one server to another server. There's several ways you can accomplish this depending on what you want to do. In my case I was using <a href="http://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)">LVM</a> for the disk backend, so simply copying the disk image files wasn't an option. It boiled down to two basic options.</p>
<ul>
<li>Put system in single-user mode, rsync the contents over, and reinstall grub</li>
<li>Use dd and copy the whole LVM volume over piped through ssh</li>
</ul>
<p>The advantage using the rsync method is that you're only copying the files you need over, thus less data transfer happens. But then you run into needing to re-run grub (which generally isn't a problem). In addition, if you're using LVM within the LVM volume for the VM and the volume group is named the same, you run into some interesting issues. The advantage for using <strong>dd</strong> is that you can get a literal copy of the disk image and just start the VM back up without any other steps. Of course, this will only work if the volumes are the same on both ends.</p>
<p>So I decided to go with dd but ran into a problem of seeing the progress of a 15G volume copy. I did some digging around and found a <a href="http://fosswire.com/post/2007/8/command-line-progress-bar-a-progress-bar-for-dd/">blog post</a> that mentioned using a command line application called '<a href="http://clpbar.sourceforge.net/">bar</a>' so I decided to give it a shot! Its a fairly simple application that just creates a basic progress bar based on the data being piped into it. If you're running Gentoo, the package is called <strong>app-admin/bar</strong>.</p>
<p>Here's the command I ended up running:</p>
<pre class="brush: bash;">
$ dd if=/dev/lvm/cholula-disk | bar -s 15g | \
    ssh -c arcfour $host &quot;dd of=/dev/lvm/cholula-disk&quot;</pre>
<p>When ran, it gives you output similar to:</p>
<pre class="brush: bash;">
6.0GB at   17.9MB/s  eta:   0:08:32   40 [=========================                 ]
</pre>
<p>The downside is that you need to specify the block device size before hand, but for something simple like this its quite nice. Of course I could just use one of the many dd forks out there which include progress bars but this is quick, dirty, and simple!</p>
<p>I used the arcfour cipher mainly to reduce the CPU overhead and increase the throughput, but you should probably never use this cipher on an untrusted network as it does have weaknesses. I didn't try doing throughput tests on other ciphers, but it would be interesting. It took me approximately 10-12 minutes to copy a 15G volume over a gigabit network which isn't too bad.</p>
<p>Another trick you can do is utilitize the LVM snapshot feature and create a snapshot of the running volume. If any data changes on the volume, it won't be copied over obviously, but it will at least let you do a cold "live" migration of sorts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lancealbertson.com/2009/04/adding-a-simple-progress-bar-to-dd/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
