<?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>thinking sysadmin &#187; centos</title>
	<atom:link href="http://andyleonard.com/tag/centos/feed/" rel="self" type="application/rss+xml" />
	<link>http://andyleonard.com</link>
	<description>qstat -u aleonard -s z</description>
	<lastBuildDate>Sun, 22 Jan 2012 03:46:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Interesting Linux VM Crash Pattern</title>
		<link>http://andyleonard.com/2009/11/20/interesting-linux-vm-crash-pattern/</link>
		<comments>http://andyleonard.com/2009/11/20/interesting-linux-vm-crash-pattern/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 19:09:16 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[virtualization]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[iscsi]]></category>
		<category><![CDATA[kernel panic]]></category>
		<category><![CDATA[mptscsi]]></category>
		<category><![CDATA[netapp]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[vmware esx]]></category>
		<category><![CDATA[vsmp]]></category>

		<guid isPermaLink="false">http://andyleonard.com/?p=343</guid>
		<description><![CDATA[I&#8217;ve just begun to pull together some interesting data on a series of Linux VM crashes I&#8217;ve seen. I don&#8217;t have a resolution yet, but some interesting patterns have emerged. Crash Symptoms A CentOS 4.x or 5.x guest will crash with a message similar to the following on its console: CentOS 4.x: [&#60;f883b299&#62;] .text.lock.scsi_error+0x19/0x34 [scsi_mod] [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just begun to pull together some interesting data on a series of Linux VM crashes I&#8217;ve seen.  I don&#8217;t have a resolution yet, but some interesting patterns have emerged.</p>
<p><strong>Crash Symptoms</strong></p>
<p>A CentOS 4.x or 5.x guest will crash with a message similar to the following on its console:</p>
<p>CentOS 4.x:</p>
<p><code>[&lt;f883b299&gt;] .text.lock.scsi_error+0x19/0x34 [scsi_mod]<br />
[&lt;f88c19ce&gt;] mptscsih_io_done+0x5ee/0x608 [mptscsi] (…)<br />
[&lt;c02de564&gt;] common_interrupt+0x18/0x20<br />
[&lt;c02ddb54&gt;] system_call+0x0/0x30</code></p>
<p>CentOS 5.x:</p>
<p><code>RIP  [&lt;ffffffff8014c562&gt;] list_del+0x48/0x71 RSP &lt;ffffffff80425d00&gt; &lt;0&gt;Kernel Panic - not syncing: Fatal exception</code></p>
<p>A hard reset (i.e. pressing the reset button on the VM&#8217;s console) is required to reboot the guest.<br />
<span id="more-343"></span><br />
<strong>Further Details</strong></p>
<p>Five different VMs have encountered this issue, running at a mix of close-to-current CentOS 4.x and 5.x patch levels.  Guest kernel versions when the crash occurred were 2.6.18-128.7.1.el5 and 2.6.18-128.1.10.el5 (5.x) and 2.6.9-89.0.9.ELsmp (4.x).  Memory allocations on affected guests range from 512MB to 3072MB.  Notably, all affected VMs are using SMP &#8211; each has 2 vCPUs &#8211; having been created before our in-house practices followed <a href="http://blogs.vmware.com/performance/2008/06/esx-scheduler-s.html">VMware guidelines</a> and discouraged use of SMP on ESX guests when unnecessary.  One VM was created via P2V; the rest were created <em>de novo</em> on virtual hardware.</p>
<p>All crashes have happened on a single node in an ESX 3.5 HA cluster composed of four Dell PowerEdge 1950s.  ESX hosts have tracked the latest VMware patches closely.  COS memory on the ESX host in question was increased from the default to 800MB prior to the three most recent crashes; in other words, the COS memory increase appears to have had no effect on the crashes.  DRS is in use, set to &#8220;fully automated&#8221; and &#8220;apply recommendations with three or more stars&#8221; and no virtual machine rules have been created to control DRS host placement.</p>
<p>All guests are on the same NFS data store, served from a NetApp filer running ONTAP 7.2.x.  One guest had its vmswap placed separately on an iSCSI data store; the rest have their swap stored on NFS with the VM.  No log messages were seen on the filer during the event, although the a log message similar to the following has been seen several times on the ESX host:</p>
<p><code>vmkernel: 43:07:27:51.725 cpu2:2185)WARNING: NFS: 4590: Can't find call with serial number -2146566055</code></p>
<p>Curiously, all crashes have happened in the evening, in the 10 o&#8217;clock hour, after nightly backups have been completed.  Backups are created using a combination of VMware and NetApp snapshots via a script similar to one detailed on <a href="http://vmwaretips.com/wp/2008/12/05/netapp-snapshots-in-esx-take-2/">vmwaretips.com</a>.  No substantial load or latency has been recorded on the NetApp during the crashes, and weeks have passed between events.</p>
<p><strong>Speculation</strong></p>
<p>Explanations I&#8217;m leaning towards, ranked by my judgment of their likelihood:</p>
<p>1) <strong>Hardware issue.</strong>  Assuming a random distribution of VMs &#8211; recall that DRS is in use and no virtual machine rules are in place &#8211; the odds of all five crashes happening on one host out of four are slim: 1 in 1024.  Unfortunately, by all measures we&#8217;ve used, including the VI Client&#8217;s &#8220;Health Status&#8221; and Dell OMSA, there are no hardware issues with the host.</p>
<p>Further, the distribution of VMs is not truly random.  DRS migrations are infrequent in this cluster, and the largest determinant of guest location is migration following hosts being placed into maintenance mode for patching.</p>
<p>If it is a hardware issue, it&#8217;s subtle, and possibly only brought to the fore by the following issues.</p>
<p>2) <strong>Red Hat Enterprise Linux bug</strong> &#8211; which, by extension, is typically equivalent to a CentOS bug.  In fact, this issue appears to have been raised with Red Hat already in bugs <a href="https://bugzilla.redhat.com/show_bug.cgi?id=197158">197158</a> and <a href="https://bugzilla.redhat.com/show_bug.cgi?id=228108">228108</a> &#8211; but, according the bug reports, the issue is resolved, and the patches have since been ported downstream to CentOS.  However, perhaps the issue is not truly resolved &#8211; see <a href="https://bugzilla.redhat.com/show_bug.cgi?id=228108#c35">comment 35</a> in 228108.</p>
<p>3) <strong>vSMP Bug.</strong>  The majority of our Linux VMs are uniprocessor and appear so far to be immune to this issue; it is striking that the crash has only occurred on dual processor guests.  I cannot articulate a mechanism for multiple vCPUs causing this crash, however.</p>
<p>4) <strong>NetApp issue.</strong>  This appears to be a storage issue at some level, considering the mptscsi and NFS messages noted above, so performance of the NetApp filer would be a natural place for further investigation.  However, we monitor the performance of our filer relatively closely, using the ONTAP SDK and Cacti, and nothing unusual was recorded during any crash.  It seems unusual that all VMs reside on the same data store, but that data store shares an aggregate with multiple other unaffected data stores, and several LUNs are served from the same aggregate to non-ESX machines without complaint.</p>
<p>I have not yet opened a case with VMware on this issue &#8211; or Dell, or NetApp, for that matter &#8211; but if and when I do, I&#8217;ll update here to the extent possible.</p>
<p><strong>Update 11/20/2009:</strong> Prompted by a helpful comment from nate below, I looked up and verified the NFS settings across the cluster.  They are the same across all hosts, and are as follows:</p>
<p><code>NFS.IndirectSend 0<br />
NFS.DiskFileLockUpdate 10<br />
NFS.LockUpdateTimeout 5<br />
NFS.LockRenewMaxFailureNumber 3<br />
NFS.LockDisable 0<br />
NFS.HeartbeatFrequency 12<br />
NFS.HeartbeatTimeout 5<br />
NFS.HeartbeatDelta 5<br />
NFS.HeartbeatMaxFailures 10<br />
NFS.MaxVolumes 8<br />
NFS.SendBufferSize 264<br />
NFS.ReceiveBufferSize 128<br />
NFS.VolumeRemountFrequency 30<br />
NFS.UDPRetransmitDelay 700</code></p>
<p>The only values that are changed from default are HeartbeatFrequency and HeartbeatMaxFailures, to match NetApp&#8217;s recommendations in <a href="http://media.netapp.com/documents/tr-3428.pdf">TR-3428</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://andyleonard.com/2009/11/20/interesting-linux-vm-crash-pattern/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Keeping your RHEL VMs from crushing your storage at 4:02am</title>
		<link>http://andyleonard.com/2009/11/19/keeping-your-rhel-vms-from-crushing-your-storage-at-402am/</link>
		<comments>http://andyleonard.com/2009/11/19/keeping-your-rhel-vms-from-crushing-your-storage-at-402am/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 19:39:30 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[operating systems]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[locate]]></category>
		<category><![CDATA[mlocate]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[scientific linux]]></category>
		<category><![CDATA[slocate]]></category>
		<category><![CDATA[updatedb]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://andyleonard.com/?p=315</guid>
		<description><![CDATA[Running a lot of Red Hat VMs in your virtual infrastructure, on shared storage? CentOS, Scientific Linux, both versions 4 and 5, they count for these purposes; Fedora should likely be included too. Do you have the slocate (version 4.x and earlier) or mlocate (version 5.x) RPMs installed? If you&#8217;re uncertain, check using the following: [...]]]></description>
			<content:encoded><![CDATA[<p>Running a lot of Red Hat VMs in your virtual infrastructure, on shared storage?  CentOS, Scientific Linux, both versions 4 and 5, they count for these purposes; Fedora should likely be included too.  Do you have the slocate (version 4.x and earlier) or mlocate (version 5.x) RPMs installed?  If you&#8217;re uncertain, check using the following:</p>
<p><code>> rpm -q slocate<br />
slocate-2.7-13.el4.8.i386</code></p>
<p>or</p>
<p><code>> rpm -q mlocate<br />
mlocate-0.15-1.el5.2.x86_64</code></p>
<p>If so, multiple RHEL VMs plus mlocate or slocate may be adding up to an array-crushing 4:02am shared storage load and latency spike for you.  Before being addressed, this spike was bad enough at my place of employment (when combined with a NetApp Sunday-morning disk scrub) to cause a Windows VM to crash with I/O errors.  Ouch.<br />
<span id="more-315"></span><br />
<strong>Details and ideas for resolution:</strong></p>
<p>By default, a line in /etc/crontab runs the scripts within /etc/cron.daily at 4:02am each morning:</p>
<p><code>02 4 * * * root run-parts /etc/cron.daily</code></p>
<p>One of those scripts &#8211; mlocate.cron or slocate.cron, depending on your OS version &#8211; launches updatedb; as the man page says, &#8220;updatedb  creates  or  updates  a  database  used by locate(1).&#8221;  (The &#8220;locate&#8221; binary is a filesystem search tool, see &#8220;man locate&#8221; for more information.)  Updatedb refreshes its database by walking the filesystem, generating a fair amount of I/O on a single system.  Imagine upwards of thirty of these running in parallel through VMDKs on one shared storage system carrying out internal maintenance at the same time, and you&#8217;re pretty much picturing the problem my employer had.</p>
<p>I see <strong>three options</strong> for addressing this issue:</p>
<p><strong>1) Uninstall mlocate or slocate.</strong>  If you don&#8217;t currently use &#8220;locate&#8221; and you&#8217;re not interested in learning to use a tool that will likely make you more effective at your job (again, see &#8220;man locate&#8221;), this is probably the best option.  (Yeah, I know, people that fit this bill generally don&#8217;t read blogs more technical than <a href="http://perezhilton.com/">this one</a>, so I could probably have skipped it here.  Consider it an option for completeness, or if you really need to strip down an install.)</p>
<p><strong>2) Disable the scheduled job by removing mlocate.cron or slocate.cron from /etc/cron.daily.</strong>  This keeps locate available for your use, but requires that you update locate&#8217;s database ad-hoc and interactively by running the following as root:</p>
<p><code># updatedb</code></p>
<p>This will take a few minutes to return, depending on the size of your file systems.</p>
<p>I don&#8217;t recommend this option either; at least it doesn&#8217;t fit the way I work.  I often find myself using locate in high-pressure situations in which I need to quickly get a file location on a system.  Waiting minutes for updatedb to return is extra painful when every second counts.</p>
<p><strong>3) Stagger when updatedb runs by inserting a random delay into the script.</strong>.  This is my preferred alternative; locate&#8217;s database is kept current automatically, and your storage doesn&#8217;t have to bear a sudden spike in load.  I implemented this by adding the lines in <strong>bold</strong> (lines 2-7 if your browser doesn&#8217;t display the bold text clearly): </p>
<p><code>#!/bin/sh<br />
<strong># sleep up to two hours before launching job:<br />
value=$RANDOM<br />
while [ $value -gt 7200 ] ; do<br />
  value=$RANDOM<br />
done<br />
sleep $value</strong><br />
nodevs=$(< /proc/filesystems awk '$1 == "nodev" { print $2 }')<br />
renice +19 -p $$ >/dev/null 2>&#038;1<br />
/usr/bin/updatedb -f "$nodevs"<br />
</code></p>
<p>The added code inserts a pseudo-random sleep delay of up to two hours before updatedb runs, with the key being the built-in Bash function <a href="http://tldp.org/LDP/abs/html/randomvar.html">$RANDOM</a>.  In our environment, this removed a 2000 IOPS spike at 4:02am, and eliminated a corresponding jump in filer latency.  Obviously, adjust the delay period as appropriate for your environment.  Additionally, be sure to add this change to your configuration management or installation management tools so that all of your RHEL and RHEL-derived VMs get the updated script.</p>
<p>Using $RANDOM to avoid this variant of the <a href="http://en.wikipedia.org/wiki/Thundering_herd_problem">thundering herd problem</a> also works nicely for a range of similar problems; I believe I first saw it at <a href="http://www.moundalexis.com/archives/000076.php">Moundalexis.com</a>.</p>
<p>(This problem may apply to other Linux distributions being run as VMs, and FreeBSD does something equivalent &#8211; weekly &#8211; with /etc/periodic/weekly/310.locate.  A similar solution can be applied to these environments, if necessary.)</p>
]]></content:encoded>
			<wfw:commentRss>http://andyleonard.com/2009/11/19/keeping-your-rhel-vms-from-crushing-your-storage-at-402am/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Kickstarting CentOS 5.1 &#8211; Not from a yum repository any more</title>
		<link>http://andyleonard.com/2008/02/15/kickstarting-centos-51-not-from-a-yum-repository-any-more/</link>
		<comments>http://andyleonard.com/2008/02/15/kickstarting-centos-51-not-from-a-yum-repository-any-more/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 14:47:27 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[operating systems]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[kickstart]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[pxe]]></category>

		<guid isPermaLink="false">http://andyleonard.com/2008/02/15/kickstarting-centos-51-not-from-a-yum-repository-any-more/</guid>
		<description><![CDATA[In the past, I&#8217;ve used our local mirror of the CentOS yum repository to kickstart machines booted using PXE; apparently, this no longer works with CentOS 5.1, although it did with 5.0. If you attempt to do so, after the initial PXE boot, you get the following message: The CentOS installation tree in that directory [...]]]></description>
			<content:encoded><![CDATA[<p>In the past, I&#8217;ve used our local mirror of the CentOS yum repository to kickstart machines booted using PXE; apparently, this no longer works with CentOS 5.1, although it did with 5.0.  If you attempt to do so, after the initial PXE boot, you get the following message:</p>
<p><code><br />
The CentOS installation tree in that directory does not seem to match your boot media.<br />
</code><br />
<span id="more-16"></span><br />
The solution?  Download the 5.1 DVD iso image, copy its contents to your disk and re-run the &#8220;pxeos&#8221; command to use that as your installation tree.  I&#8217;m not sure if this was an oversight or a conscious change on the part of the CentOS project (or if the yum repository method was never supported in the first place), but it stumped me for a little while, so I thought I&#8217;d post it here.</p>
]]></content:encoded>
			<wfw:commentRss>http://andyleonard.com/2008/02/15/kickstarting-centos-51-not-from-a-yum-repository-any-more/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

