<?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>That Chris Brown's Blog &#187; kvm</title>
	<atom:link href="http://www.thatchrisbrown.com/tag/kvm/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thatchrisbrown.com</link>
	<description>Another Chris Brown &#38; another blog</description>
	<lastBuildDate>Sat, 03 Apr 2010 13:05:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Xen vs KVM &#8211; horses for courses?</title>
		<link>http://www.thatchrisbrown.com/2009/xen-vs-kvm-horses-for-courses/</link>
		<comments>http://www.thatchrisbrown.com/2009/xen-vs-kvm-horses-for-courses/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 12:04:14 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[virtualisation]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://m.thatchrisbrown.com/?p=133</guid>
		<description><![CDATA[
			
				
			
		
<p>As anyone who&#8217;s read any of my previous posts will know, I&#8217;ve been considering Red Hat&#8217;s adoption of KVM over Xen and wondering if a move to KVM is the right thing to do.</p>
<p>I think &#8220;The right thing&#8221; depends a fair bit on where you are, and what your requirements are.  Obvious? Perhaps, but [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fxen-vs-kvm-horses-for-courses%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fxen-vs-kvm-horses-for-courses%2F&amp;source=thatchrisbrown&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>As anyone who&#8217;s read any of my previous posts will know, I&#8217;ve been considering Red Hat&#8217;s adoption of KVM over Xen and wondering if a move to KVM is the right thing to do.</p>
<p>I think &#8220;The right thing&#8221; depends a fair bit on where you are, and what your requirements are.  Obvious? Perhaps, but then sometimes it&#8217;s the obvious things we overlook.</p>
<p>I think there&#8217;s no pressing need to migrate my hosted server.  It works pretty well on Xen and now I&#8217;ve sorted out my mess of repo priorities, and I&#8217;m a bit less cavalier with updates, I don&#8217;t expect it to present me any significant problems.</p>
<p>My home server is a different thing.  It&#8217;s not currently commissioned so there&#8217;s no downtime to worry about, I&#8217;d like to be able to run PVM and HVM Windows and Linux guests, including possibly LinuxMCE one day, and carrying most weight for me at present, it&#8217;s going to also be my network gateway.</p>
<p>Now, purists might not think running VM services on my gateway is a smart idea, and I should put in a separate host for each, but it&#8217;s a model I&#8217;d like to try out as I have some work project ideas that might benefit.</p>
<p>My thinking is that if I&#8217;m doing security policy, NAT, bandwidth shaping and VPN on a machine that also runs guests, KVM might make sense &#8211; doing that work in a Xen dom0 would involve a bit more switching of network data in and out of the Hypervisor and guests. In theory, Linux being the hypervisor should mean it&#8217;s only doing that for network traffic to guests, which will only be anything I can&#8217;t sensibly run in the base Linux OS.</p>
<p>There may be some argument that my hosted server may benefit too, as in a bonded setup, the current state of Xen networking seems to suggest that the dom0 has to do all the work anyway &#8211; I have my dom0 using regular Linux networking (patched to fix an issue bridging a bonded interface) to get my guests on a bridge to a fully bonded interface.</p>
<p>KVM will be an interesting experience to compare with Xen. If the networking is faster, as long as performance of guests is good, it may make sense to choose it ultimately because Red Hat have, and out-of-the-box compatability is no bad thing.</p>
<p>For now, I&#8217;m happy to keep my hosted workhorse on Xen and try the new contender out on a home server first.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thatchrisbrown.com/2009/xen-vs-kvm-horses-for-courses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LVM saves the day, possibly&#8230;</title>
		<link>http://www.thatchrisbrown.com/2009/lvm-saves-the-day-possibly/</link>
		<comments>http://www.thatchrisbrown.com/2009/lvm-saves-the-day-possibly/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 18:53:42 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[virtualisation]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://www.thatchrisbrown.com/?p=112</guid>
		<description><![CDATA[Using LVM for Xen guests virtual disks might have made KVM migration easier than I first [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Flvm-saves-the-day-possibly%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Flvm-saves-the-day-possibly%2F&amp;source=thatchrisbrown&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>OK, so I&#8217;m mulling the move from <a href="http://www.thatchrisbrown.com/2009/in-theory-migrating-from-xen-to-kvm-under-centos-5-3/" target="_blank">Xen to KVM</a>.  This initially looked like I&#8217;d have to make duplicate virtual disks in KVM for my Xen guests, then shut the guests down, block copy content across and patch up MBR and boot my physical box into a stock kernel and hope KVM comes up with the goods.</p>
<p>Well, a little bit of experimentation with a rarely-used VM and I&#8217;ve found much to my joy that because I used LVM logical volumes to create my Xen guests virtual disks, I can use kpartx to add device mapping for them and (when the guest is safely shut down!) mount them up in my dom0 and read/write to them.  Thi sis good news because it means they have a full virtual disk setup, with a /boot partition, a root partition and a swap partition all living in a single logical volume.  This means KVM should pick them straight up and work with them unmodified.</p>
<p>Which hopefully means all I have to do is set a stock kernel to be the boot default in my guests, shut them down, set my dom0 to boot from a stock kernel, load up the KVM kernel module and add some guests from the logical volumes.</p>
<p>If it&#8217;s that easy, I&#8217;ll be a happy person indeed!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thatchrisbrown.com/2009/lvm-saves-the-day-possibly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In theory &#8211; migrating from Xen to KVM under CentOS 5.3</title>
		<link>http://www.thatchrisbrown.com/2009/in-theory-migrating-from-xen-to-kvm-under-centos-5-3/</link>
		<comments>http://www.thatchrisbrown.com/2009/in-theory-migrating-from-xen-to-kvm-under-centos-5-3/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 14:56:59 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[virtualisation]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://www.thatchrisbrown.com/?p=107</guid>
		<description><![CDATA[I'm advance planning my migration of live services from Xen VMs to KVM VMs on the same physical box, with as little downtime as [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fin-theory-migrating-from-xen-to-kvm-under-centos-5-3%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.thatchrisbrown.com%2F2009%2Fin-theory-migrating-from-xen-to-kvm-under-centos-5-3%2F&amp;source=thatchrisbrown&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I have a CentOS 5.3 (actually a CentOS 5.2 build upgraded in yum, but that&#8217;s not terribly important) x86_64 machine that is in fact a Xen hypervisor kernel with said CentOS 5.3 running as the dom0 (service VM), and currently four guest VMs also running CentOS 5.2 x86_64, upgraded to CentOS 5.3 with yum.  This was a kind of interesting project in itself, in that I used the Gitco repos in order to get Xen 3.3.1 on the CentOS build, and I had to do some hackery of the Xen and stock CentOS networking scripts to make things work.  The box doesn&#8217;t use Xen network scripts and xenbr0, because they broke pretty badly with bonded dual NICs.  It has a fairly standard Ethernet bond setup going, then a patched RH network script so bridges don&#8217;t init before the bond, a standard Linux bridge br0, which all my Xen vifs attach to, and a virbr0 which doesn&#8217;t have any physical NICs attached, but does have an IP address and dhcpd running against it, so I have a place to quickly fire up new VM guests without having to assign network addresses.</p>
<p>This complexity lead to a few problems, partly during installation, when I ended up temporarily having to go wiht a non-Xen kernel in order to update bits and ipeces and set up repos so I could go back to a Xen kernel, and when yum wanted to update to kernel-xen-2.6.18-128.1.10.el5 and like a trusting fool I let it, and promptly had no running VMs on the next reboot.  Hacking grub back to 2.6.18-128.1.6.el5xen seemed to sort it, and it never got changed from there.</p>
<p>Actually, to tell the trust, I also have another machine built a similar way, <em>sans</em> CentOS 5.3 upgrade.  This one was meant to potentially be a home to a windows machine, or most likely a Linux MCE installation running in  a non-PV guest.  That one didn&#8217;t get installed yet, and has been sitting under my desk for many a month, waiting for cabling.  Oops.</p>
<p>My guest DomUs are living in Xen virtual disks which are inside LVM logical volumes as far as the dom0 is concerned.  If I&#8217;d been smarter, I might have set up three LVs for each domU &#8211; one for /boot, one swap and one for /, so that I cold more easily manage them from not only the guest domU, but also the dom0 if the domU was offline for any reason.</p>
<p>The increased exposure KVM is getting in RHEL 5.4 is making me wonder if all this Xen tinkering is worth it.  My machine only runs Linux guests, and then only really for a bit of process separation security.  Given that the dom0 has to do a bit of service work for guest domUs anyway, and it seems that this involves a bit of context switching overhead, I don&#8217;t see that doing the hypervisor function in the kernel is going to be a problem for me, especially on that currently unused box, which is going to be a home all-in-one media, file/print, NATting, caching and bandwidth arbitrating machine.  As I was going to just accept doing all the networking for that (including the firewall/NAT/bandwidth and some VPN stuff) in the dom0 instead of making the Xen networking even more complicated with dual virtual NICs and a virtual firewall box, I guess just making all that work in plain old Linux and then loading up a kernel module when I want a media centre guest VM (yes, I know I could just be less lazy and make all the bits of Linux MCE work under CentOS natively, but starting a VM and installing an OS-up image for LMCE seems like a good thing) installing makes a bit of sense.</p>
<p>The currently unused machine isn&#8217;t so bad &#8211; as it currently has no VMs and didn&#8217;t get the 5.2/5.3/Gitco hybrid horror treatment, I could just strip Gitco repo, group uninstall Virtualisation (sorry Virtuali<strong>z</strong>ation), and boot it as a regular Linux kernel, do the networkingy bits (and make better use of my rather rubbish 1.5Mb/s of patchy ADSL) and then worry about that media server when the time is right.  The dual-NIC networkign will be far easier &#8211; one outside one inside, attach a separate bridge to each and I could then attach VMs to the &#8220;public&#8221; or &#8220;private&#8221; bridges and the host OS will iptables them like any other hosts.  Great!</p>
<p>It&#8217;s that first server that is going to be &#8216;interesting&#8217;.  Fedora&#8217;s virt-v2v is a ways off yet, so I&#8217;ve got to think of smart ways of moving painlessly from Xen to KVM without losing services for long.  The current outline plan goes something like:</p>
<ol>
<li>Install a plain old Linux kernel into each VM guest</li>
<li>Install a plain old Linux kernel into the current dom0</li>
<li>Make new LVM logical volumes for guest VMs &#8211; <em>possibly three each for /boot, swap and /</em></li>
<li>Modify guest VM grub config to default the plain old Linux kernel</li>
<li>Shutdown guest VMs</li>
<li>Reboot dom0 as a plain old Linux kernel, albeit with KVM support loaded</li>
<li>Make any networking changes required</li>
<li>Create new KVM virtual machine images in the logival volumes</li>
<li>Stop the new KVM guests</li>
<li>Mount guests Xen virtual &#8216;disks&#8217; (actually just some partitions I think, not full bootable disk images) on loopback in the dom0</li>
<li>dd the contents of the Xen partitions into the new LVM logical volumes, overwriting the guest images created at step 7</li>
<li>Start the KVM guests</li>
<li>Panic when it goes wrong (had to be step 13, didn&#8217;t it?)</li>
</ol>
<p>I&#8217;m hoping that the fact I already do the networking outside of Xen, and just use standard Linux bridging on and the libvirt virbr0, will mean a slightly easier migration &#8211; all I have to do is get my instances booting off a standard kernel instead of a Xenified one, and inside a different virtual disk format.</p>
<p>I&#8217;ll still need my standard-breaking networking patch to enable bonds before bridges though.  Hopefully RH fix that one in RHEL 5.4 so CentOS picks it up in the next release.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thatchrisbrown.com/2009/in-theory-migrating-from-xen-to-kvm-under-centos-5-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
