<?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>Daniel P. Berrangé &#187; Uncategorized</title>
	<atom:link href="http://berrange.com/topics/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://berrange.com</link>
	<description>Writing about photography, open source software, virtualization &#38; more</description>
	<lastBuildDate>Sun, 04 Jul 2010 16:59:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adventures in migrating from static website + Blogger SFTP to Wordpress</title>
		<link>http://berrange.com/posts/2010/02/14/adventures-in-migrating-from-static-website-blogger-sftp-to-wordpress/</link>
		<comments>http://berrange.com/posts/2010/02/14/adventures-in-migrating-from-static-website-blogger-sftp-to-wordpress/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 12:50:49 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://berrange.com/?p=262</guid>
		<description><![CDATA[For many years now my main website has consisted of a set of statically generated webpages providing the overall structure. A couple of areas, notably my main blog were then dynamically generated using Blogger. The reason I started using Blogger was that it has the ability to publish posts directly to my webserver using SSH/SFTP, [...]]]></description>
			<content:encoded><![CDATA[<p>For many years now my main website has consisted of a set of statically generated webpages providing the overall structure. A couple of areas, notably my main blog were then dynamically generated using <a href="http://blogger.com">Blogger</a>. The reason I started using Blogger was that it has the ability to publish posts directly to my webserver using SSH/SFTP, thus allowing the dynamic parts of the site to seemlessly integrate with the static parts. Then a couple of weeks ago, Blogger announced that they were <a href="http://blogger-ftp.blogspot.com/2010/01/deprecating-ftp.html">discontinuing support</a> for SFTP publishing on March 26th. Needless to say, this rather ruined my website publishing architecture. After thinking about things for a couple of weeks though, I decided this decision of Blogger&#8217;s is a blessing in disguise, because the way I managed website was completely outdated &amp; needed to be brought into modern world.</p>
<p>What I in fact needed for a very simple content management system, that allowed publishing a small number of &#8217;static&#8217; pages on site, but with the majority of the content being blog postings. Categorization, tagging &amp; external links would be desirable too. Of course it has to be open source software too, capable of running on both my <a href="http://debian.org">Debian</a> Lenny webserver &amp; <a href="http://fedoraproject.org">Fedora</a> laptop. As many people are no doubt aware, this is exactly what <a href="http://wordpress.org">Wordpress</a> provides. As a proof of concept I downloaded the latest Wordpress, tried out the install process on my laptop &amp; generally got a feel for its admin capabilities. It all looked perfect, so that was a good decision made.</p>
<h2>Exporting content from Blogger</h2>
<p>Over the years that I&#8217;ve been using Blogger, I&#8217;ve written a few hundred postings, many worthless trash, but a fair number of them have really useful &amp; frequently visited content. My recent series of articles on <a href="http://libvirt.org">libvirt</a> features have been particularly popular. It is absolutely non-negotiable that all existing links to these postings continue to work &amp; don&#8217;t all end up broken. So the first step of the migration was to figure out how to export the content from Blogger into Wordpress. The first thing I tried was Wordpress&#8217; own built-in import tool that can allegedly talk directly to Blogger and pull down all the postings &amp; comments. The first problem I found with this, is that it only works if your content was hosted on Blogger. ie if you were using SFTP publishing it always reports &#8216;0 posts&#8217;. I temporarily update my blog settings to turn off SFTP and it at least detected all the posts at that point. I started the import process &amp; it imported 3 posts and 70 comments and then gave up with no indication of what&#8217;s wrong. Tried again, and the same thing happened. Searching the Wordpress forums it seems many people have hit this problem over the past 2 years with no reliable solution yet available.</p>
<p>Then I investigated whether Blogger had its own export capabilities. It does. It can export all your blog posts and comments in a single XML file. Unfortunately there is no apparent standard XML schema for blog import/export so there didn&#8217;t seem to be much use for this export capability &amp; I didn&#8217;t fancy writing my own XSL transform to convert it to Wordpress&#8217; native XML import schema. The nice thing about Blogger and Wordpress being so widely used on the web, is that if you have a problem, then the chances are that someone else has had the same problem already. In fact so many people have had this problem, that someone&#8217;s already written an tool to solve this, <a href="http://code.google.com/p/google-blog-converters-appengine/">Google Blog Convertors</a></p>
<p>I tried downloaded it, fed it the Blogger exports and it generated some nice looking Wordpress XML files. A closer look revealed one tiny flaw &#8211; it had unescaped a whole bunch of HTML tags in blog posts where I had been including snippets of example XML or HTML inside &lt;pre&gt; tags. Fortunately the code is all python and it was easy to find the bogus line of code &#8220;<code>content = unescape(text)</code>&#8221; and replace it with just &#8220;<code>content = text</code>&#8220;. After that the files imported into Wordpress perfectly, preserving all formatting and comments.</p>
<h2>Setting up URL redirects</h2>
<p>Even though Wordpress has a nice friendly URL scheme for articles based on their title, it is very slightly different from the scheme Blogger used for URLs. I was also merging several separate Blogger feeds into one, since Wordpress has a nice categorization capability. It was thus inevitable that the URLs for all existing posts would have to change. The solution to this problem was pretty straightforward. Apache&#8217;s mod_rewrite engine can be told to load external files containing arbitrary key, value mappings, and then reference these maps in rewrite rules. It was a simple, albeit slightly tedious, process to write a map file that contained the old Blogger URL as the key and the new Wordpress URL as the value. As an example, a tiny part of the map I created looks like this</p>
<pre>/diary/2008/04/presentation-is-everything /posts/2008/04/21/presentation-is-everything
/diary/2008/06/red-hat-summit-2008 /posts/2008/06/18/red-hat-summit-2008
/diary/2009/12/using-qcow2-disk-encryption-with /posts/2009/12/02/using-qcow2-disk-encryption-with-libvirt-in-fedora-12</pre>
<p>To make use of this map, just requires two rules in the httpd.conf file, one to load the map and the other to add a match for it. Those rules look like this</p>
<pre>RewriteMap blogger txt:/etc/apache2/blogger-rewrite.txt
RewriteRule ^/personal(/diary/.*) ${blogger:$1} [L,R=permanent]</pre>
<p>In summary, while the migration process from Blogger to Wordpress was not entirely smooth, it went alot better than I expected it to. Any web user following an old link to a post on my site now gets a <strong>permanent</strong> redirect to the new location, so no important links were broken during the migration. The new site I have is soo much more flexible than the old one &amp; the Wordpress UI is  very much nicer to use. Blogger&#8217;s UI is rather dated &amp; not really on a par with the standard of Google&#8217;s other popular apps like GMail.</p>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2010/02/14/adventures-in-migrating-from-static-website-blogger-sftp-to-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Red Hat Summit 2008</title>
		<link>http://berrange.com/posts/2008/06/18/red-hat-summit-2008/</link>
		<comments>http://berrange.com/posts/2008/06/18/red-hat-summit-2008/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 20:23:00 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wordpress.berrange.com/?p=18</guid>
		<description><![CDATA[
Just finished my talk at the Red Hat Summit on libvirt and virtualization tools. For those who are interested, the I&#8217;ve now posted the slides online.
]]></description>
			<content:encoded><![CDATA[<p>
Just finished my talk at the <a href="http://redhat.com/summit/">Red Hat Summit</a> on libvirt and virtualization tools. For those who are interested, the I&#8217;ve now posted <a href="http://people.redhat.com/berrange/summit-2008/">the slides</a> online.</p>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2008/06/18/red-hat-summit-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Presentation is everything</title>
		<link>http://berrange.com/posts/2008/04/21/presentation-is-everything/</link>
		<comments>http://berrange.com/posts/2008/04/21/presentation-is-everything/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 17:22:00 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wordpress.berrange.com/?p=21</guid>
		<description><![CDATA[
CNet are running an article with a nice scary sounding headline


&#8220;Free Open Source Software Is Costing Vendors $60 Billion&#8221;


Pretty clearly trying to imply that open source software is a threat to the entire existence of the software industry. Don&#8217;t fall for such FUD. Just look at the headline from the other side of the fence


&#8220;Free [...]]]></description>
			<content:encoded><![CDATA[<p>
CNet are running an article with a nice <a href="http://www.cnet.com/8301-13846_1-9920202-62.html">scary sounding headline</a>
</p>
<blockquote><p>
<strong>&#8220;Free Open Source Software Is Costing Vendors $60 Billion&#8221;</strong>
</p></blockquote>
<p>
Pretty clearly trying to imply that open source software is a threat to the entire existence of the software industry. Don&#8217;t fall for such FUD. Just look at the headline from the other side of the fence
</p>
<blockquote><p>
<strong>&#8220;Free Open Source Software Is Saving Customers $60 Billion&#8221;</strong>
</p></blockquote>
<p>
Not nearly so scary sounding now. In fact it is probably quite appealing.
</p>
<p>
On the one hand, you have a small number of large software companies sitting on their monopolies and extorting cash through licensing fees. On the other hand, you have hundreds of thousands of companies saving money by using open source software, paying for services with tangible value for their business, rather than an arbitrary software &#8220;tax&#8221; (license fee). Open source software benefits the many, at the expense of the few. A worthy trade-off.</p>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2008/04/21/presentation-is-everything/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dilbert + flash: epic fail</title>
		<link>http://berrange.com/posts/2008/04/18/dilbert-flash-epic-fail/</link>
		<comments>http://berrange.com/posts/2008/04/18/dilbert-flash-epic-fail/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 14:48:00 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wordpress.berrange.com/?p=22</guid>
		<description><![CDATA[
For some incomprehensible reason it has been decided that presenting Dilbert cartoon strips as a plain old image isn&#8217;t sexy enough. You now need a flash plugin to display the same old static image as before. Seriously, WTF.COM ?


The only positive, is that there is a now an RSS feed for the strips, which does [...]]]></description>
			<content:encoded><![CDATA[<p>
For some incomprehensible reason it has been decided that presenting <a href="http://dilbert.com/">Dilbert</a> cartoon strips as a plain old image isn&#8217;t sexy enough. You now need a flash plugin to display the same old static image as before. Seriously, WTF.COM ?
</p>
<p>
The only positive, is that there is a now <a href="http://feeds.feedburner.com/DilbertDailyStrip">an RSS feed</a> for the strips, which does have the static images inline to the feed. So now I can avoid the nauseating website completely and just read the strips from the comfort of <a href="http://liferea.sourceforge.net/">LiFeRea</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2008/04/18/dilbert-flash-epic-fail/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The answer is not 42</title>
		<link>http://berrange.com/posts/2008/03/20/the-answer-is-not-42/</link>
		<comments>http://berrange.com/posts/2008/03/20/the-answer-is-not-42/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 01:43:00 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wordpress.berrange.com/?p=24</guid>
		<description><![CDATA[
The question is..


How long should police/security services be allowed to hold a suspect prior to charging them with an offense?


In the USA the answer to this question is 2 days; In Russia it is 5 days; In France it is 6 days; In the UK the answer is already an astonishing 28 days. No other [...]]]></description>
			<content:encoded><![CDATA[<p>
The question is..</p>
<blockquote>
<p>
<em>How long should police/security services be allowed to hold a suspect prior to charging them with an offense?</em></p>
</blockquote>
<p>
In the USA the answer to this question is <em>2 days</em>; In Russia it is <em>5 days</em>; In France it is <em>6 days</em>; In the UK the answer is <strong>already an astonishing 28 days</strong>. <a href="http://www.liberty-human-rights.org.uk/issues/pdfs/comparative-law-exec-summary.pdf">No other democracy comes close</a>. And yet the government&#8217;s latest &#8220;anti-terror&#8221; legistation (which will get a second reading in the commons on April 1st ,with a vote to follow after the May local elections), proposes to extend <strong>this period of pre-charge detention to 42 days</strong>.
</p>
<p>
The idea that someone can be held by Police for as long as 42 days, potentially without being told of the grounds for suspicion, let alone be charged with an offence, is an idea that should remain the province of Kafka and his book <a href="http://www.gutenberg.org/etext/7849">&#8220;The Trial&#8221;</a>. The Judiciary serves the key role in English law providing the counter-balance to the state, allowing independent oversight and review of prosecution. Yet until you are charged with an offense there are no grounds for the Judiciary to intervene. You cannot defend yourself when there is no charge against which to defend.
</p>
<blockquote><p>
&#8230;the first impression made by the defence will often determine the whole course of the proceedings.  Unfortunately, though, he would still have to make it clear to K. that the first documents submitted are sometimes not even read by the court.</p>
<p>if the court deems it necessary it can be made public but there is no law that says it has to be.  As a result, the accused and his defence don&#8217;t have<br />
access even to the court records, and especially not to the indictment, and that means we generally don&#8217;t know &#8211; or at least not precisely &#8211; what the first documents need to be about, which means that if they do contain anything of relevance to the case it&#8217;s only by a lucky coincidence.  If anything about the individual charges and the reasons for them comes out clearly or can be guessed at while the accused is being questioned, then it&#8217;s possible to work out and submit documents that really direct the issue and present proof, but not before. Conditions like this, of course, place the defence in a very unfavourable and difficult position.  But that is what they intend.  In fact, defence is not really allowed under the law, it&#8217;s only tolerated, and there is even some dispute about whether the relevant parts of the law imply even that.  So strictly speaking, there is no such thing as a counsel acknowledged by the court, and anyone who comes before this court as counsel is basically no more than a barrack room lawyer. The effect of all this, of course, is to remove the dignity of the whole procedure,
</p></blockquote>
<p>
This is an extract from &#8220;The Trial&#8221; yet disturbingly close to what can happen in the UK should the government continue to extend pre-charge detention during which time the (yet to be) accused is allowed no meaningful defense.
</p>
<blockquote><p>
<em>What is the motivation of the government in extending this pre-charge period ?</em>
</p></blockquote>
<p>
The posited need is to allow more time to investigate &#8220;terrorism&#8221; cases. There is little-to-no evidence that the current limit of 28 days is harming such investigations, and members of the security services, police and judiciary have either directly questioned whether an extension would have any tangible benefit in terror investigations, or failed to provide any supporting evidence for the extension.<br />
Furthermore, <strong>there are viable alternatives</strong> to this proposal which extend the powers relating to terrorism investigations. As part of the <a href="http://liberty-human-rights.org.uk/issues/2-terrorism/extension-of-pre-charge-detention/index.shtml">Charge or Release</a> campaign, <a href="http://liberty-human-rights.org.uk/">Liberty Human Rights</a> have suggested &amp; support a number of alternative powers:
</p>
<blockquote style="padding-left: 3em">
<ul>
<li>Remove the bar on the use of intercept (phone tap) evidence because its inadmissibility is a major factor in being unable to bring charges in terror cases. Liberty welcomes the Government’s proposed Privy Council review into the use of this evidence in terror trials.
</li>
<li>Allow post-charge questioning in terror cases, provided that the initial charge is legitimate and there is judicial oversight. This will allow for a charge to be replaced with a more appropriate offense at a later stage.
</li>
<li>Hire more interpreters: Prioritise the hiring of more foreign language interpreters to expedite pre-charge questioning and other procedures.
</li>
<li>Add resources: More resources for police and intelligence services.
</li>
<li>Emergency measures in the Civil Contingencies Act 2004 could be triggered in a genuine emergency in which the police are overwhelmed by multiple terror plots, allowing the Government to temporarily extend pre-charge detention subject to Parliamentary and judicial oversight. Liberty believes that this is preferable to creating a permanent state of emergency.
</li>
</ul>
</blockquote>
<p>
Crucially these proposals do not undermine the foundations of our justice system.
</p>
<blockquote><p>
<em>What can you do about it?</em>
</p></blockquote>
<ul>
<li><a href="http://www.liberty-human-rights.org.uk/issues/2-terrorism/extension-of-pre-charge-detention/what-you-can-do.shtml">Support the Charge or Release</a> campaign.
</li>
<li><a href="http://www.theyworkforyou.com/">Check up on your MP&#8217;s record</a> of participation in the parliamentary debates. After all they work for and represent <em>you</em>.
</li>
<li>And if they support the extension to 42 days, <a href="http://www.writetothem.com/">write to your MP</a> and present a counterpoint to the government&#8217;s plans.
</li>
<li><a href="http://liberty-human-rights.org.uk/issues/2-terrorism/extension-of-pre-charge-detention/index.shtml">Educate yourself on the issues</a><br />
[youtube=http://www.youtube.com/watch?v=sA-cUpLa-aE]</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2008/03/20/the-answer-is-not-42/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prototype for a Fedora virtual machine appliance builder</title>
		<link>http://berrange.com/posts/2008/02/17/prototype-for-a-fedora-virtual-machine-appliance-builder/</link>
		<comments>http://berrange.com/posts/2008/02/17/prototype-for-a-fedora-virtual-machine-appliance-builder/#comments</comments>
		<pubDate>Sun, 17 Feb 2008 20:48:00 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wordpress.berrange.com/?p=25</guid>
		<description><![CDATA[
For the oVirt project the end product distributed to users consists of a LiveCD image to serve as the &#8216;managed node&#8217; for hosting guests, and a virtual machine appliance to serve as the &#8216;admin node&#8217; for the web UI. The excellant Fedora LiveCD creator tools obviously already deal with the first use case. For the [...]]]></description>
			<content:encoded><![CDATA[<p>
For the <a href="http://ovirt.org/">oVirt</a> project the end product distributed to users consists of a LiveCD image to serve as the &#8216;managed node&#8217; for hosting guests, and a virtual machine appliance to serve as the &#8216;admin node&#8217; for the web UI. The excellant Fedora LiveCD creator tools obviously already deal with the first use case. For the second though we don&#8217;t currently have a solution. The way we build the admin node appliance is to boot a virtual machine and run anaconda with a kickstart, and then grab the resulting installed disk image. While this works it involves a number of error-prone steps. Appliance images are not inherantly different from LiveCDs &#8211; instead of a ext3 filesystem inside an ISO using syslinux, we want a number of filesystems inside a partitioned disk using grub. The overall OS installation method is the same in both use cases.
</p>
<p>
After a day&#8217;s hacking I&#8217;ve managed to re-factor the internals of the LiveCD creator, and add a new installation class able to create virtual machine appliances. As its input it takes a kickstart file, and the names and sizes for one or more output files (which will act as the disks). It reads the &#8216;part&#8217; entries from the kickstart file and uses parted to create suitable partitions across the disks. It then uses kpartx to map the partitions and mounts them all in the chroot. The regular LiveCD installation process then takes place. Once complete, it writes a grub config and installs the bootloader into the MBR. The result is one or more files representing the appliance&#8217;s virtual disks which can be directly booted in KVM / Xen / VMware.
</p>
<p>
The <code>virt-image</code> tool defines a simple XML format which can be used to describe a virtual appliance. It specifies things like minimum recommended RAM and VCPUs, the disks associated with the appliance, and the hypervisor requirements for booting it (eg Xen paravirt vs bare metal / fullvirt). Given one of these XML files, the <code>virt-image</code> tool can use libvirt to directly deploy a virtual machine without requiring any further user input. So an obvious extra feature for the virtual appliance creator is to output a virt-image XML description. With a demo kickstart file for the <strong>oVirt</strong> admin node, I end up with 2 disks:
</p>
<pre>
-rwxr-xr-x 1 root     root     5242880001 2008-02-17 14:48 ovirt-wui-os.raw
-rwxr-xr-x 1 root     root     1048576001 2008-02-17 14:48 ovirt-wui-data.raw
</pre>
<p>
And an associated XML file
</p>
<pre>
&lt;image&gt;
  &lt;name&gt;ovirt-wui&lt;/name&gt;
  &lt;domain&gt;
    &lt;boot type='hvm'&gt;
      &lt;guest&gt;
        &lt;arch&gt;x86_64&lt;/arch&gt;
      &lt;/guest&gt;
      &lt;os&gt;
        &lt;loader dev='hd'/&gt;
      &lt;/os&gt;
      &lt;drive disk='ovirt-wui-os.raw' target='hda'/&gt;
      &lt;drive disk='ovirt-wui-data.raw' target='hdb'/&gt;
    &lt;/boot&gt;
    &lt;devices&gt;
      &lt;vcpu&gt;1&lt;/vcpu&gt;
      &lt;memory&gt;262144&lt;/memory&gt;
      &lt;interface/&gt;
      &lt;graphics/&gt;
    &lt;/devices&gt;
  &lt;/domain&gt;
  &lt;storage&gt;
    &lt;disk file='ovirt-wui-os.raw' use='system' format='qcow2'/&gt;
    &lt;disk file='ovirt-wui-data.raw' use='system' format='qcow2'/&gt;
  &lt;/storage&gt;
&lt;/image&gt;
</pre>
<p>
To deploy the appliance under KVM I run
</p>
<pre>
# virt-image --connect qemu:///system ovirt-wui.xml
# virsh --connect qemu:///system list
 Id Name                 State
----------------------------------
  1 ovirt-wui            running
</pre>
<p>
Now raw disk images are really quite large &#8211; in this example I have a 5 GB and a 1 GB image. The LiveCD creator saves space by using resize2fs to shrink the ext3 filesystem, but this won&#8217;t help disk images since the partitions are a fixed size regardless of what the filesystem size is. So to allow smaller the appliance creator is able to call out to <code>qemu-img</code> to convert the raw file into a <code>qcow2</code> (QEMU/KVM) or <code>vmdk</code> (VMWare) disk image, both of which are grow on demand formats. The <code>qcow2</code> image can even be compressed. Wtth the <code>qcow2</code> format the disks for the <strong>oVirt</strong> WUI reduce to 600 KB and 1.9 GB.
</p>
<p>
The LiveCD tools have already seen immense popularity in the Fedora community. Once I polish off <a href="http://www.redhat.com/archives/fedora-livecd-list/2008-February/msg00085.html">this new code</a> to be production quality, it is my hope that we&#8217;ll see similar uptake by people interested in creating and distributing appliances. The great thing about basing the appliance creator on the Live CD codebase and using kickstart files for both, is that you can easily switch between doing regular anaconda installs, creating Live CDs and creating appliances at will, with a single kickstart file.</p>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2008/02/17/prototype-for-a-fedora-virtual-machine-appliance-builder/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Progress in Fedora 9 Xen pv_ops kernel development</title>
		<link>http://berrange.com/posts/2008/02/01/progress-in-fedora-9-xen-pv_ops-kernel-development/</link>
		<comments>http://berrange.com/posts/2008/02/01/progress-in-fedora-9-xen-pv_ops-kernel-development/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 15:26:00 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wordpress.berrange.com/?p=28</guid>
		<description><![CDATA[
You may recall my announcement of our plans for Fedora 9 Xen kernels. The 5 second summary is that we&#8217;re throwing away the current Xen kernels, and writing Xen support on top of paravirt_ops, for both DomU and Dom0, and both i386 &#38; x86_64. Hugely ambitious given the limited time scales involved and the fact [...]]]></description>
			<content:encoded><![CDATA[<p>
You may recall <a href="http://berrange.com/personal/diary/2007/11/plan-for-xen-kernels-in-fedora-9">my announcement</a> of our plans for Fedora 9 Xen kernels. The 5 second summary is that we&#8217;re throwing away the current Xen kernels, and writing Xen support on top of paravirt_ops, for both DomU and Dom0, and both i386 &amp; x86_64. Hugely ambitious given the limited time scales involved and the fact that only i386 DomU was working when we started this project.
</p>
<p>
Just minutes ago, after many many weeks work, Stephen Tweedie reached a very important milestone &#8211; the first kernel build capable of fully booting on Dom0, including the IOAPIC &amp; DMA support neccessary to run real hardware drivers &#8211; ie the ability to access your real disks once the initrd is done :-)
</p>
<blockquote>
<pre>
(10:22:13 AM) sct: It boots
(10:22:14 AM) sct: It runs
(10:22:16 AM) sct: I can ssh into it
(10:22:50 AM) sct: [root@ghost ~]# dmesg|grep para
(10:22:50 AM) sct: Booting paravirtualized kernel on Xen
(10:22:50 AM) sct: [root@ghost ~]#
</pre>
</blockquote>
<p>
It is beginning to look like we might actually succeed in our goals in time for Fedora 9 &#8211; congrats due to Stephen &#038; the rest of the team working on this !</p>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2008/02/01/progress-in-fedora-9-xen-pv_ops-kernel-development/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New release of Test-AutoBuild 1.2.1</title>
		<link>http://berrange.com/posts/2007/12/10/new-release-of-test-autobuild-1-2-1/</link>
		<comments>http://berrange.com/posts/2007/12/10/new-release-of-test-autobuild-1-2-1/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 01:58:00 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wordpress.berrange.com/?p=32</guid>
		<description><![CDATA[
I finally got around to doing some more work on Test-AutoBuild &#8211; a build and test automation framework for upstream developers. It checks sources out of SCM repos (CVS, Subversion, SVK, GNU Arch, Mercurial, Perforce), runs any build and test processes. It detects any RPMs generated during the build and publishes them in a YUM [...]]]></description>
			<content:encoded><![CDATA[<p>
I finally got around to doing some more work on <a href="http://autobuild.org/">Test-AutoBuild</a> &#8211; a build and test automation framework for upstream developers. It checks sources out of SCM repos (CVS, Subversion, SVK, GNU Arch, Mercurial, Perforce), runs any build and test processes. It detects any RPMs generated during the build and publishes them in a YUM repo. It also publishes HTML status pages showing build logs, list of generated packages, any artifacts generated (eg, code test coverage reports, API documentation) and changelogs from the SCM repo. It is a similar system to CruiseControl, but is more powerful since it directly understands the idea of module dependancies, and so can intelligently manage chained builds of multiple dependant modules. We use this in the ET group for testing our virtualization stack. Our <a href="http://builder.virt-manager.org/">nightly builder</a> builds libvirt and gtk-vnc first, then builds virt-viewer and virt-install against these builds, and finally builds virt-manager against all of them. So any change in libvirt gets validated to make sure it doesn&#8217;t break apps using libvirt. Since autobuild understands the dependancies, it can do intelligent build caching. eg if there were new changes in the libvirt SCM repo, but none in the virt-manager repos, it will still do a rebuild of virt-manager as a regression test
</p>
<p>
This <a href="https://mail.gna.org/public/testautobuild-announce/2007-12/msg00000.html">new release version 1.2.1</a> was all about making the SCM checkout process more reliable. Previously if a module could not be checked out (eg due to a server being down, or a config file typo) the entire build cycle would be aborted. With the new release, the troublesome module is simply skipped and the SCM logs published for the admin to diagnose &#8211; other modules in the build cycle continue to be built</p>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2007/12/10/new-release-of-test-autobuild-1-2-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How I learned to stop worrying and love IPv6</title>
		<link>http://berrange.com/posts/2007/08/16/how-i-learned-to-stop-worrying-and-love-ipv6/</link>
		<comments>http://berrange.com/posts/2007/08/16/how-i-learned-to-stop-worrying-and-love-ipv6/#comments</comments>
		<pubDate>Thu, 16 Aug 2007 22:58:00 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wordpress.berrange.com/?p=38</guid>
		<description><![CDATA[
Any OS running Fedora Core 6 or later has IPv6 networking support enabled out of the box. Most people will never notice and/or care since they&#8217;re only ever connected to IPv4 networks. A few months back now though I decided it was time to give IPv6 a try for real&#8230;.


I&#8217;ve got two servers on the [...]]]></description>
			<content:encoded><![CDATA[<p>
Any OS running Fedora Core 6 or later has IPv6 networking support enabled out of the box. Most people will never notice and/or care since they&#8217;re only ever connected to IPv4 networks. A few months back now though I decided it was time to give IPv6 a try for real&#8230;.
</p>
<p>
I&#8217;ve got two servers on the Internet running in UserModeLinux guests, one running Debian, the other Fedora Core 6, and then a home network provided by a LinkSys router running OpenWRT White Russian. My goal was provide full IPv6 connectivity to all of them.
</p>
<h3>Home Router</h3>
<p>
I tackled the problem of the home router first. The OpenWRT wiki has an <a href="http://wiki.openwrt.org/IPv6_howto">IPv6 Howto</a>, describing various setups. I decided to get a tunnel from the fine folks at <a href="http://sixxs.net/">SixXS</a>. My Verizon DSL only provides a dynamic IPv4 address and regular IPv6 over IPv4 tunnels require the server end to know the IPv4 address of your local endpoint. Obviously this is a bit of a problem with a dynamic IPv4 endpoint. SixXS though have a funky way around this in the form of their AICCU daemon which sets up a heartbeat from your local endpoint to their server. Thus should your IPv4 address ever change it can (securely with SSL) inform the server of your changed configuration. So I registered with SixXS, requested an IPv6 tunnel and a short while later they approved me. The service is open to anyone who wants IPv6 connectivity &#8211; the approval process is mainly to help avoid abuse &#038; frivilous requests. I was fortunate in that OCCAID are providing an IPv6 tunnel server just a few miles away in Boston &#8211; there&#8217;s other tunnel servers dotted around but mostly concentrated in America or Europe at this time.
</p>
<p>
With my IPv6 address allocated it and the OpenWRT guide handy my router was up &#038; running with IPv6 connectivity &#8211; I could do ping sites over IPv6 eg
</p>
<pre>
# ping6 www.kame.net
PING www.kame.net (2001:200:0:8002:203:47ff:fea5:3085): 56 data bytes
64 bytes from 2001:200:0:8002:203:47ff:fea5:3085: icmp6_seq=0 ttl=50 time=513.2 ms
64 bytes from 2001:200:0:8002:203:47ff:fea5:3085: icmp6_seq=1 ttl=50 time=512.5 ms
64 bytes from 2001:200:0:8002:203:47ff:fea5:3085: icmp6_seq=2 ttl=50 time=519.5 ms
</pre>
<p>
OpenWRT only ships with an IPv4 firewall as standard, so I quickly added ip6tables rules to deny all incoming traffic to the router. Even though port-scanning the entire IPv6 address space is not practical, only a tiny portion is active, and nearly all tunnels end up using addresses ending in :1 and :2, so a firewall is a must no matter what.
</p>
<h3>Home Network</h3>
<p>
To ensure you are serious about making use of their services, SixXS operate a credit system for admin requests. You start off with enough credits to request a IPv6 tunnel, but not enough to request an IPv6 subnet. To gain credits you have to prove you can keep the tunnel operational 24 hours a day for 7 days in a row &#8211; you then start gaining credits for each day&#8217;s uptime. So I had a slight pause before I could move onto setting up the home network.
</p>
<p>
Fortunately the LinkSys router is very reliable and so after a week I had enough uptime and thus enough credits to request an IPv6 subnet. In the brave new world of 128 bit addressing there&#8217;s no shortage of addresses, so to simplify routing, whenever someone needs a block of addresses they&#8217;ll typically be allocated an entire /48. That&#8217;s right /48 &#8211; you&#8217;ll be given more global IPv6 addresses for your personal use, than there are total IPv4 addresses in existance. Another interesting difference is that IPv6 subnets are not technically &#8217;sold&#8217; &#8211; they are merely &#8216;loaned&#8217; to end users. The upshot is that there&#8217;s no issue of having to pay your stinkin&#8217; DSL/Cable ISP $$$ per month for one or two extra addresses.
</p>
<p>
Having got the subnet allocated, the first step is to configure an IP address on the LAN interface of the LinkSys box. With OpenWRT this just required editing /etc/init.d/S40network to add  &#8220;ip -6 addr add 2001:XXXX:XXXX:XXXX::1/64 dev br0&#8243; (where 2001:XXXX:XXXX:XXXX is my subnet&#8217;s prefix). When the various IPv6 protocols were specced out a big deal was made of the fact that there would be no NAT anywhere, and that client configuration would be completely automatic &#038; be able to dynamically reconfigure itself on the fly. The key to this is what they call a &#8216;router advertisment daemon&#8217;. On Linux this is the &#8216;radvd&#8217; program. If you only have a single outgoing net connection, and a single local network, then configuring it is incredibly easy. Simply edit /etc/radvd.conf file and fill in the IPv6 address prefix for your subnet as allocated by SixXS. Then start the daemon.
</p>
<p>
Remember I just mentioned network configuration would be automatic &#8211; well look at any Fedora box plugged into your local network at this point. You&#8217;ll see they all just got globally routable IPv6 addresses assigned to their active network interfaces. Pop up a web browser and visit <a href="http://kame.net/">Kame</a> and you&#8217;ll see an animated dancing turtle logo! IPv4 users only see a static image&#8230;
</p>
<h3>Bytemark Server</h3>
<p>
One of my web servers is running Debian in a User Mode Linux instance at <a href="http://bytemark.co.uk">Bytemark</a> in the UK. The good news is that Bytemark have already taken care of getting IPv6 connectivity into their network, so there&#8217;s no need to use a tunnel on any server hosted by them. Simply ask their helpdesk to allocate you an IPv6 address from their pool, and add it to your primary ethernet address. Again don&#8217;t forget to setup ip6tables firewall rules before doing this.<br />
For Debian configuring the eth0 was a mere matter of editing /etc/network/interfaces and adding
</p>
<pre>
iface eth0 inet6 static
        address 2001:XXXX:XXXX:XXXX::2
        netmask 64
        up ip route add 2000::/3 via 2001:XXXX:XXXX:XXXX::1
</pre>
<p>
Again, with &#8216;2001:XXXX:XXXX:XXXX&#8217; being the address they allocated to your server.<br />
Since SSH listens for IPv6 connections by default, with the interface address configured I could now SSH from my laptop at home to my server using IPv6. Type &#8216;who&#8217; and you&#8217;ll see a big long IPv6 address against your username if its working correctly.
</p>
<h3>Linode Server</h3>
<p>
My other web server is hosted by <a href="http://linode.com/">Linode</a>. Unfortunately they don&#8217;t provide direct IPv6 connectivity so I had to use a tunnel. Since I do have a permanent static IPv4 address though I could use a regular IPv6-over-IPv4 tunnel rather than the dynamic heartbeat one I used at home with SixXS. For the sake of redundancy I decided to get my tunnel from a different provider, this time choosing <a href="http://tunnelbroker.net/">Hurricane</a>. When registering with them you provide a little contact info and the IPv4 address of your server. A short while later they&#8217;ll typically approve the request &#038; activate their end of the tunnel. It is then a matter of configuring your end. This machine was running Fedora Core 6, so creating a tunnel requires adding a file /etc/sysconfig/network-scripts/ifcfg-sit1 containing something like
</p>
<pre>
DEVICE=sit1
BOOTPROTO=none
ONBOOT=yes
IPV6INIT=yes
IPV6TUNNELIPV4=YY.YY.YY.YY
IPV6ADDR=2001:XXXX:XXXX:XXXX::2/64
</pre>
<p>
Where YY.YY.YY.YY was the IPv4 address of hurricane&#8217;s tunnel server, and 2001:XXXX:XXXX:XXXX was the IPv6 address prefix they allocated for my server. A quick ifup later and this server too has IPv6 connectivity.
</p>
<h3>The summary</h3>
<p>
This was all spread out over a couple of weeks, but by the end of it I had got both servers and my entire home network all operational with fully routable, global IPv6 connectivity. I have three differents types of IPv6 connectivity &#8211; direct (from Bytemark), static tunnel (from Hurricane), and a dynamic tunnel (from SixXS &#8211; they offer static tunnels too). If you have a static IPv4 address there&#8217;s a fourth way to get connected called 6-to-4 which maps your Ipv4 address into the IPv6 space and uses anycast routing. With so many ways to get IPv6 connectivity it doesn&#8217;t matter if your crappy DSL/Cable ISP doesn&#8217;t offer IPv6 &#8211; simply take them out of the equation.
</p>
<p>
One of the great things about being rid of NAT is that I can directly SSH into any machine at home from outside my network &#8211; no need for VPNs, or special reverse proxy rules through the NAT gateway. IPv6 addresses are crazily long, so the one final thing I did was to setup DNS entries for all my boxes, including a DNS zone for my home network. Remember how all clients on the home network auto-configure themselves, well this is done based on their network prefix and their MAC address, so they&#8217;ll always auto-configure themselves to the same IPv6 address. Makes it easy to give them permanent DNS mappings, without needing to manually administer a DHCP server.</p>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2007/08/16/how-i-learned-to-stop-worrying-and-love-ipv6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Security Enhanced Test-AutoBuild</title>
		<link>http://berrange.com/posts/2007/07/02/security-enhanced-test-autobuild/</link>
		<comments>http://berrange.com/posts/2007/07/02/security-enhanced-test-autobuild/#comments</comments>
		<pubDate>Mon, 02 Jul 2007 00:51:00 +0000</pubDate>
		<dc:creator>Daniel Berrange</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wordpress.berrange.com/?p=41</guid>
		<description><![CDATA[
In the latter half of last year I was mulling over the idea of writing SELinux policy for Test-AutoBuild. I played around a little bit, but never got the time to really make a serious attempt at it. Before I go on, a brief re-cap on the motivation&#8230;


Test-AutoBuild is a framework for providing continous, unattended, [...]]]></description>
			<content:encoded><![CDATA[<p>
In the latter half of last year I was mulling over the idea of <a href="https://mail.gna.org/public/testautobuild-devel/2006-10/msg00000.html">writing SELinux policy for Test-AutoBuild</a>. I played around a little bit, but never got the time to really make a serious attempt at it. Before I go on, a brief re-cap on the motivation&#8230;
</p>
<p>
<a href="http://autobuild.org/">Test-AutoBuild</a> is a framework for providing continous, unattended, automated software builds. Each run of the build engine checks the latest source out from CVS, calculates a build order based on module dependancies, builds each modules, and the publishes the results. The build engine typically runs under a dedicated system user account &#8211; <code>builder</code> &#8211; to avoid any risk of the module build process compromising a host (either accidentally, or delibrately). This works reasonably well if you are only protecting against accidental damage from a module build &#8211; eg building apps maintained inside your organization. If building code from source repositories out on the internet though there is a real risk of delibrately hostile module build processes. A module may be trojaned so that its build process attempts to scan your internal network, or it may trash the state files of the build engine itself &#8211; both the engine &#038; the module being built are under the same user account. There is also the risk that the remote source control server has been trojaned to try and exploit flaws in the client.
</p>
<p>
And so enter SELinux&#8230; The build engine is highly modular in structure, with different tasks in the build workflow being pretty well isolated. So the theory was that it ought to be possible to write SELinux policy to guarentee separation of the build engine, from the SCM tools doing source code checkout, from the module build processes, and other commands being run. As an example, within a build root there a handful of core directories
</p>
<pre>
root
 |
 +- source-root   - dir in which module source is checked out
 +- package-root  - dir in which RPMs/Debs &#038; other packages are generated
 +- install-root  - virtual root dir for installing files in 'make install'
 +- build-archive - archive of previous successful module builds
 +- log-root      - dir for creating log files of build process
 +- public_html   - dir in which results are published
</pre>
<p>
All these dirs are owned by the <code>builder</code> user account. The build engine itself provides all the adminsitrative tasks for the build workflow, so generally requires full access to all of these directories. The SCM tools, however, merely need to be able to check out files into the <code>source-root</code> and create logs in the <code>log-root</code>. The module build process needs to be able to read/write in the <code>source-root</code>, <code>package-root</code> and <code>install-root</code>, as well as creating logs in the <code>log-root</code>. So, given suitable SELinux policy it ought to be possible to lock down the access of the SCM tools and build process quite significantly.
</p>
<p>
Now aside from writing the policy there are a couple of other small issues. The primary one is that the build engine has to run in a confined SELinux context, and has to be able to run SCM tools and build processes in a different context. For the former, I choose to create a &#8216;auto-build-secure&#8217; command to augment the &#8216;auto-build&#8217; command. This allows user to easily run the build process in SELinux enforced, or traditional unconfined modes. In the latter cases, most SELinux policy has automated process context transitions based on the binary file labels. This isn&#8217;t soo useful for autobuild though, because the script we&#8217;re running is being checked out direct from a SCM repo &#038; thus not labelled. The solution for this is easily though &#8211; after fork()ing, but before exec()ing the SCM tools / build script we simply write the desired target context into /proc/self/attr/exec.
</p>
<p>
So with a couple of tiny modifications to the build engine, and many hours of writing <a href="http://cvs.gna.org/cvsweb/testautobuild/conf/selinux/?cvsroot=testautobuild">suitable policy for Test-AutoBuild</a>, its now possible to run the build engine under a strictly confined policy. There is one horrible troublespot though. Every application has its own build process &#038; set of operations is wishes to perform. Writing a policy which confines the build process as much as possible, while still keeping it secure is very hard indeed.  In fact it is effectively unsolveable in the general case.
</p>
<p>
So what to do ? SELinux booleans provide a way to toggle on/off various capabilities system wide. If building multiple applications though, it may be desirable to run some under a more confined policy than others &#8211; booleans are system wide. The solution I think is to define a set of perhaps 4 or 5 different execution contexts with differing levels of privileges. As an example, some contexts may allow outgoing network access, while others may deny all network activity. So the build admin can use the most restrictive policy by default, and a less restrictive policy for applications which are more trusted.
</p>
<p>
This weekend was just the start of experimentation with SELinux policy in regards to <a href="http://autobuild.org">Test-AutoBuild</a>, but it was more far, far successful than I ever expected it to be. The level of control afforded by SELinux is awesome, and with the flexibility of modifying the application itself too, the possibilities for fine grained access control are enourmous. One idea I&#8217;d like to investigate is whether it is possible to define new SELinux execution contexts on-the-fly. eg, instead of all application sources being checked out under a single &#8216;absource_t&#8217; file context, it would be desirable to create a new source file context per-applicaiton. I&#8217;m not sure whether SELinux supports this idea, but it is interesting to push the boundaries here nonetheless&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://berrange.com/posts/2007/07/02/security-enhanced-test-autobuild/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
