<?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>Zarathustra Shall Speak &#187; Xen</title>
	<atom:link href="http://zarathustrashallspeak.com/tag/xen/feed/" rel="self" type="application/rss+xml" />
	<link>http://zarathustrashallspeak.com</link>
	<description>And you yourself are also this Will to Power.</description>
	<lastBuildDate>Tue, 13 Jul 2010 18:35:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>My kingdom for a solid OS.</title>
		<link>http://zarathustrashallspeak.com/2010/04/11/my-kingdom-for-a-solid-os/</link>
		<comments>http://zarathustrashallspeak.com/2010/04/11/my-kingdom-for-a-solid-os/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 04:20:45 +0000</pubDate>
		<dc:creator>Akairenn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://zarathustrashallspeak.com/?p=317</guid>
		<description><![CDATA[First they laugh at you.  Then they keep on laughing.  Then they cry, because they realize the alternatives are just as bad.]]></description>
			<content:encoded><![CDATA[<p>All I want for Christmas are up to date packages, no need to sit around compiling kernels, and solid networking.  Is it too much to ask?</p>
<p>Yes, clearly.</p>
<p>RHEL/CentOS: Networking is beyond solid, albeit best configured manually in terms of setup.  Xen is absolutely archaic, but at least comes with a dom0 kernel &#8211; though it seems plenty finicky around scsi devices and VNC.</p>
<p>Fedora: &#8230;Hung at the splash screen post-install.  On a Sun Fire x4150.  Seriously?  Points for the upcoming Xenified kernel in Fedora 13, though.</p>
<p>Ubuntu: Networking seems easy enough to configure, and works, as long as you&#8217;re not going super-crazy with abstract interconnects.  Xen is absolutely archaic, and there&#8217;s not even a dom0 kernel.  The answer is to pull a Debian kernel (lol) or compile your own kernel, manually patching with OpenSuSE(!) patches.  Yeah, no thanks.</p>
<p>OpenSuSE: Xen is up to date, and has a potentially super-up-to-date dom0 kernel.  Networking is curiously annoying to deal with via YaST &#8211; but the real problem is, right out of the disc, I apparently can&#8217;t do ethernet bonding with Xen due to module differences.</p>
<p>It&#8217;s 2010.</p>
<p>I&#8217;m just trying to run a solid, up-to-date Xen dom0 with simple, bonded ethernet, without having to a) compile Xen myself, or b) compile a dom0 kernel myself.</p>
<p>It&#8217;s pointedly not 1995.</p>
<p>Really, if I wanted to compile common software myself, I&#8217;d step into a police box and at least get a kick-ass theme song out of it.</p>
<p>Well, OpenSuSE still seems like the best solution for those who are interested in non-broken, easy-to-manage 3.4.x XEN.  Time to fiddle &#8211; I have no doubt that bonding works and that I&#8217;ve just missed the obvious in the installation process.</p>
]]></content:encoded>
			<wfw:commentRss>http://zarathustrashallspeak.com/2010/04/11/my-kingdom-for-a-solid-os/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Timer ISR/1: Time went backwards.</title>
		<link>http://zarathustrashallspeak.com/2010/04/02/timer-isr1-time-went-backwards/</link>
		<comments>http://zarathustrashallspeak.com/2010/04/02/timer-isr1-time-went-backwards/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 08:56:45 +0000</pubDate>
		<dc:creator>Akairenn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Sun]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://zarathustrashallspeak.com/?p=306</guid>
		<description><![CDATA[AMD > Intel.  Always has.  Always will be.]]></description>
			<content:encoded><![CDATA[<p>If you find yourself alone, riding through green fields with the sun on your face, do not be troubled.  For you&#8217;re probably using an Intel-based system for virtualization, and are already dead!</p>
<p>Seriously, though, I&#8217;ve <em>never</em> had any of these weird goddamned problems with AMD-based systems.  Well, whatever.</p>
<p>If you randomly get the <em>&#8216;Timer ISR/1: Time went backwards&#8217;</em> bullshit, reboot your Dom0, enter BIOS, and make sure you turn off all of Intel&#8217;s power saving nonsense.  For a Sun Fire x4150, specifically, kill the following crap:</p>
<p><code>Advanced > CPU Configuration > Intel(R) SpeedStep(tm) tech<br />
Advanced > CPU Configuration > Intel(R) C-STATE tech</code></p>
<p>With an x4150, you may end up with a weird hardware clock issue &#8211; specifically, /dev/rtc being completely inaccessible.  hwclock &#8211;debug will return errno=19.</p>
<p>If you&#8217;re already infuriated to the point of wanting to put a server through a wall, you can do the following:</p>
<p><code>Edit /etc/rc.sysinit and /etc/init.d/halt, comment out all lines referring to hwclock<br />
Install and configure ntp<br />
Edit /etc/sysconfig/ntpd, add the following to the first line of options: -x -g</code></p>
<p>-x will force ntpdate to run first on startup of ntpd, ensuring your eventual completely borked time will be set before ntpd proper starts.  -g will ensure that ntpd can continue to mangle your time, even if somehow your drift is several days off the mark.</p>
<p>Would that Xen had a more up-to-date kernel, or that RedHat hadn&#8217;t abandoned it in favor of KVM.   Or would that KVM was ready for prime time. :p</p>
]]></content:encoded>
			<wfw:commentRss>http://zarathustrashallspeak.com/2010/04/02/timer-isr1-time-went-backwards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ghetto Xen Status Report</title>
		<link>http://zarathustrashallspeak.com/2010/02/20/ghetto-xen-status-report/</link>
		<comments>http://zarathustrashallspeak.com/2010/02/20/ghetto-xen-status-report/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 01:46:59 +0000</pubDate>
		<dc:creator>Akairenn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://zarathustrashallspeak.com/?p=241</guid>
		<description><![CDATA[I'm too lazy to open yet another window for documentation on where your server is at.]]></description>
			<content:encoded><![CDATA[<p>Pointlessly long script to give a report on total/available memory and a list of domU&#8217;s, their memory allocation, and number of vcpus on a Xen server.</p>
<p>It provides output similar to the following:</p>
<pre>
Status report as of: 2010-02-19 09:00:01

dom0 Information:
------------------------------------------------------------------------------

host                   lolhost.irtehrox.com
total_memory           65535
free_memory            9276

Running domU's:
------------------------------------------------------------------------------

NAME:                  MEMORY:   VCPU:
20000-web002              2048       1
20001-web001             12288       4
20001-web002             12288       4
50005-db002               2048       1
50005-web002              4096       1
60015-dev001               256       1
60015-web004              4096       1
80123-web005              8192       1
80123-web006              8192       1
</pre>
<p>While you certainly could glean this information by looking at the list of systems you should be keeping, or even logging into the server itself, who has time for that? :p</p>
<p>The good stuff:</p>
<pre>
#!/usr/bin/perl

# Configuration -------------------------------------------------------------
# Domain to send e-mail from; for the actual user, we use our hostname
my $SENDER = "somedomain.foo";

# Address to e-mail report to
my $RECEIVER = 'user@somehost.foo';
# ---------------------------------------------------------------------------

# Global Variables
my $hostname = "unknown";
my $email_body = "";
my $stamp = "unknown";
my $hr = "------------------------------------------------------------------------------";

# Part 1: Intial setup; grab our time, hostname, etc.
open(HOSTNAME, "/bin/hostname |");
while(<HOSTNAME>)
{
        # Get rid of the break
        chomp($_);

        # Kill anything after a proper hostname; this may need to be commented out
        # or modified depending on your needs
        $_ =~ s/\..*//g;

        $hostname = $_;
}
close(HOSTNAME);
$stamp = qx(date +"%Y-%m-%d %H:%M:%S");
chomp($stamp);
$email_body = $email_body . "Status report as of: $stamp\n";

# Part 2: Grab key Xen info for the dom0
my (@info_holder);
$email_body = $email_body . "\n\ndom0 Information:\n$hr\n\n";
open(XM, "/usr/sbin/xm info |");
while(<XM>)
{
        # Get rid of the break
        chomp($_);

        # Selective acquisition of data
        if(($_ =~ /^host/) || ($_ =~ /^total_memory/) || ($_ =~ /^free_memory/))
        {
                # Quick regexp to ensure the line can be split easily
                $_ =~ s/\s+/ /g;

                # Eliminate the colon
                $_ =~ s/: //g;

                # Split our line
                @info_holder = split(/ /, $_);

                # Attach line to e-mail
                $email_body = $email_body . sprintf("%-20s   %s", $info_holder[0],
$info_holder[1]) . "\n";
        }
}
close(XM);

# Part 3: Grab list of running domU's
my (@domu_holder, @domu_out, $i);
$i = 0;
open(XM, "/usr/sbin/xm list |");
while(<XM>)
{
        # Get rid of the break
        chomp($_);

        # Kill the header and Dom-0 lines
        if(($_ =~ /^Name /) || ($_ =~ /^Domain-0 /))
        {
                next;
        }

        # Quick regexp to ensure the line can be split easily.
        $_ =~ s/\s+/ /g;

        # Insert into our holding array
        $domu_holder[$i] = $_;

        # Increment our counter
        $i++;
}
close XM;
@domu_holder = sort(@domu_holder);
$email_body = $email_body . "\n\nRunning domU's:\n$hr\n\nNAME:                  MEMORY:   VCPU:\n";
foreach(@domu_holder)
{
        # Split the line so we can extract name, vcpu, mem
        @domu_out = split(' ', $_);

        # Format it up!
        $email_body = $email_body . sprintf("%-20s   %7s   %5s", $domu_out[0], $domu_out[2],
$domu_out[3]) . "\n";
}

# Finally, send the e-mail
open(SENDMAIL, "|/usr/sbin/sendmail -t");
print SENDMAIL "To: $RECEIVER\n";
print SENDMAIL "From: $hostname\@$SENDER\n";
print SENDMAIL "Subject: Xen Status Report For $stamp\n";
print SENDMAIL $email_body . "\n";
close(SENDMAIL);
</pre>
<p>No doubt there&#8217;s an easier way to go about doing this, but I have a talent for simplifying the complex and complicating the obvious.  Should&#8217;ve been a politician.</p>
]]></content:encoded>
			<wfw:commentRss>http://zarathustrashallspeak.com/2010/02/20/ghetto-xen-status-report/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jailtime.org CentOS 5.2 on Xen; Boot Problem</title>
		<link>http://zarathustrashallspeak.com/2009/05/22/jailtime-org-centos-5-2-on-xen-boot-problem/</link>
		<comments>http://zarathustrashallspeak.com/2009/05/22/jailtime-org-centos-5-2-on-xen-boot-problem/#comments</comments>
		<pubDate>Fri, 22 May 2009 19:34:35 +0000</pubDate>
		<dc:creator>Akairenn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://zarathustrashallspeak.com/?p=70</guid>
		<description><![CDATA[Xen remains my favorite virtualization solution for Linux.]]></description>
			<content:encoded><![CDATA[<p>A non-booting DomU is a standard problem to have with Xen; over the years I&#8217;ve seen it happen mainly due to console or hwclock problems.  This one, however, stumped me &#8211; first time debugging it in Xen > 3.0.x, after all.</p>
<p>Basically, my CentOS 5.2 DomU refused to boot, stalling out after initializing SSH.  Interactive mode showed it was freezing on starting the local service, or at least shortly afterward &#8211; no and continue options had the same result.</p>
<p>The following had to be shoved into the config file for the DomU, and replaced my &#8216;console=hvc0&#8242; declaration:</p>
<p><code>extra ="3 xencons=tty"</code></p>
<p>The solution comes from this message:  <a href="http://lists.xensource.com/archives/html/xen-users/2009-04/msg00485.html">http://lists.xensource.com/archives/html/xen-users/2009-04/msg00485.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://zarathustrashallspeak.com/2009/05/22/jailtime-org-centos-5-2-on-xen-boot-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiling Xen 3.4.0 on a Minimalistic RHEL/CentOS 5.3 System</title>
		<link>http://zarathustrashallspeak.com/2009/05/21/compiling-xen-3-4-0-on-a-minimalistic-rhelcentos-5-3-system/</link>
		<comments>http://zarathustrashallspeak.com/2009/05/21/compiling-xen-3-4-0-on-a-minimalistic-rhelcentos-5-3-system/#comments</comments>
		<pubDate>Thu, 21 May 2009 11:31:52 +0000</pubDate>
		<dc:creator>Akairenn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://zarathustrashallspeak.com/?p=76</guid>
		<description><![CDATA[CentOS and Xen have always made a great pair.  They're even better together when you ignore the 3.0.x packages RedHat distributes with RHEL 5.x.]]></description>
			<content:encoded><![CDATA[<p>By default, pretty much every Linux distribution comes filled with tons of crap you don&#8217;t want anywhere near any serious server environment.  Unfortunately, distributions rarely have the holy grail of administration &#8211; &#8216;Install only the crap I need to maintain security, compile cool stuff, and stop giving me sixteen text-based e-mail clients.&#8217;</p>
<p>Since that doesn&#8217;t exist, there&#8217;s&#8230;  I won&#8217;t even qualify it as the next best thing.  More like the lesser of two evils: a completely barebones system.  It&#8217;s a pain in the ass, but any serious architecture requires building from the ground up after all.</p>
<p>I find myself in this situation and with the need to install Xen 3.4.0 on a CentOS 5.3 x86_64 box.   Note that while I&#8217;m CPU class specific, if you&#8217;re running i386 or some weird hybrid between the two, these instructions may still be useful.  Just strip <em>&#8211;exclude=*.i?86</em> from any yum commands.</p>
<p>On with the show:</p>
<p><code>cd /opt<br />
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm<br />
rpm -ivh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm<br />
yum --exclude=*.i?86 -y install zlib-devel openssl-devel ncurses-devel python-devel<br />
          xorg-x11-proto-devel bridge-utils binutils gcc mercurial gettext dev86 patch texinfo</code></p>
<p>In the above block, we&#8217;re opening up access to the <a href="https://rpmrepo.org/RPMforge">rpmforge</a> third-party repository.  Yes &#8211; ouch.  Don&#8217;t worry.  rpmforge is ancient, stable and kick ass.  Plus I&#8217;m lazy and would rather install mercurial, the package we need, via rpm instead of by hand.   We&#8217;re also installing a number of other packages that we&#8217;ll need.  Depending on how bare-bones crazy you are, some of these packages might already be installed &#8211; but this is the list of &#8216;oh crap, my system doesn&#8217;t even have gcc!&#8217; requirements.</p>
<p><code>cd /opt<br />
wget http://bits.xensource.com/oss-xen/release/3.4.0/xen-3.4.0-xen.tar.gz<br />
tar -zxf xen-3.4.0-xen.tar.gz<br />
cd xen-3.4.0<br />
make world<br />
make install</code></p>
<p>Stupid easy, amirite?  The nice thing about Xen is, if you&#8217;re missing a package (which you shouldn&#8217;t be), it&#8217;ll pretty much give you a good idea of what you need.  Protip: Open up a CentOS5 mirror and use your browser to search for exact package names.  If you can&#8217;t find one, chances are the build scripts are shooting you an actual file/executable name.  In that case, try:</p>
<p><code>yum whatprovides *NAMEOFWHATEVER</code></p>
<p>That should locate what package contains whatever it is you&#8217;re missing.</p>
<p>Now execute the following:</p>
<p><code>ls /boot</code></p>
<p>Take careful note of the name of the file named &#8216;vmlinuz-BUNCHOFNUMBERS-xen&#8217; &#8211; you need that bunch of numbers.</p>
<p><code>cd /lib/modules<br />
depmod<br />
mkinitrd --allow-missing /boot/initrd-2.6.18.8-xen.img 2.6.18.8-xen</code></p>
<p>You know that bunch of numbers?  They&#8217;re what you put in place of the &#8217;2.6.18.8&#8242; in the mkinitrd command above.  &#8211;allow-missing *should* be fine for most systems.</p>
<p><code>cd /boot<br />
ln -s vmlinuz-2.6.18.8-xen vmlinuz-xen<br />
ln -s initrd-2.6.18.8-xen.img initrd-xen</code></p>
<p>Again, replace the &#8217;2.6.18.8&#8242; with the numbers you retrieved via the &#8216;ls&#8217; command.</p>
<p>Now open up /boot/grub/grub.conf in your favorite text editor.  Add the following as the first block of bootable goodness:</p>
<p><code>title XEN (Xen Virtualization)<br />
        root (hd0,0)<br />
        kernel /xen.gz<br />
        module /vmlinuz-xen ro root=LABEL=/1<br />
        module /initrd-xen</code></p>
<p>You can pretty much put anything for the title &#8211; standards say to put the kernel version, but I don&#8217;t like touching grub.conf, which would have to be done in order to continually update the version each time you update your kernel.  Fie on that.  Thus the reason for the vmlinuz-xen and initrd-xen symlinks; if/when you upgrade, you need only re-point the symlinks rather than messing with grub.conf.</p>
<p>On that note, if you end up yum updating and it replaces your kernel, that *will* edit grub.conf in my experience.  So make it a habit to check your grub.conf to make sure your default remains set at 0 after any yum update that plays with the now unused stock kernels.</p>
<p><code>chkconfig --level=2345 xend on<br />
chkconfig --level=2345 xendomains on</code></p>
<p>Finally, we set Xen to start on boot.</p>
<p>Reboot, and assuming your system doesn&#8217;t crap out (which is beyond the scope of this post), Bob&#8217;s yer Uncle Dick.</p>
]]></content:encoded>
			<wfw:commentRss>http://zarathustrashallspeak.com/2009/05/21/compiling-xen-3-4-0-on-a-minimalistic-rhelcentos-5-3-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
