<?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</title>
	<atom:link href="http://andyleonard.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://andyleonard.com</link>
	<description>qstat -u aleonard -s z</description>
	<lastBuildDate>Thu, 10 Dec 2009 04:14:55 +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>Drupal Deployment Sysadmin Best Practices</title>
		<link>http://andyleonard.com/2009/12/09/drupal-deployment-sysadmin-best-practices/</link>
		<comments>http://andyleonard.com/2009/12/09/drupal-deployment-sysadmin-best-practices/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 04:14:55 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://andyleonard.com/?p=401</guid>
		<description><![CDATA[Drupal is a popular open source CMS reportedly used on tens of thousands of sites ranging from personal blogs to whitehouse.gov; for readers of this blog, it probably requires no further introduction.
Despite its many desirable features and continuing popularity, Drupal is not without its shortcomings, as many readers are also likely aware.  Although Drupal [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://drupal.org/">Drupal</a> is a popular open source CMS reportedly used on tens of thousands of sites ranging from personal blogs to <a href="http://www.whitehouse.gov/">whitehouse.gov</a>; for readers of this blog, it probably requires no further introduction.</p>
<p>Despite its many desirable features and continuing popularity, Drupal is not without its shortcomings, as many readers are also likely aware.  Although Drupal has an active and responsive <a href="http://drupal.org/security-team">security team</a>, the software has a long track record of requiring frequent security patches &#8211; Secunia has seven 2009 advisories for <a href="http://secunia.com/advisories/product/17839/?task=advisories_2009">Drupal 6.x</a> listed as of this writing.  Although by its nature an apples-to-oranges comparison, this ranks Drupal behind similarly large and complex PHP projects such as <a href="http://secunia.com/advisories/product/6745/?task=advisories_2009">Wordpress 2.x</a> (5) and <a href="http://secunia.com/advisories/product/5879/?task=advisories_2009">Gallery 2.x</a> (0) &#8211; and the number for Drupal does not include dozens of additional advisories for Drupal modules.  Further, Drupal has <a href="http://drupal.org/node/360605">struggled and lagged</a> with support for PHP 5.3.x, suggesting to this outside observer that the project is having difficulties maintaining its codebase.</p>
<p>All that being said, I do not personally believe that the above issues rule out using Drupal; the benefits outweigh the shortcomings.  So, assuming the question is not whether to deploy Drupal, but how to do so most securely and efficiently, my recommendations from a systems administration perspective are below.<br />
<span id="more-401"></span><br />
<strong>Goals</strong></p>
<p>The recommendations described stem from three goals for a Drupal installation:</p>
<ol>
<li><strong>Security</strong> &#8211; Avoid compromise of your site and system.</li>
<li><strong>Flexibility</strong> &#8211; Create an environment that allows for easy modification of the OS, server and application, and provides for straightforward roll-back of those changes should those need arise.</li>
<li><strong>Stability and Security over Performance</strong> &#8211; Although not mutually exclusive, designing for stability and security can entail trade-offs that may impact performance.  I don&#8217;t directly address performance in these recommendations.</li>
</ol>
<p>The below recommendations are written assuming that the sysadmin (you) responsible for the Drupal server and the developer are two different people.  If you wear both hats, the recommendations can obviously adapted to fit your dual role.</p>
<p><strong>Recommendations</strong></p>
<ol>
<li><strong>Insist on the latest version of Drupal, and plan to upgrade as Drupal releases come out.</strong>  Some developers may be hesitant to use the latest (stable) version of Drupal, but Drupal&#8217;s security track record dictates this; anything else is not serving the site owner&#8217;s interests.</li>
<li><strong>Use the latest supported version of PHP.</strong>  Drupal&#8217;s PHP version requirements are more brittle than most applications; the latest version of PHP is almost always the most stable and secure version.  Combining the two is obvious: Aggressively track latest version of PHP that Drupal supports.  Additionally, use the latest version of your preferred web server and patch as it is updated.  Note that this implies a source-based installation of PHP and your web server instead of a package-based installation from your distribution.  Carefully consider your build and deployment strategies with an eye towards reproducibility, documentation and ease of roll-back should a problem arise.</li>
<li><strong>Isolate Drupal from other applications.</strong>  Run Drupal on its own system &#8211; physical or virtual &#8211; and in doing so, reduce operating complexity while limiting collateral damage if your Drupal instance should be compromised.  Depending on your backup strategy, don&#8217;t overlook the possibility that running a VM may have obvious recovery and forensic advantages over a physical install should your Drupal site get broken into.</li>
<li><strong>mod_security</strong> &#8211; Consider integrating a &#8220;web application firewall&#8221; such as <a href="http://www.modsecurity.org/">mod_security</a> directly into your web server.  Carefully evaluate the trade-off of additional complexity for enhanced security in your environment.</li>
<li><strong>Deploy a host-based firewall for inbound and outbound traffic</strong> &#8211; This has two functions &#8211; prevent your server from being compromised through a hole in a service other than your web server, and limit damage to other systems if/when you are compromised.  There&#8217;s a decent chance that the only external service you need exposed other than HTTP for your Drupal site is SSH for remote management &#8211; and you can probably lock that down to a very limited set of IP addresses.  And, in the situation where your server is compromised, outbound rules can reduce the ability of your server to attack other machines: Consider, for example, the effect of an outbound rule on port 25 if an attacker attempts to use your compromised server as a spam bot.</li>
<li><strong>Use SELinux</strong> &#8211; Security-Enhanced Linux provides a the ability to audit and possibly deny actions on your system through <a href="http://en.wikipedia.org/wiki/Mandatory_access_control">mandatory access control policies</a>.  You will likely want to run SELinux in &#8220;permissive&#8221; mode before your site is publicly available, at which point you would switch to &#8220;enforcing&#8221; mode; &#8220;audit2allow&#8221; and &#8220;audit2why&#8221; can be very helpful tools when developing policies.  See &#8220;man selinux&#8221; for more information.</li>
<li><strong>Use a Sysadmin Staging Server</strong> &#8211; The site developer likely has a staging instance of Drupal for testing out their code changes; deploy a similar environment for testing Sysadmin changes, such as PHP updates or the latest version of Drupal with your code.  Consider using a software testing framework such as <a href="http://seleniumhq.org/">Selenium</a> to automate the tests you run on the sysadmin staging site.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://andyleonard.com/2009/12/09/drupal-deployment-sysadmin-best-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test Driving Google Public DNS (Updated with OpenDNS comparison)</title>
		<link>http://andyleonard.com/2009/12/03/test-driving-google-publi-dns/</link>
		<comments>http://andyleonard.com/2009/12/03/test-driving-google-publi-dns/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 19:31:16 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[comcast]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[opendns]]></category>

		<guid isPermaLink="false">http://andyleonard.com/?p=414</guid>
		<description><![CDATA[Google announced its Public DNS service this morning, claiming enhanced performance and security; I took it for a brief test drive with the following results.
(See bottom of post for an update running similar tests on OpenDNS.)
Methods: I searched Google for keywords that I believed fell somewhere between obscure and common and collected the first ten [...]]]></description>
			<content:encoded><![CDATA[<p>Google announced its <a href="http://code.google.com/speed/public-dns/">Public DNS</a> service this morning, claiming enhanced <a href="http://code.google.com/speed/public-dns/docs/performance.html">performance</a> and <a href="http://code.google.com/speed/public-dns/docs/security.html">security</a>; I took it for a brief test drive with the following results.</p>
<p>(See bottom of post for an update running similar tests on OpenDNS.)</p>
<p><strong>Methods:</strong> I searched Google for <a href="http://www.google.com/search?q=lightweight+backpacking">keywords</a> that I believed fell somewhere between obscure and common and collected the first ten hostnames printed on the screen.  I then used local installations of dig to query a collection of DNS servers for the hostnames&#8217; A records and collected the response times.  The different resolvers used were:</p>
<ul>
<li>A local BIND installation (127.0.0.1, cache empty) with Comcast Internet connectivity;</li>
<li>A Comcast DNS server (68.87.69.150) via Comcast Internet connectivity;</li>
<li>My employer&#8217;s internal caching DNS;</li>
<li>Google (8.8.8.8) via my employer&#8217;s Internet connectivity (mostly Level 3);</li>
<li>Google (8.8.8.8) via Comcast; and</li>
<li>Google (8.8.8.8) via an Amazon EC2 instance in us-east-1a.</li>
</ul>
<p>Anticipating a bimodal distribution of results, I assumed high latency responses were cache misses, while low latency responses were cache hits, and categorized results correspondingly.<br />
<span id="more-414"></span><br />
<strong>Limitations:</strong> Chiefly, the small number of hostnames queried.  Results from a larger group of domains would be more conclusive.</p>
<p><strong>Results:</strong> Given in the format of Server/Connectivity: Cache Miss/Cache Hit</p>
<ul>
<li>Local BIND server/Comcast: 319ms/0ms</li>
<li>Comcast/Comcast: 166ms/14ms</li>
<li>Google/Comcast: no misses/73ms</li>
<li>Employer/Level 3: 235ms/30ms</li>
<li>Google/Level 3: 204ms/44ms</li>
<li>Google/EC2: 190ms/4ms</li>
</ul>
<p>I concluded that Google/Comcast had no misses by testing another set of obscure hostnames twice each, noting that the first query was slower (~120ms) and the second query was similar in latency to the results above (70ms).  (My belief is that I inadvertently pre-populated the cache for Google/Comcast by my tests elsewhere.)</p>
<p><strong>Discussion:</strong></p>
<ul>
<li><strong>It&#8217;s all about cache hits.</strong>  Whichever resolver gives you the most cache hits will give you the best performance; cache misses are at least an order of magnitude slower than cache hits.  In this extremely limited test, the cache-hits-champion appears to be Google.  Excluding Google/Comcast, where I believe I pre-populated Google&#8217;s cache, Google had a 50% cache hit rate, while Comcast and my Employer only hit 20%.
<li><strong>Location, location, location.</strong>  Secondary to cache hits, the closer the resolver is to you, the better.  Looking at the Comcast results, it&#8217;s hard to get closer than localhost, and, as seems logical, Comcast&#8217;s resolvers have lower cached latency than Google&#8217;s.  <strong>Running a local caching resolver forwarding to Google may be a desirable configuration.</strong></li>
<li><strong>Resolver behavior matters.</strong>  Comcast is notorious for <a href="http://www.dslreports.com/shownews/Comcast-DNS-Redirection-Goes-Nationwide-103762">poor behavior</a>.  It&#8217;s reasonable to expect that Google will be mining your DNS query data.  <strong>Running a slower but directly-controlled local, non-forwarding server may be preferable for privacy and security reasons.</strong></li>
</ul>
<p><strong>Update:</strong>  At the <a href="http://twitter.com/tscalzott/status/6313122948">suggestion</a> of <a href="http://twitter.com/tscalzott">@tscalzott</a>, I researched OpenDNS&#8217;s performance with the same set of hostnames via the same connectivity on their DNS resolvers at 208.67.222.222.  This time, however, I queried the A record for each hostname twice in rapid succession to ascertain how many of my queries were served from OpenDNS&#8217;s cache.  Results are in the format:</p>
<p>DNS Server/Connectivity: Cache miss/Cache hit &#8211; cache hit rate</p>
<ul>
<li>OpenDNS/Comcast: 218ms/30ms &#8211; 20%</li>
<li>OpenDNS/EC2: 144ms/2ms &#8211; 10%</li>
<li>OpenDNS/Level 3: 230ms/4ms &#8211; 40%</li>
</ul>
<p>Compared to Google, OpenDNS had similar latency for cache misses and lower latency for cache hits, but appears to possibly have a lower cache hit rate.  It seems likely that the latency &#8220;winner&#8221; for each user&#8217;s individual situation will depend on where they are on the Internet relative to the nearest Google and OpenDNS installations.  Google&#8217;s greater cache hit rate suggests it may offer better service, but testing a larger number of hostnames would be necessary before being able to state that with any certainty.</p>
<p><strong>Disclosure:</strong> I use Google&#8217;s free Apps services to host personal email, and I use their public sites (Search, Reader, News, Analytics, etc.) extensively.  I recently attended a Google Apps for the Enterprise dog-and-pony show where I received a number of small tchotchkes; my wife took the notebook, I kept the pen and binder and threw the rest away.  My employer uses Postini.  I tried OpenDNS briefly several months back, but did not use them long-term because of limitations in my own configuration.</p>
]]></content:encoded>
			<wfw:commentRss>http://andyleonard.com/2009/12/03/test-driving-google-publi-dns/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Migrating from self-hosted email to Google Apps for Domains</title>
		<link>http://andyleonard.com/2009/11/24/migrating-from-self-hosted-email-to-google-apps-for-domains/</link>
		<comments>http://andyleonard.com/2009/11/24/migrating-from-self-hosted-email-to-google-apps-for-domains/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 03:01:40 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[personal tech]]></category>
		<category><![CDATA[utility computing]]></category>
		<category><![CDATA[cyrus]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[imapsync]]></category>

		<guid isPermaLink="false">http://andyleonard.com/?p=366</guid>
		<description><![CDATA[I recently moved my personal email from a self-managed Exim/Cyrus setup on a dedicated FreeBSD server to Gmail (Google Apps for Domains).  This migration was motivated by a desire to reduce expenses, reduce time spent managing mail software and the importance of email (for me, personally) dropping to a level where I was willing [...]]]></description>
			<content:encoded><![CDATA[<p>I recently moved my personal email from a self-managed Exim/Cyrus setup on a dedicated FreeBSD server to Gmail (<a href="http://www.google.com/apps/intl/en/group/index.html">Google Apps for Domains</a>).  This migration was motivated by a desire to reduce expenses, reduce time spent managing mail software and the importance of email (for me, personally) dropping to a level where I was willing to accept the risks inherent in outsourcing it.  Details of the exact process I used to migrate mail are below.</p>
<p><strong>Assumptions:</strong> An IMAP interface to your current email, basic comptency at managing DNS, and the ability to run the <a href="http://www.linux-france.org/prj/imapsync/README">imapsync</a> Perl script (built via FreeBSD ports in my case, but installation should be straightforward under most UNIX or Linux systems).<br />
<span id="more-366"></span><br />
<strong>0.</strong> Ensure your domain registration is up to date and with a reputable registrar (Pro tip: if you have to wade through pages of deceptive and needless up-sells with your registrar, they&#8217;re not reputable), and fully independent from anything you have set up with Google.  Ensure your DNS configuration is completely correct; if you&#8217;re unsure whether or not it is, buy a membership at <a href="http://www.dnsstuff.com/">DNSstuff</a>, run its tests on your domains, and fix the relevant problems.  If you don&#8217;t fully host your own DNS &#8211; and chances are, if you&#8217;re outsourcing your email, you probably don&#8217;t host your own DNS &#8211; I recommend using two independent DNS providers.  Hosted DNS service that&#8217;s worth spending money with will be able to function as a secondary and allow zone transfers &#8211; and, while you&#8217;re at it, make sure your chosen provider supports <a href="http://www.rfc-archive.org/getrfc.php?rfc=1996">DNS NOTIFY</a> &#8211; it&#8217;ll make changing your MX records in a timely fashion that much easier.  Whatever you do, don&#8217;t use your registrar&#8217;s DNS servers.</p>
<p>You occasionally see <a href="http://discuss.joelonsoftware.com/default.asp?biz.5.730915.0">sad tales of Google Apps woe</a> which could have been mitigated by independent domain registration and a moderate knowledge of DNS.  Don&#8217;t risk becoming another bitter messageboard-posting statistic.</p>
<p>In summary: Don&#8217;t understand DNS or don&#8217;t have time for it?  Stop reading now; either hire a consultant to do the work, or accept that outsourced email probably isn&#8217;t right for you.</p>
<p><strong>0.1.</strong> This goes hand-in-hand with step 0 above: Have an off-Google backup system for your email &#8211; one that runs unattended, automatically, just like a &#8220;real&#8221; backup system would be.  Google has its strong points, but customer service for their free products isn&#8217;t one of them.  If Google should update their <a href="http://en.wikipedia.org/wiki/Don%27t_be_evil">unofficial motto</a> to a more succinct &#8220;be evil&#8221; you want to have an &#8220;out&#8221; and the ability to migrate your mail elsewhere.  Imapsync, linked to above and described below, can be adapted for this purpose.</p>
<p><strong>0.2</strong> Install and test imapsync before beginning this process.  This is the best tool that I&#8217;ve found for syncing mailboxes between servers; all others I tried were unreliable, and documentation below will be specific to it.  In theory, another tool could work &#8211; IMAP is IMAP and a standard &#8211; but I leave using other migration tools as an exercise for the reader.</p>
<p><strong>1.</strong> Drop your MX record TTL to a suitably low value; I used 60 seconds during my migration.  Let the older, presumably greater TTL age off prior to making any further changes to your MX records (as in step 7 below).</p>
<p><strong>2.</strong> <a href="http://www.google.com/a/cpanel/domain/new">Sign up</a> your domain for Google Apps, and use DNS to verify control.</p>
<p><strong>3.</strong> Create users for the domain, and accept terms.  A best practice would be to use different passwords on Gmail from what users currently have, and do note that you will need both old and new passwords for the synchronization step.  (If you are currently running a Cyrus IMAP server with sasldb, passwords can be extracted by running &#8220;db3_dump185 -p sasldb2.db&#8221; as a user that can read sasldb.)</p>
<p><strong>4.</strong> In the Google Apps control panel, create distribution lists and aliases (&#8220;nicknames&#8221;) for your users as appropriate.</p>
<p><strong>5.</strong> For each Gmail mailbox, enable IMAP: Settings > Forwarding and POP/IMAP: Enable IMAP.</p>
<p><strong>6.</strong> If appropriate (and assuming you have other users in your domain), have users verify their logins and familiarize themselves with Gmail&#8217;s options.</p>
<p><strong>7.</strong> Change your <a href="http://www.google.com/support/a/bin/answer.py?answer=33352">MX records</a> to point to Google; keep your TTL low in case you need to change back to your old servers.</p>
<p><strong>8.</strong> Verify delivery to your new Gmail mailboxes by sending test messages from a third-party address.</p>
<p><strong>9.</strong> Set an appropriate <a href="http://www.google.com/support/a/bin/answer.py?hl=en&#038;answer=33786">SPF record</a> for your domain in DNS.</p>
<p><strong>10.</strong> Sync your old mailboxes with your new; I recommend running imapsync directly on your mail server, if possible, for best performance.  Example imapsync session for a Cyrus inbox:</p>
<p><code>imapsync --host1 mail.example.com --port1 143 --user1 user@example.com --password1 [...] --prefix1 INBOX. --host2 imap.gmail.com --port2 993 --user2 user@example.com --password2 [...] --ssl2 --folder INBOX</code></p>
<p>(Insert passwords as appropriate.)</p>
<p>Example imapsync session for a Cyrus folder other than the inbox:</p>
<p><code>imapsync --host1 mail.example.com --port1 143 --user1 user@example.com --password1 [...] --prefix1 INBOX. --host2 imap.gmail.com --port2 993 --user2 user@example.com --password2 [...] --ssl2 --folder INBOX.saved-messages</code></p>
<p>Note that Gmail has certain reserved labels that you cannot sync directly to, such as &#8220;Sent&#8221;.  In this case, you&#8217;ll need to use the &#8220;regextrans2&#8243; flag to sync to a different folder:</p>
<p><code>imapsync --host1 mail.example.com --port1 143 --user1 user@example.com --password1 [...] --prefix1 INBOX. --host2 imap.gmail.com --port2 993 --user2 use@example.com --password2 [...] --ssl2 --folder INBOX.Sent --regextrans2 's/Sent/Old-Sent/'</code></p>
<p><strong>11.</strong> After double checking that your old MX record&#8217;s TTL has passed, and no new mail is being delivered to your old mail server, decommission it as necessary.</p>
]]></content:encoded>
			<wfw:commentRss>http://andyleonard.com/2009/11/24/migrating-from-self-hosted-email-to-google-apps-for-domains/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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]
[&#60;f88c19ce&#62;] mptscsih_io_done+0x5ee/0x608 [mptscsi] (…)
[&#60;c02de564&#62;] [...]]]></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 [...]]]></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>2</slash:comments>
		</item>
		<item>
		<title>Running NetApp&#8217;s aggrSpaceCheck without turning on RSH</title>
		<link>http://andyleonard.com/2009/06/24/running-netapps-aggrspacecheck-without-turning-on-rsh/</link>
		<comments>http://andyleonard.com/2009/06/24/running-netapps-aggrspacecheck-without-turning-on-rsh/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 22:08:43 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[storage]]></category>
		<category><![CDATA[aggrSpaceCheck]]></category>
		<category><![CDATA[netapp]]></category>

		<guid isPermaLink="false">http://andyleonard.com/?p=299</guid>
		<description><![CDATA[When upgrading a NetApp filer from a pre-7.3 release to 7.3, metadata is apparently moved from within the FlexVol into the containing aggregate.  If your aggregate is tight on space &#8211; more than 96% full &#8211; NetApp requires that you complete extra verification steps to ensure that you can complete the upgrade.  From [...]]]></description>
			<content:encoded><![CDATA[<p>When upgrading a NetApp filer from a pre-7.3 release to 7.3, metadata is apparently moved from within the FlexVol into the containing aggregate.  If your aggregate is tight on space &#8211; more than 96% full &#8211; NetApp requires that you complete extra verification steps to ensure that you can complete the upgrade.  From the <a href="http://now.netapp.com/NOW/knowledge/docs/ontap/rel7311/pdfs/ontap/rnote.pdf">Data ONTAP® 7.3.1.1 Release Notes</a> (NOW login required):</p>
<blockquote><p>If you suspect that your system has almost used all of its free space, or if you use thin provisioning, you should check the amount of space in use by each aggregate. If any aggregate is 97 percent full or more, do not proceed with the upgrade until you have used the Upgrade Advisor or aggrSpaceCheck tools to determine your system capacity and plan your upgrade.</p></blockquote>
<p>Upgrade Advisor is a great tool, and I heartily recommend you use it for your upgrade.  However, it doesn&#8217;t give you a lot of visibility into what&#8217;s being checked for here.  Lucky for us, NetApp offers an alternative tool: <a href="http://now.netapp.com/NOW/download/tools/aggrSpaceCheck/download.shtml">aggrSpaceCheck</a> (NOW login required).<br />
<span id="more-299"></span><br />
AggrSpaceCheck, as written, relies on you having rsh turned on for access to the filer &#8211; something that you probably locked down when you were still wearing acid-washed jeans.  Assuming you don&#8217;t have rsh access, you&#8217;ll see an error like this when you attempt to run aggrSpaceCheck:</p>
<p><code>&gt; perl aggrSpaceCheck.pl -filer toaster01</p>
<p>aggrSpaceCheck V1.0.0 Copyright (c) 2008 NetApp </p>
<p>Could not retrieve Aggregate free space. Could not get any aggregates in this filer<br />
</code></p>
<p>The fix is easy, however, if you&#8217;re using SSH: Edit the aggrSpaceCheck.pl file, replacing &#8220;rsh&#8221; with &#8220;ssh&#8221; (you only need to actually edit it in the line where &#8220;$remCmd&#8221; is defined, but changing rsh to ssh elsewhere won&#8217;t hurt).  You will be prompted for root&#8217;s SSH password repeatedly &#8211; once for each command run remotely on the filer:</p>
<p><code>&gt; perl aggrSpaceCheck.pl -filer toaster01</p>
<p>aggrSpaceCheck V1.0.0 Copyright (c) 2008 NetApp<br />
root@toaster01's password:<br />
root@toaster01's password:<br />
root@toaster01's password:<br />
root@toaster01's password:<br />
root@toaster01's password:<br />
root@toaster01's password:<br />
root@toaster01's password:<br />
root@toaster01's password:<br />
root@toaster01's password:<br />
root@toaster01's password: </p>
<p>Aggregate aggr0 requires 54.18GB for volume metadata; 137.76GB is available.<br />
Aggregate aggr0 has enough free space for you to upgrade to<br />
Data ONTAP 7.3 or later.<br />
</code></p>
<p>There&#8217;s a solution for this too, of course: Enable SSH key pair authentication from your management host to your filer &#8211; no more password prompts:</p>
<p><code>&gt; perl aggrSpaceCheck.pl -filer toaster01</p>
<p>aggrSpaceCheck V1.0.0 Copyright (c) 2008 NetApp </p>
<p>Aggregate aggr0 requires 54.18GB for volume metadata; 137.76GB is available.<br />
Aggregate aggr0 has enough free space for you to upgrade to<br />
Data ONTAP 7.3 or later.<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://andyleonard.com/2009/06/24/running-netapps-aggrspacecheck-without-turning-on-rsh/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NetApp FAS2020 aggregate capacity on ONTAP 7.3.1 &#8211; now 16TB</title>
		<link>http://andyleonard.com/2009/06/23/netapp-fas2020-aggregate-capacity-on-ontap-7-3-1/</link>
		<comments>http://andyleonard.com/2009/06/23/netapp-fas2020-aggregate-capacity-on-ontap-7-3-1/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 17:41:45 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[storage]]></category>
		<category><![CDATA[fas2020]]></category>
		<category><![CDATA[netapp]]></category>

		<guid isPermaLink="false">http://andyleonard.com/?p=289</guid>
		<description><![CDATA[My NetApp FAS 2020 Sizing post remains popular nearly a year after I wrote it.  However, with ONTAP 7.3.1 (and later releases) out, it&#8217;s also out of date.  Here&#8217;s current information from p. 33 of the ONTAP 7.3.1.1 release notes (NOW login required):
Beginning with Data ONTAP 7.3.1, FAS2020 systems support aggregates up to [...]]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://andyleonard.com/2008/08/04/netapp-fas-2020-sizing/">NetApp FAS 2020 Sizing</a> post remains popular nearly a year after I wrote it.  However, with ONTAP 7.3.1 (and later releases) out, it&#8217;s also out of date.  Here&#8217;s current information from p. 33 of the <a href="http://now.netapp.com/NOW/knowledge/docs/ontap/rel7311/pdfs/ontap/rnote.pdf">ONTAP 7.3.1.1 release notes</a> (NOW login required):</p>
<blockquote><p>Beginning with Data ONTAP 7.3.1, FAS2020 systems support aggregates up to 16 TB raw capacity,<br />
provided that the root volume is hosted in a dedicated aggregate (that is, one that contains only the root<br />
volume and no user data).</p></blockquote>
<p>The release notes go on to point out an alternative to the dedicated root aggregate &#8211; having two spare disks per controller.</p>
<p>It&#8217;s nice to see the FAS2020 finally getting a maximum aggregate size on par with the rest of NetApp&#8217;s product line.  However, in an era where 2TB drives are available from Western Digital &#8211; and presumably other manufacturers before too long &#8211; ONTAP&#8217;s 16TB aggregate limit grows increasingly anachronistic.</p>
]]></content:encoded>
			<wfw:commentRss>http://andyleonard.com/2009/06/23/netapp-fas2020-aggregate-capacity-on-ontap-7-3-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SnapManager for Exchange/SnapVault Integration Requirements</title>
		<link>http://andyleonard.com/2009/06/18/snapmanager-for-exchange-requires-dfm-protection-manager/</link>
		<comments>http://andyleonard.com/2009/06/18/snapmanager-for-exchange-requires-dfm-protection-manager/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 18:00:01 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[storage]]></category>
		<category><![CDATA[datafabric manager]]></category>
		<category><![CDATA[exchange]]></category>
		<category><![CDATA[netapp]]></category>
		<category><![CDATA[protection manager]]></category>
		<category><![CDATA[sme]]></category>
		<category><![CDATA[snapmanager]]></category>
		<category><![CDATA[snapvault]]></category>

		<guid isPermaLink="false">http://andyleonard.com/?p=282</guid>
		<description><![CDATA[Update: NetApp has a KB article in NOW addressing this: Using SnapVault to Archive SnapManager for Exchange Backups Sets.  Bottom line: You do not necessarily need ONTAP 7.3, Protection Manager and DataFabric Manager to send SnapManager for Exchange snapshots to a SnapVault secondary.
We recently acquired SnapManager for Exchange (SME) at my place of employment. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update: NetApp has a KB article in NOW addressing this: <a href="https://now.netapp.com/Knowledgebase/solutionarea.asp?id=kb3990">Using SnapVault to Archive SnapManager for Exchange Backups Sets</a>.  Bottom line: You do not necessarily need ONTAP 7.3, Protection Manager and DataFabric Manager to send SnapManager for Exchange snapshots to a SnapVault secondary.</strong></p>
<p>We recently acquired SnapManager for Exchange (SME) at my place of employment.  We have an existing NetApp deployment consisting of two primary filers in a SnapVault arrangement with a third filer.  The SME install is part of an upgrade from Exchange 2003 (on DAS) to 2007 (on Fibre Channel storage).</p>
<p>What we missed prior to purchasing SME: If you want to use SnapVault with SME, you need two additional pieces of software: Protection Manager and NetApp Management Console (part of DataFabric Manager, apparently).  Here&#8217;s what p. 408 of the <a href="http://now.netapp.com/NOW/knowledge/docs/SnapManager/relsme50/pdfs/admin.pdf">SnapManager® 5.0 for Microsoft® Exchange Installation and Administration Guide</a> (NOW login required) says:</p>
<blockquote><p>The following are the software dependencies for integrating SnapManager with<br />
data set and SnapVault:</p>
<p>◆ Protection Manager 3.7 and later<br />
◆ NetApp Management Console 3.7 and later<br />
◆ SnapDrive for Windows 6.0 and later<br />
◆ Data ONTAP 7.3 or later </p></blockquote>
<p>Wish I&#8217;d known that sooner.</p>
<p>(This is the point where some random NetApp fanboy pops down to the comments and fires off something about how NetApp is the greatest storage company ever, and if I&#8217;d done appropriate due diligence, I wouldn&#8217;t have missed this requirement.  My advice: Spare us, smart guy.  I&#8217;m writing this post to make it easier for other NetApp customers to do their &#8220;due diligence&#8221;.)</p>
]]></content:encoded>
			<wfw:commentRss>http://andyleonard.com/2009/06/18/snapmanager-for-exchange-requires-dfm-protection-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMware/NFS/NetApp SnapRestore/Linux LVM Single File Recovery Notes</title>
		<link>http://andyleonard.com/2009/06/01/vmwarenfsnetapp-snaprestorelinux-lvm-single-file-recovery-notes/</link>
		<comments>http://andyleonard.com/2009/06/01/vmwarenfsnetapp-snaprestorelinux-lvm-single-file-recovery-notes/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 21:55:54 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[virtualization]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[netapp]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[snaprestore]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[vmware esx]]></category>

		<guid isPermaLink="false">http://andyleonard.com/?p=241</guid>
		<description><![CDATA[There have been a few posts elsewhere discussing file-level recovery for Linux VMs on NetApp NFS datastores, but none that have dealt specifically with Linux LVM-encapsulated partitions.
Here&#8217;s our in-house procedure for recovery; note that we do not have FlexClone licensed on our filers.

Prerequisites

An existing VMware ESX infrastructure, connected to a NetApp filer NFS datastore; SnapRestore [...]]]></description>
			<content:encoded><![CDATA[<p>There have been a few posts <a href="http://storagefoo.blogspot.com/2007/10/vmware-over-nfs-backup-trickscontinued.html">elsewhere</a> discussing file-level recovery for Linux VMs on NetApp NFS datastores, but none that have dealt specifically with Linux LVM-encapsulated partitions.</p>
<p>Here&#8217;s our in-house procedure for recovery; note that we do not have FlexClone licensed on our filers.<br />
<span id="more-241"></span><br />
<strong>Prerequisites</strong></p>
<ul>
<li>An existing VMware ESX infrastructure, connected to a NetApp filer NFS datastore; SnapRestore speeds the recovery process but is not mandatory &#8211; see discussion below.</li>
<li>A backup script or system which coordinates VMware snapshots with NetApp snapshots &#8211; perhaps something along the lines of <a href="http://vmwaretips.com/wp/2008/12/05/netapp-snapshots-in-esx-take-2/">Rick Scherer&#8217;s script</a>.</li>
<li>A dedicated Linux restore VM, at a similar version level to the rest of your Linux VM infrastructure.  This VM should have LVM support, but <em>should not have any volume groups (VGs) or logical volumes (LVs) configured</em> &#8211; volume group and logical volume names on the VMDK you are restoring from must not conflict with VGs and LVs already in use on the restore system; the simplest way to guarantee this is to simply not have any VGs or LVs.</li>
</ul>
<p><strong>Restore Procedure</strong></p>
<ul>
<li>Restore the VMDK file from the appropriate snapshot to a <em>new location</em> in the datastore.  With SnapRestore, this can be done as follows (one line in the filer CLI, restoring from snapshot sv_daily.0 to a new file &#8211; again, <strong>be extremely careful not to overwrite the current version of the VMDK in your datastore</strong>, consider restoring to an entirely different directory in the FlexVol):
<p><code>snap restore -t file -s sv_daily.0<br />
-r /vol/vmware04_sis/system.example.com/system.example.com-restore.vmdk<br />
/vol/vmware04_sis/system.example.com/system.example.com.vmdk</code></p>
<p>Follow the prompts, verifying the restore path is correct and is not the path to your existing VMDK.  Do the same for the flat VMDK file (again, one line, and, as before, <strong>use caution to make sure you do not clobber an existing file</strong>):</p>
<p><code>snap restore -t file -s sv_daily.0<br />
-r /vol/vmware04_sis/system.example.com/system.example.com-restore-flat.vmdk<br />
/vol/vmware04_sis/system.example.com/system.example.com-flat.vmdk</code></p>
<p>Without SnapRestore, you can simply mount the NFS export of the datastore on a Linux machine and use &#8220;cp&#8221; to copy the files out of the snapshot.  For flat VMDK files, expect this copy to run for a substantial amount of time compared the nearly-instant recovery SnapRestore offers.</li>
<li>Manually edit the line below &#8220;# Extent description&#8221; in the recovered .vmdk file to match the path to the recovered flat VMDK.  In this case, it would look something like this:<br />
<code># Extent description<br />
RW 20971520 VMFS "system.example.com-restore-flat.vmdk"</code></li>
<li>Attach the recovered VMDK to your powered-off restore host.  Boot the restore host.</li>
<li>Once your restore host is up, use &#8220;pvscan&#8221;, &#8220;vgscan&#8221; and &#8220;lvscan&#8221; (each without arguments) as root to examine available LVM components.  Then, use the &#8220;lvchange&#8221; command to activate the necessary volume group (in this case, &#8220;VolGroup00&#8243;):<br />
<code># lvchange -ay VolGroup00</code></li>
<li>Mount the appropriate logical volume &#8211; for example, LogVol00 in VolGroup00:<br />
<code>mount -o ro /dev/VolGroup00/LogVol00 /mnt</code><br />
Restore files by copying them out of /mnt.</li>
</ul>
<p><strong>Cleanup</strong></p>
<ul>
<li>Shut down the Linux restore host.</li>
<li>Remove the recovery VMDK &#8211; the files restored with SnapRestore or by &#8220;cp&#8221; above &#8211; from the restore host in the VMware Infrastructure Client.</li>
<li>Delete the recovery .vmdk and -flat.vmdk files in the NFS datastore.  <strong>Don&#8217;t screw up here: Be sure to delete the recovery files only, not the working VMDK.</strong></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://andyleonard.com/2009/06/01/vmwarenfsnetapp-snaprestorelinux-lvm-single-file-recovery-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Data Centers or &#8220;The future is already here. It&#8217;s just not very evenly distributed.&#8221;</title>
		<link>http://andyleonard.com/2009/04/08/google-data-centers-or-the-future-is-already-here-its-just-not-very-evenly-distributed/</link>
		<comments>http://andyleonard.com/2009/04/08/google-data-centers-or-the-future-is-already-here-its-just-not-very-evenly-distributed/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 21:58:01 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[datacenters]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[toyota]]></category>

		<guid isPermaLink="false">http://andyleonard.com/?p=238</guid>
		<description><![CDATA[(William Gibson said that, I believe).

I see echoes of Toyota teaching its Toyota Production System in Google&#8217;s recent release of information about their data centers.  Relatively straightforward concepts &#8211; the challenge is in adapting your existing systems to them.
]]></description>
			<content:encoded><![CDATA[<p>(William Gibson said that, I believe).</p>
<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/zRwPSFpLX8I&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/zRwPSFpLX8I&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
<p>I see echoes of Toyota teaching its Toyota Production System in Google&#8217;s recent release of information about their data centers.  Relatively straightforward concepts &#8211; the challenge is in adapting your existing systems to them.</p>
]]></content:encoded>
			<wfw:commentRss>http://andyleonard.com/2009/04/08/google-data-centers-or-the-future-is-already-here-its-just-not-very-evenly-distributed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
