<?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>golb</title>
	<atom:link href="http://braastad.org/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://braastad.org/blog</link>
	<description>Espen Braastad</description>
	<lastBuildDate>Fri, 02 Sep 2011 23:59:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>KVM with iPXE in RHEL 6</title>
		<link>http://braastad.org/blog/2011/09/kvm-with-ipxe-in-rhel-6/</link>
		<comments>http://braastad.org/blog/2011/09/kvm-with-ipxe-in-rhel-6/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 20:29:27 +0000</pubDate>
		<dc:creator>Espen Braastad</dc:creator>
				<category><![CDATA[sysadm]]></category>

		<guid isPermaLink="false">http://braastad.org/blog/?p=128</guid>
		<description><![CDATA[A while ago I discovered the amazing iPXE project. It is a complete PXE implementation with lots of nifty features, based on the gPXE project. Redhat ships the gPXE firmware for qemu and KVM, and you might want to use &#8230; <a href="http://braastad.org/blog/2011/09/kvm-with-ipxe-in-rhel-6/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A while ago I discovered the amazing <a title="iPXE - open source boot firmware" href="http://ipxe.org">iPXE</a> project. It is a complete PXE implementation with lots of nifty features, based on the <a title="Etherboot/gPXE" href="http://etherboot.org/">gPXE</a> project. Redhat ships the gPXE firmware for qemu and KVM, and you might want to use iPXE instead as the iPXE project currently seems to be more active. The major features (copied from <a href="http://ipxe.org">ipxe.org</a>):</p>
<ul>
<li>boot from a web server via HTTP</li>
<li>boot from an iSCSI SAN</li>
<li>boot from a Fibre Channel SAN via FCoE</li>
<li>boot from an AoE SAN</li>
<li>boot from a wireless network</li>
<li>boot from a wide-area network</li>
<li>boot from an Infiniband network</li>
<li>control the boot process with a script</li>
</ul>
<p>First, download the source code:</p>
<pre>espen@luft:~$ mkdir ~/git
espen@luft:~$ cd ~/git
espen@luft:~/git$ git clone git://git.ipxe.org/ipxe.git
Cloning into ipxe...
remote: Counting objects: 33376, done.
remote: Compressing objects: 100% (9193/9193), done.
remote: Total 33376 (delta 24642), reused 30782 (delta 22666)
Receiving objects: 100% (33376/33376), 8.02 MiB | 1.94 MiB/s, done.
Resolving deltas: 100% (24642/24642), done.
espen@luft:~/git$ cd ipxe/
espen@luft:~/git/ipxe$</pre>
<p>Then change the general configuration file (<em>src/config/general.h</em>) to suit your needs. Use the <strong>#define</strong> and <strong>#undef</strong> to activate and deactivate various features such as VLAN support, DHCP support, etc. Below is a small part of <a href="https://github.com/ipxe/ipxe/blob/master/src/config/general.h">the header file</a> for you to see.</p>
<pre>[...]
#define IWMGMT_CMD   /* Wireless interface management commands */
#define FCMGMT_CMD   /* Fibre Channel management commands */
#define ROUTE_CMD    /* Routing table management commands */
#define IMAGE_CMD    /* Image management commands */
#define DHCP_CMD     /* DHCP management commands */
#define SANBOOT_CMD  /* SAN boot commands */
#define LOGIN_CMD    /* Login command */
#undef  TIME_CMD     /* Time commands */
#undef  DIGEST_CMD   /* Image crypto digest commands */
#undef  LOTEST_CMD   /* Loopback testing commands */
#undef  VLAN_CMD     /* VLAN commands */
#undef  PXE_CMD      /* PXE commands */
#undef  REBOOT_CMD   /* Reboot command */
[...]</pre>
<p>Now it&#8217;s time compile the firmware.</p>
<pre>espen@luft:~/git/ipxe$ cd src/
espen@luft:~/git/ipxe/src$ make bin/virtio-net.rom
  [DEPS] arch/i386/drivers/net/undirom.c
  [DEPS] arch/i386/drivers/net/undipreload.c
  [DEPS] arch/i386/drivers/net/undionly.c
  [DEPS] arch/i386/drivers/net/undinet.c
[...]
  [BIN] bin/virtio-net.rom.bin
  [ZINFO] bin/virtio-net.rom.zinfo
  [ZBIN] bin/virtio-net.rom.zbin
  [FINISH] bin/virtio-net.rom
[...]
espen@luft:~/git/ipxe/src$</pre>
<p>The firmware compiled successfully, and it is ready to use. Log onto the RHEL 6 node, and verify that you have installed the package <strong>gpxe-roms-qemu</strong> (<strong>qemu-kvm</strong> currently depends on <strong>gpxe-roms-qemu</strong>). The directory <em>/usr/share/gpxe/</em> contains the gPXE boot roms from this package.</p>
<p>To use your custom iPXE boot firmware instead, you can build a new rpm package that contains the new rom &#8211; or you can simply replace <em>/usr/share/gpxe/virtio-net.rom</em> [gPXE] with your <em>~/git/ipxe/src/bin/virtio-net.rom</em> [iPXE]. As least you will have iPXE boot firmware until the <strong>qemu-roms-qemu</strong> package is updated ;)</p>
<p>Make sure that your virtual machines are using the <strong><a href="http://wiki.libvirt.org/page/Virtio">virtio</a></strong> network device driver, and you are all set:</p>
<pre>
[...]
&#60;&#105;&#110;&#116;&#101;&#114;&#102;&#97;&#99;&#101;&#32;&#116;&#121;&#112;&#101;&#61;&#39;&#98;&#114;&#105;&#100;&#103;&#101;&#39;&#62;
&#32;&#32;[...]
&#32;&#32;&#60;&#109;&#111;&#100;&#101;&#108;&#32;&#116;&#121;&#112;&#101;&#61;&#39;&#118;&#105;&#114;&#116;&#105;&#111;&#39;&#47;&#62;
&#60;&#47;&#105;&#110;&#116;&#101;&#114;&#102;&#97;&#99;&#101;&#62;
[...]
</pre>
<p>Your virtual machines will now be booted using the iPXE boot firmware. Have a look at the <a href="http://ipxe.org/scripting" title="iPXE - open source boot firmware [scripting]">iPXE scripting documentation</a> for more inspiration!</p>
]]></content:encoded>
			<wfw:commentRss>http://braastad.org/blog/2011/09/kvm-with-ipxe-in-rhel-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Workaround of the day: PXE as primary boot dev on a dl360 g7</title>
		<link>http://braastad.org/blog/2011/07/work-a-round-of-the-day/</link>
		<comments>http://braastad.org/blog/2011/07/work-a-round-of-the-day/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 19:38:03 +0000</pubDate>
		<dc:creator>Espen Braastad</dc:creator>
				<category><![CDATA[sysadm]]></category>

		<guid isPermaLink="false">http://braastad.org/blog/?p=89</guid>
		<description><![CDATA[The problem: How to set PXE as the preferred boot device on a default HP dl360 g7 from Linux? The key words here are &#8220;from Linux&#8221;. No iLO tricks are allowed. Of course, the simple answer should be: &#8220;use ipmitool!&#8221;. &#8230; <a href="http://braastad.org/blog/2011/07/work-a-round-of-the-day/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The problem: How to set <strong>PXE</strong> as the preferred boot device on a <strong>default</strong> <a href="http://h10010.www1.hp.com/wwpc/us/en/sm/WF05a/15351-15351-3328412-241644-241475-4091408.html">HP dl360 g7</a> from Linux?</p>
<p>The key words here are &#8220;from Linux&#8221;. No iLO tricks are allowed. Of course, the simple answer should be: <em>&#8220;use ipmitool!&#8221;</em>. However, ipmitool (I&#8217;m currently using ipmitool-1.8.11-6.el6.x86_64 in <a href="http://www.scientificlinux.org/">Scientific Linux</a> 6) doesn&#8217;t quite seem to do the trick here. The following have been tried without success:</p>
<pre>[root@localhost ~]# ipmitool chassis bootdev pxe
Set Boot Device to pxe
[root@localhost ~]# reboot</pre>
<pre>[root@localhost ~]# ipmitool chassis bootparam set bootflag force_pxe
Set Boot Device to force_pxe
[root@localhost ~]# reboot</pre>
<pre>[root@localhost ~]# ipmitool chassis bootdev pxe clear-cmos=yes
Set Boot Device to pxe
[root@localhost ~]# reboot</pre>
<p>It is nice to know that the dl360 g7 will PXE boot if it is unable to boot from the local hard drive. This behaviour can be used as a (not-so-pretty-ok-I-admit-it-is-very-very-VERY-ugly-but-it-works-for-me type of) workaround:</p>
<pre>[root@localhost ~]# modprobe ipmi_si
[root@localhost ~]# modprobe ipmi_devintf
[root@localhost ~]# alias reinstall="/bin/dd if=/dev/zero \
of=/dev/sda bs=512 count=1 2>/dev/null ; sync ; \
ipmitool chassis bootparam set bootflag force_pxe \
>/dev/null ; reboot"
[root@localhost ~]# reinstall</pre>
<p>(The alias is called <em>reinstall</em> because booting from PXE will, in this setup, reinstall the node.)</p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://braastad.org/blog/2011/07/work-a-round-of-the-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>munincollector-ng</title>
		<link>http://braastad.org/blog/2010/08/munincollector-ng/</link>
		<comments>http://braastad.org/blog/2010/08/munincollector-ng/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 20:15:53 +0000</pubDate>
		<dc:creator>Espen Braastad</dc:creator>
				<category><![CDATA[sysadm]]></category>

		<guid isPermaLink="false">http://braastad.org/blog/?p=5</guid>
		<description><![CDATA[Munincollector-ng is a perl script that collects graphs from multiple munin installations to display them in one page. A scenario where this is helpful is when you have (too) many munin clients on (too) many munin masters, and you want &#8230; <a href="http://braastad.org/blog/2010/08/munincollector-ng/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Munincollector-ng is a perl script that collects graphs from multiple <a href="http://munin-monitoring.org" target="_self">munin</a> installations to display them in one page. A scenario where this is helpful is when you have (too) many munin clients on (too) many munin masters, and you want to look through some of the graphs &#8211; i.e. the <em>Disk usage in percent</em> (aka <em>df</em>) plugin &#8211; without spending/wasting too much time browsing through the less important graphs.</p>
<p>It consists of one perl script and one configuration file. It is being executed regularly by cron. At each run, it iterates through the configuration file; downloads the graphs to a local directory and generates an html file:</p>
<p><a href="http://braastad.org/blog/wp-content/uploads/2010/08/munincollector-ng.png"><img src="http://braastad.org/blog/wp-content/uploads/2010/08/munincollector-ng-300x293.png" alt="" title="munincollector-ng" width="300" height="293" class="alignnone size-medium wp-image-44" /></a> </p>
<p>Below is some example configuration that will gather the <em>week</em> and <em>month</em> graphs from the <em>df</em> plugin from four separate munin masters (three without authentication and one with authentication). The graphs will be downloaded to <em>/var/www/munincollector-ng/</em>:</p>
<pre># General configuration
graph.plugin df
graph.type week month
graph.log /var/log/munincollector-ng.log
graph.dir /var/www/munincollector-ng

# Configuration per munin master you want to collect graphs from.
# The format is: &lt;id&gt;.&lt;option&gt; &lt;value&gt;

# Three munin installations with no authentication
uio.url http://munin.ping.uio.no
foo.url http://foo.com/munin/
bar.url http://bar.com/munin/

# One munin master that requires authentication
baz.url http://baz.com/munin/
baz.realm Munin
baz.username user1
baz.password pass1
baz.netloc baz.com:80</pre>
<p>An example cron job that will execute the script once per day (make sure <em>user</em> have write permissions in <em>/var/www/munincollector-ng/</em>):</p>
<pre>8 8 * * * user /usr/local/bin/munincollector-ng -c /etc/munincollector-ng/example.conf</pre>
<p>The script is available from <a href="https://github.com/espebra/munincollector-ng">github</a>.</p>
<p>PS: Put the <em>logo.png</em> and <em>style.css</em> from your <em>/etc/munin/templates/</em> directory into <em>/var/www/munincollector-ng/</em> to make it look a bit nicer.</p>
]]></content:encoded>
			<wfw:commentRss>http://braastad.org/blog/2010/08/munincollector-ng/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

