<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>David Warburton</title>
	<atom:link href="http://blog.davidwarburton.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.davidwarburton.net</link>
	<description>Musings of a VM and storage engineer with a subtle addiction to scripting</description>
	<lastBuildDate>Sun, 13 May 2012 17:04:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.davidwarburton.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>David Warburton</title>
		<link>http://blog.davidwarburton.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.davidwarburton.net/osd.xml" title="David Warburton" />
	<atom:link rel='hub' href='http://blog.davidwarburton.net/?pushpress=hub'/>
		<item>
		<title>vSphere ESXi, vSwitch0, vmk0 and host profiles</title>
		<link>http://blog.davidwarburton.net/2011/03/09/vsphere-esxi-vswitch0-vmk0-and-host-profiles/</link>
		<comments>http://blog.davidwarburton.net/2011/03/09/vsphere-esxi-vswitch0-vmk0-and-host-profiles/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 13:18:12 +0000</pubDate>
		<dc:creator>DavidWarburton</dc:creator>
				<category><![CDATA[ESXi]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://blog.davidwarburton.net/?p=174</guid>
		<description><![CDATA[So I&#8217;ve noticed a rather worrying feature of ESXi (I&#8217;m on 4.1 U1) in the configuration that I have. I&#8217;ve created our ESXi servers to use a vDS for VM traffic but for management, vMotion and FT I am sticking with the local vSwitch0. vSwitch0 has three active NICs and three port-groups, one for each [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=174&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve noticed a rather worrying feature of ESXi (I&#8217;m on 4.1 U1) in the configuration that I have. I&#8217;ve created our ESXi servers to use a vDS for VM traffic but for management, vMotion and FT I am sticking with the local vSwitch0. vSwitch0 has three active NICs and three port-groups, one for each of the above VMkernel tasks (management, vMotion and FT).</p>
<p>These port-groups have the NICs set to a specific order with only 1 active and 2 in standby ensuring that, although only 1 NIC is actively used for each portgroup, the two other NICs are there for failover. A few pics may explain this better&#8230;.</p>
<p><strong>vSwitch0 Overview</strong><img class="aligncenter" title="vSwitch0" src="http://dl.dropbox.com/u/5600134/blog/vswitch0/vsiwtch0.gif" border="1" alt="" width="437" height="213" /></p>
<p><strong>vSwitch0 vSwitch NIC configuration </strong>(click to enlarge)</p>
<p style="text-align:center;"><a href="http://dl.dropbox.com/u/5600134/blog/vswitch0/vsiwtch0_nics.gif"><img class="alignnone" title="NIC ordering" src="http://dl.dropbox.com/u/5600134/blog/vswitch0/vsiwtch0_nics%20%28Custom%29.gif" alt="" width="179" height="220" /></a></p>
<p style="text-align:left;"><strong>Management port-group configuration</strong></p>
<p style="text-align:center;"><img class="alignnone" title="Management port group config" src="http://dl.dropbox.com/u/5600134/blog/vswitch0/vsiwtch0_man.gif" alt="" width="347" height="222" /></p>
<p style="text-align:center;">&nbsp;</p>
<p style="text-align:left;"><strong>Management NIC configuration </strong>(click to enlarge)</p>
<p><a href="http://dl.dropbox.com/u/5600134/blog/vswitch0/vsiwtch0_order.gif"><img class="alignnone aligncenter" title="Management PG NIC ordering" src="http://dl.dropbox.com/u/5600134/blog/vswitch0/vsiwtch0_order%20%28Custom%29.gif" alt="" width="209" height="220" /></a></p>
<p>It&#8217;s also worth noting here that, since we have Enterprise Licenses, I decided to make use of Host Profiles to help me set up other ESXi hosts. So I configured one ESXi server the way I wanted it and used it to create a baseline host profile. This profile was then applied to all remaining hosts. Nice, quick deployment of a standard config. Good times!</p>
<h2>Server Down!</h2>
<p>My problems started when I wanted to change the IP address or VLAN of the Management port-group. Actually problems arose when I made a change to ANY port group in vSwitch0. My most recent problems were when I wanted to change the VLAN that the vMotion port-group used. So I changed the VLAN and associated IP address for the vMotion PG and suddenly my host went offline!</p>
<p>What seemed to happen was that the new IP  and VLAN I applied to the vMotion PG was actually applied to the Management PG!!! Seriously not good. Especially when your cluster has HA enabled which means that vCenter dutifully starts powering down VM&#8217;s and bringing them online to other hosts in your cluster! Queue lots of alerts and irate application owners.</p>
<p>After some digging around and finding some <a title="VMware Community" href="http://communities.vmware.com/message/1656879?tstart=0" target="_blank">VMware Community</a> posts I realised that the problem was due to an unconfirmed bug. It seems to be down to the way that Host Profiles are applied; specifically the order in which port-groups are created on the host.</p>
<p>If you look again at my first pic you&#8217;ll notice that the Management PG does not use the first vmkernel nic &#8216;vmk0&#8242;. This is actually assigned to the vMotion PG.</p>
<p>To me this is a massive problem and from my point of view, the &#8220;fix&#8221; is to make sure that the Management PG is using vmk0.</p>
<h2>Reassigning vmk0</h2>
<ol>
<li>The first thing you want to do is disable HA on your cluster. Otherwise when you make your change and temporarily loose connection to your host all your VM&#8217;s when vCenter detects that host has gone offline.</li>
<li>Next, you&#8217;ll need either physical or ILO access to the DCUI. SSH won&#8217;t cut it as we&#8217;re going to loose network connection for a while. Once you&#8217;re on the machine hit ALT-F1 to go to the local TSM (assuming you <a title="have it enabled" href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&amp;cmd=displayKC&amp;externalId=1017910" target="_blank">have it enabled</a>) and logon as root or admin user</li>
<li>Now we want to remove all port-groups apart from the Management PG. We could do this via the VI Client, but lets do this at the command line being as we&#8217;ve made the effort to get here&#8230;List your vSwitch0 port-groups (and show vmknic&#8217;s):<br />
<a href="http://dl.dropbox.com/u/5600134/blog/vswitch0/esxcfg_list.GIF"><img class="aligncenter" title="List vmknics" src="http://dl.dropbox.com/u/5600134/blog/vswitch0/esxcfg_list%20%28Custom%29.GIF" alt="" width="500" height="32" /><br />
</a>Here, again, you can see that the Management port-group is using vmk3. This is bad, mmmkay? The other odd thing, and something I&#8217;m assuming is not good, is that the MAC shown for the Management PG is that of the physical NIC. This shouldn&#8217;t be the case. This should be a virtual MAC starting with the VMware specific range; 00:05</li>
<li>The following commands removed my vMotion and Fault Tolerance port-groups. The affect of this is that their vmknics are destroyed:
<pre>esxcfg-vmknic -d vMotion
esxcfg-vmknic -d 'Fault Tolerance'</pre>
<p>Now the fun part. We run exactly the same command but on our Management PG. Yes. You will loose network connectivity to the host, but that&#8217;s why we&#8217;re using ILO, right? <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre>esxcfg-vmknic -d Management</pre>
</li>
<li>After we&#8217;ve blown away our Management PG we can recreate it. When we do, it will automatically be given vmk0:
<pre>esxcfg-vmknic -a -i 10.32.202.11 -n 255.255.255.0 Management</pre>
<p><a href="http://dl.dropbox.com/u/5600134/blog/vswitch0/esxcfg_list_2.GIF"><img class="aligncenter" title="vmk0 after the change" src="http://dl.dropbox.com/u/5600134/blog/vswitch0/esxcfg_list_2%20%28Custom%29.GIF" alt="" width="500" height="32" /></a><br />
You&#8217;ll also notice our new PG has a correctly assigned virtual MAC (starting 00:05).</li>
<li>At this point you&#8217;ll want to go back to the VI client and configure the new PG the way you want including adding additional pNIC&#8217;s to the vSwitch and setting failover order for the PG&#8217;s.</li>
</ol>
<p>Now I&#8217;m able to make changes to my vMotion and FT port-groups without affecting my Management PG.</p>
<p>Let me know if you&#8217;ve been affected by this and how you&#8217;ve got around it.</p>
<p>My next step is to take another host-profile baseline and ensure that, when reapplying it to the other hosts, the vmknic assignments are consistent.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/davidwarburton.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/davidwarburton.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/davidwarburton.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/davidwarburton.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/davidwarburton.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/davidwarburton.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/davidwarburton.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/davidwarburton.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/davidwarburton.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/davidwarburton.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/davidwarburton.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/davidwarburton.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/davidwarburton.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/davidwarburton.wordpress.com/174/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=174&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davidwarburton.net/2011/03/09/vsphere-esxi-vswitch0-vmk0-and-host-profiles/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3a54ad2551bd756d17e5f75aab3c2acd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">DavidWarburton</media:title>
		</media:content>

		<media:content url="http://dl.dropbox.com/u/5600134/blog/vswitch0/vsiwtch0.gif" medium="image">
			<media:title type="html">vSwitch0</media:title>
		</media:content>

		<media:content url="http://dl.dropbox.com/u/5600134/blog/vswitch0/vsiwtch0_nics%20%28Custom%29.gif" medium="image">
			<media:title type="html">NIC ordering</media:title>
		</media:content>

		<media:content url="http://dl.dropbox.com/u/5600134/blog/vswitch0/vsiwtch0_man.gif" medium="image">
			<media:title type="html">Management port group config</media:title>
		</media:content>

		<media:content url="http://dl.dropbox.com/u/5600134/blog/vswitch0/vsiwtch0_order%20%28Custom%29.gif" medium="image">
			<media:title type="html">Management PG NIC ordering</media:title>
		</media:content>

		<media:content url="http://dl.dropbox.com/u/5600134/blog/vswitch0/esxcfg_list%20%28Custom%29.GIF" medium="image">
			<media:title type="html">List vmknics</media:title>
		</media:content>

		<media:content url="http://dl.dropbox.com/u/5600134/blog/vswitch0/esxcfg_list_2%20%28Custom%29.GIF" medium="image">
			<media:title type="html">vmk0 after the change</media:title>
		</media:content>
	</item>
		<item>
		<title>Change disk persistence mode on the fly in vSphere using PowerCLI</title>
		<link>http://blog.davidwarburton.net/2010/11/04/change-disk-persistence-mode-on-the-fly-in-vsphere-using-powercli/</link>
		<comments>http://blog.davidwarburton.net/2010/11/04/change-disk-persistence-mode-on-the-fly-in-vsphere-using-powercli/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 00:55:53 +0000</pubDate>
		<dc:creator>DavidWarburton</dc:creator>
				<category><![CDATA[ESXi]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://blog.davidwarburton.net/?p=170</guid>
		<description><![CDATA[I&#8217;ve been plagued, for some time, by a really annoying problem in my home lab. Being as I run everything from the one VM host (ESXi) it is also home to my Windows 2008 domain controller. Recently I had installed Veeam Backup and Replication to finally start backing up my VM&#8217;s (even though it&#8217;s my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=170&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been plagued, for some time, by a really annoying problem in my home lab. Being as I run everything from the one VM host (ESXi) it is also home to my Windows 2008 domain controller.</p>
<p>Recently I had installed Veeam Backup and Replication to finally start backing up my VM&#8217;s (even though it&#8217;s my home/test environment I would be a broken man if I lost everything on there!). I installed Veeam on to the Windows 2008 DC &#8211; against all common sense of course, but RAM is low in my ML110 and I couldn&#8217;t afford to create another Windows VM.</p>
<p>I had configured Veeam to backup my guest&#8217;s using the vStorage API &#8211; Virtual Appliance mode. Backups of my other Windows guests ran well but I noticed some problems with the DC VM backup after a short while. It was around this time that I also noticed that the hard disks of this guest OS had automatically changed to Independant Nonpersistent! This would have been bad enough for any machine (as soon as the guest powers down you loose all changes), but for a DC &#8211; as you can imagine &#8211; it&#8217;s a nightmare!</p>
<p><a href="http://dl.dropbox.com/u/2873480/blog/veeam_disks/veeam.png"><img class="aligncenter" title="Veeam Backup" src="http://dl.dropbox.com/u/2873480/blog/veeam_disks/veeam%20%28Custom%29.png" alt="" width="200" height="115" /></a></p>
<p>This post on Experts Exchange confirmed &#8211; to some extent &#8211; that Veeam was the culprit and there wasn&#8217;t some other weird force at work: http://www.experts-exchange.com/Software/VMWare/Q_26310902.html</p>
<p>I disabled the DC backup via Veeam but the problem remained that my VM&#8217;s disks were Independant. The vSphere Infrastructure Client does not allow you to change disk modes on the fly so I was stuck &#8211; as soon as I shut my VM down to change the disk type I would loose all changes:</p>
<p><a href="http://dl.dropbox.com/u/2873480/blog/veeam_disks/vic.png"><img class="aligncenter" title="VIC" src="http://dl.dropbox.com/u/2873480/blog/veeam_disks/vic%20%28Custom%29.png" alt="" width="200" height="85" /></a></p>
<p>Thankfully, <a title="PowerCLI" href="http://www.vmware.com/support/developer/PowerCLI/PowerCLI41/html/Set-HardDisk.html" target="_blank">PowerCLI </a>came to my rescue!</p>
<p>After connecting to my ESXi host using</p>
<pre>connect-viserver &lt;esxi_ipaddress&gt;</pre>
<p>All that was needed was a simple command:</p>
<pre>Get-HardDisk -VM <em>&lt;vm_name&gt;</em> | Set-HardDisk -Persistence "Persistent"</pre>
<p>Success!! At least partially. My primary (system) disk had successfully reverted to a persistent disk. However, my second disk had not and PowerCLI had actually errored :</p>
<pre>CapacityKB Persistence                                                    Filename
---------- -----------                                                    --------
68157440   Persistent                       [localdisk01] vm_guest/disk1.vmdk
Set-HardDisk : 04/11/2010 00:49:44    Set-HardDisk        Another task is already in progress.
At line:1 char:42</pre>
<p>I haven&#8217;t yet figured out what task it is that is supposedly in progress, but I certainly can&#8217;t find one. It may be worth noting that my primary disk is on local SATA while the second disk is on an NFS share.</p>
<p>Now, at least, when I run Get-HardDisk, it shows that my system drive is Persistent:</p>
<p><a href="http://dl.dropbox.com/u/2873480/blog/veeam_disks/powercli.png"><img class="aligncenter" title="PowerCLI" src="http://dl.dropbox.com/u/2873480/blog/veeam_disks/powercli%20%28Custom%29.png" alt="" width="200" height="25" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/davidwarburton.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/davidwarburton.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/davidwarburton.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/davidwarburton.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/davidwarburton.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/davidwarburton.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/davidwarburton.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/davidwarburton.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/davidwarburton.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/davidwarburton.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/davidwarburton.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/davidwarburton.wordpress.com/170/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/davidwarburton.wordpress.com/170/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/davidwarburton.wordpress.com/170/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=170&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davidwarburton.net/2010/11/04/change-disk-persistence-mode-on-the-fly-in-vsphere-using-powercli/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3a54ad2551bd756d17e5f75aab3c2acd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">DavidWarburton</media:title>
		</media:content>

		<media:content url="http://dl.dropbox.com/u/2873480/blog/veeam_disks/veeam%20%28Custom%29.png" medium="image">
			<media:title type="html">Veeam Backup</media:title>
		</media:content>

		<media:content url="http://dl.dropbox.com/u/2873480/blog/veeam_disks/vic%20%28Custom%29.png" medium="image">
			<media:title type="html">VIC</media:title>
		</media:content>

		<media:content url="http://dl.dropbox.com/u/2873480/blog/veeam_disks/powercli%20%28Custom%29.png" medium="image">
			<media:title type="html">PowerCLI</media:title>
		</media:content>
	</item>
		<item>
		<title>RDM mapping of local SATA storage for ESXi</title>
		<link>http://blog.davidwarburton.net/2010/10/25/rdm-mapping-of-local-sata-storage-for-esxi/</link>
		<comments>http://blog.davidwarburton.net/2010/10/25/rdm-mapping-of-local-sata-storage-for-esxi/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 11:41:43 +0000</pubDate>
		<dc:creator>DavidWarburton</dc:creator>
				<category><![CDATA[ESXi]]></category>
		<category><![CDATA[Storage / Backups]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>
		<category><![CDATA[ZFS]]></category>

		<guid isPermaLink="false">http://blog.davidwarburton.net/?p=116</guid>
		<description><![CDATA[This post has been sat in my WordPress Drafts folder for sometime since I no longer use local storage this way. I decided to post it however as (a) it&#8217;s a good learning curve for ESXi work and (b) others may have more luck that me. I recently acquired three 1TB drives and decided to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=116&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>This post has been sat in my WordPress Drafts folder for sometime since I no longer use local storage this way. I decided to post it however as (a) it&#8217;s a good learning curve for ESXi work and (b) others may have more luck that me.</em></p>
<p>I recently acquired three 1TB drives and decided to do something about my lack of storage at home. Always trying to make best use of existing kit (and save money) I decided to stick the drives in to my HP ML110 and try something in a VM instead of doing the sensible thing of lobbing them in to a dedicated NAS box.</p>
<p>After wasting a few hours I realised that the onboard SATA RAID controller of the ML110 just can&#8217;t do RAID5 and to make matters worse, when I gave up and created a RAID1 array with a hot spare, vSphere 4.1 didn&#8217;t recognise the array and instead saw the drives as 3 individual drives. I saw this as a chance to try out the WAFL-alike ZFS file system. FreeNAS had been my NAS of choice recently so I chose to try ZFS in that.</p>
<p>I point blank refused to create 3 1TB VMDK&#8217;s (one of each of the three drives) so I set about figuring out how to create Raw Device Mappings (RDMs) of the local SATA drives. There were a couple of posts on the net that got me a little closer, but no guide/article had the whole thing down, so that&#8217;s my aim with this blog post.</p>
<h3>Step 1</h3>
<p>Once you had your drives installed, SSH to your ESXi box (now even easier in vSphere 4.1) and go to the /dev/disks directory. There, if you perform a <strong>ls -l</strong>, you&#8217;ll see your drives listed:</p>
<p><a href="http://dl.dropbox.com/u/5600134/blog/esxi_sata/Screenshot%20-%2030_07_2010%20%2C%2023_43_11.jpg"><img src="http://dl.dropbox.com/u/5600134/blog/esxi_sata/thumb/Screenshot%20-%2030_07_2010%20%2C%2023_43_11.jpg"></a></p>
<p>Ignore the instances of your drives which show them as VM stores (vm1.*****). We want to look at the raw devices.</p>
<h3>Step 2</h3>
<p>Now move to the <strong>/vmfs/volumes</strong> folder. Here you can see your existing local datastore(s). If, like me, you had a solitary hard-drive, you&#8217;ll just see <strong>localdisk01</strong> or whatever you chose to name the local datastore:</p>
<p><a href="http://dl.dropbox.com/u/5600134/blog/esxi_sata/Screenshot%20-%2030_07_2010%20%2C%2023_45_54.jpg"><img src="http://dl.dropbox.com/u/5600134/blog/esxi_sata/thumb/Screenshot%20-%2030_07_2010%20%2C%2023_45_54.jpg"></a></p>
<h3>Step 3</h3>
<p>Now we are going to use the <strong>vmkfstools</strong> utility to create our RDM&#8217;s. Remember that a RDM is just another VMDK, but instead of the VMDK pointing to a<strong> xxx-flat.vmdk </strong>file (which is the actual virtual hard disk), the VMDK points to our physical device. Being as we still need to create this VMDK file we need to save it somewhere. Since we just have the one local datastore, we are going to create the RDM VMDK files in it&#8217;s root.</p>
<p>The following command creates the RDM VMDK for us:</p>
<p><strong>vmkfstools -z /vmfs/devices/disks/&lt;name of RAW device from Step 1&gt; &lt;location to store VMDK&gt;/&lt;RDM name&gt;.vmdk</strong></p>
<p>In my personal example below, I am creating an RDM called <strong>rdm_WD2DWCAVU0477582.vmdk</strong> and it is being stored in the location <strong>/vmfs/volumes/localdisk01/</strong> I chose the name of the VMDK to match the name of the serial number of the physical drive (and what is shown in Step 1) to help with troubleshooting in the future when I get an inevitable drive failure). You can call your RDM&#8217;s whatever you wish.</p>
<p><a href="http://dl.dropbox.com/u/5600134/blog/esxi_sata/Screenshot%20-%2030_07_2010%20%2C%2023_47_13.jpg"><img src="http://dl.dropbox.com/u/5600134/blog/esxi_sata/thumb/Screenshot%20-%2030_07_2010%20%2C%2023_47_13.jpg"></a></p>
<p>The name of the RAW device (t10.ATA____WDC_WD10EARS2D00Z5B1__________________________WD2DCAVU0477582 in my example) you will have noted from Step 1 when you listed all local devices attached to your ESXi host. This is why the tech Gods created Copy n Paste! You will want to copy the full device name as shown in Step 1 in to the vmkfstools command.</p>
<h3>Step 4</h3>
<p>Once you have repeated the steps for all of your local SATA drives, you can navigate to where you created the RDM&#8217;s (in my case /vmfs/volumes/localdisk01) and perform an ls -l *.vmdk to see the new VMDK&#8217;s you have created:</p>
<p><a href="http://dl.dropbox.com/u/5600134/blog/esxi_sata/Screenshot%20-%2030_07_2010%20%2C%2023_47_27.jpg"><img src="http://dl.dropbox.com/u/5600134/blog/esxi_sata/thumb/Screenshot%20-%2030_07_2010%20%2C%2023_47_27.jpg"></a></p>
<p>Don&#8217;t panic &#8211; the <strong>xxx-rdmp.vmdk</strong> files will reflect the size of the RAW devices they are mapping to, but rest assured it will be taking no more space than a few bytes on your local disk!</p>
<h3>Step 5</h3>
<p>You can now add your RDM&#8217;s to an existing VM. vSphere doesn&#8217;t recognise this as a true RDM (to a SAN) so you just browse the local disk datastore for the VMDK files that we created.</p>
<p>Edit the properties of an existing VM and click <strong>Add&#8230;</strong></p>
<p><a href="http://dl.dropbox.com/u/5600134/blog/esxi_sata/Screenshot%20-%2030_07_2010%20%2C%2023_48_22.jpg"><img src="http://dl.dropbox.com/u/5600134/blog/esxi_sata/thumb/Screenshot%20-%2030_07_2010%20%2C%2023_48_22.jpg"></a></p>
<h3>Step 6</h3>
<p>Select <strong>Use an existing virtual disk</strong> and click Next &gt;</p>
<p><a href="http://dl.dropbox.com/u/5600134/blog/esxi_sata/Screenshot%20-%2030_07_2010%20%2C%2023_49_05.jpg"><img src="http://dl.dropbox.com/u/5600134/blog/esxi_sata/thumb/Screenshot%20-%2030_07_2010%20%2C%2023_49_05.jpg"></a></p>
<h3>Step 7</h3>
<p>Click <strong>Browse</strong>. You now need to navigate your local datastore and select the VMDK&#8217;s that we created in Step 3).</p>
<p>Once complete you will be shown a confirmation window. Repeat Steps 5 through 7 to add additional RDM&#8217;s to your VM.</p>
<p><a href="http://dl.dropbox.com/u/5600134/blog/esxi_sata/Screenshot%20-%2030_07_2010%20%2C%2023_49_30.jpg"><img src="http://dl.dropbox.com/u/5600134/blog/esxi_sata/thumb/Screenshot%20-%2030_07_2010%20%2C%2023_49_30.jpg"></a></p>
<h3>Step 8</h3>
<p>You should now see your new Hard Disk&#8217;s in your VM and vSphere will correctly identify them as <strong>Mapped Raw LUN</strong>.</p>
<p><a href="http://dl.dropbox.com/u/5600134/blog/esxi_sata/Screenshot%20-%2030_07_2010%20%2C%2023_50_39.jpg"><img src="http://dl.dropbox.com/u/5600134/blog/esxi_sata/thumb/Screenshot%20-%2030_07_2010%20%2C%2023_50_39.jpg"></a></p>
<p><strong>NOTE:</strong> One thing I forgot to show in the screen shots, is that you should create your RDM&#8217;s on a new SCSI controller! You do this by simply selecting a new SCSI ID starting with 1:x instead of 0:x. Existing VMDK&#8217;s should be on SCSI Controller 0. Your RDM&#8217;s should be on SCSI controller 1. Although my screenshot shows 0:3 this should read 1:3.</p>
<p>You can now save your VM configuration. Your VM will now access the RAW SATA drives  and be able to use things like SMART to monitor its health.</p>
<p>See below; I am adding my three 1TB drive to FreeNAS to create a new ZFS pool.</p>
<p>Stay tuned for an upcoming blog post on FreeNAS and NexentaStor which may or may not put you off ZFS [in a VM] altogether!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/davidwarburton.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/davidwarburton.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/davidwarburton.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/davidwarburton.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/davidwarburton.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/davidwarburton.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/davidwarburton.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/davidwarburton.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/davidwarburton.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/davidwarburton.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/davidwarburton.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/davidwarburton.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/davidwarburton.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/davidwarburton.wordpress.com/116/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=116&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davidwarburton.net/2010/10/25/rdm-mapping-of-local-sata-storage-for-esxi/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3a54ad2551bd756d17e5f75aab3c2acd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">DavidWarburton</media:title>
		</media:content>

		<media:content url="http://dl.dropbox.com/u/5600134/blog/esxi_sata/thumb/Screenshot%20-%2030_07_2010%20%2C%2023_43_11.jpg" medium="image" />

		<media:content url="http://dl.dropbox.com/u/5600134/blog/esxi_sata/thumb/Screenshot%20-%2030_07_2010%20%2C%2023_45_54.jpg" medium="image" />

		<media:content url="http://dl.dropbox.com/u/5600134/blog/esxi_sata/thumb/Screenshot%20-%2030_07_2010%20%2C%2023_47_13.jpg" medium="image" />

		<media:content url="http://dl.dropbox.com/u/5600134/blog/esxi_sata/thumb/Screenshot%20-%2030_07_2010%20%2C%2023_47_27.jpg" medium="image" />

		<media:content url="http://dl.dropbox.com/u/5600134/blog/esxi_sata/thumb/Screenshot%20-%2030_07_2010%20%2C%2023_48_22.jpg" medium="image" />

		<media:content url="http://dl.dropbox.com/u/5600134/blog/esxi_sata/thumb/Screenshot%20-%2030_07_2010%20%2C%2023_49_05.jpg" medium="image" />

		<media:content url="http://dl.dropbox.com/u/5600134/blog/esxi_sata/thumb/Screenshot%20-%2030_07_2010%20%2C%2023_49_30.jpg" medium="image" />

		<media:content url="http://dl.dropbox.com/u/5600134/blog/esxi_sata/thumb/Screenshot%20-%2030_07_2010%20%2C%2023_50_39.jpg" medium="image" />
	</item>
		<item>
		<title>Working with HP MSA 2000 via command line</title>
		<link>http://blog.davidwarburton.net/2010/10/25/working-with-hp-msa-2000-via-command-line/</link>
		<comments>http://blog.davidwarburton.net/2010/10/25/working-with-hp-msa-2000-via-command-line/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 11:04:21 +0000</pubDate>
		<dc:creator>DavidWarburton</dc:creator>
				<category><![CDATA[HP]]></category>
		<category><![CDATA[MSA]]></category>
		<category><![CDATA[Storage / Backups]]></category>

		<guid isPermaLink="false">http://blog.davidwarburton.net/?p=157</guid>
		<description><![CDATA[This statement is becoming almost cliche in the blogging world, but this post is more for my own benefit to help me remember some of the work I&#8217;ve been doing on MSA lately: The MSA 2000 series has a pretty dire web interface &#8211; when you compare it with other SAN&#8217;s &#8211; and to make [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=157&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This statement is becoming almost cliche in the blogging world, but <em>this post is more for my own benefit to help me remember some of the work I&#8217;ve been doing on MSA lately:</em></p>
<p>The MSA 2000 series has a pretty dire web interface &#8211; when you compare it with other SAN&#8217;s &#8211; and to make matters work, it mixes and swaps terminology with HP&#8217;s own EVA&#8217;s (a vdisk on an MSA refers to a RAID array made up of physical disks. A vdisk on an EVA is a virtual RAID array which sits on top of the underlying RAID 0 structure). The web interface is challenging enough as it is when it works, but recently the web page of the management interface has been timing out.</p>
<p>Thankfully SSH access still works and responds well. I&#8217;ve been using&#8230;</p>
<pre>restart mc a</pre>
<p>&#8230;to restart the management interface which helped things for a short while but ultimately I found myself falling back to SSH more and more.</p>
<p>The following procedure follows the steps I took to rename and prevent a volume to a host.</p>
<p>To give a host a friendly name (from its WWN):</p>
<pre>set host-wwn-name host &lt;wwn&gt; &lt;friendlyHostName&gt;</pre>
<p>To rename a volume:</p>
<pre>set volume &lt;volName&gt; name &lt;new_volName&gt;</pre>
<p>To view what hosts a volume is currently presented to and what volumes map to what hosts:</p>
<pre>show host-maps [&lt;friendlyHostName&gt;]
show volume-maps [&lt;volName&gt;]</pre>
<p>To actually present a volume to a host:</p>
<pre>map volume &lt;volName&gt; [lun &lt;lunID&gt;] host &lt;friendlyHostName&gt; access rw</pre>
<p>In theory the LUN ID can be left blank, but in practise I found that it would not map unless I specified an ID. Don&#8217;t forget to map both HBA&#8217;s for a host.</p>
<p>After presenting the volume to the Windows 2003 host I was dismayed when the Storage MMC could not see the new lun. Hitting F5, of course, was not enough. On the <strong>Disk Management</strong> section folder in the left hand side of the MMC window, right-click and select <strong>Rescan Disks</strong>.</p>
<p>I&#8217;ll update thist post if I use and feel the need to remember some other command line options for the MSA 2000 but hopefully we&#8217;ll be migrating off it to EVA soon!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/davidwarburton.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/davidwarburton.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/davidwarburton.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/davidwarburton.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/davidwarburton.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/davidwarburton.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/davidwarburton.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/davidwarburton.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/davidwarburton.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/davidwarburton.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/davidwarburton.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/davidwarburton.wordpress.com/157/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/davidwarburton.wordpress.com/157/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/davidwarburton.wordpress.com/157/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=157&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davidwarburton.net/2010/10/25/working-with-hp-msa-2000-via-command-line/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3a54ad2551bd756d17e5f75aab3c2acd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">DavidWarburton</media:title>
		</media:content>
	</item>
		<item>
		<title>Netbackup reporting script &#8211; an update (of sorts)</title>
		<link>http://blog.davidwarburton.net/2010/08/17/netbackup-reporting-script-an-update-of-sorts/</link>
		<comments>http://blog.davidwarburton.net/2010/08/17/netbackup-reporting-script-an-update-of-sorts/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 23:27:45 +0000</pubDate>
		<dc:creator>DavidWarburton</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.davidwarburton.net/?p=148</guid>
		<description><![CDATA[Seems the Netbackup reporting script is in pretty high demand at the moment. Obviously lots of you just as frustrated with NBU reporting as I was! I&#8217;m really pleased that so many of you are finding it useful &#8211; though I am starting to wonder if letting it out in to the open without a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=148&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Seems the Netbackup reporting script is in pretty high demand at the moment. Obviously lots of you just as frustrated with NBU reporting as I was! I&#8217;m really pleased that so many of you are finding it useful &#8211; though I am starting to wonder if letting it out in to the open without a license agreement (a free one, don&#8217;t worry) is a good idea.</p>
<p>I have placed the scripts in a public DropBox location which is linked to at the bottom of the original <a title="Netbackup Report Scripting" href="http://blog.davidwarburton.net/2010/02/25/netbackup-report-scripting-2/" target="_self">Netbackup Report Scripting</a> post. In the mean time, please see the PayPal donation button to the right now. If you&#8217;ve used my scripts and find them useful &#8211; and certainly if you plan to use them in a business environment &#8211; please consider donation as much or as little as you can.</p>
<p>I also have some nice new blog posts ready to upload as soon as I can sort my image hosting out! Those of you struggling with EVA performance monitoring and tuning, stay&#8230;err&#8230;.tuned!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/davidwarburton.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/davidwarburton.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/davidwarburton.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/davidwarburton.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/davidwarburton.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/davidwarburton.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/davidwarburton.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/davidwarburton.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/davidwarburton.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/davidwarburton.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/davidwarburton.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/davidwarburton.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/davidwarburton.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/davidwarburton.wordpress.com/148/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=148&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davidwarburton.net/2010/08/17/netbackup-reporting-script-an-update-of-sorts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3a54ad2551bd756d17e5f75aab3c2acd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">DavidWarburton</media:title>
		</media:content>
	</item>
		<item>
		<title>Netbackup script to report scratch tapes</title>
		<link>http://blog.davidwarburton.net/2010/05/04/netbackup-script-to-report-scratch-tapes/</link>
		<comments>http://blog.davidwarburton.net/2010/05/04/netbackup-script-to-report-scratch-tapes/#comments</comments>
		<pubDate>Tue, 04 May 2010 12:35:29 +0000</pubDate>
		<dc:creator>DavidWarburton</dc:creator>
				<category><![CDATA[Netbackup]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://blog.davidwarburton.net/?p=98</guid>
		<description><![CDATA[I&#8217;ve seen Netbackup used in two completely different ways now. In my last environment all tapes rotas, movements and scratch tapes were handled manually. We had a spreadsheet showing tape sets (see below for an example), when these tapes were collected by Iron Mountain, which days of the months we defined as Monthly/Quarterly backups and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=98&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve seen Netbackup used in two completely different ways now. In my last environment all tapes rotas, movements and scratch tapes were handled manually. We had a spreadsheet showing tape sets (see below for an example), when these tapes were collected by Iron Mountain, which days of the months we defined as Monthly/Quarterly backups and so on. In this scenario each set of tapes is a number of tapes &#8211; on some days you may use less, on some days you may not have enough loaded.</p>
<p>In the new environment we let Netbackup dictate which tapes are in the scratch pool and free for re-use based on the expiration policy of the jobs written to those tapes. In theory this should mean that you only ever use as many tapes as you need for a given backup job. The problem with this set-up is that although it is, in theory, more efficient, you don&#8217;t always know which tapes you will need each night and how many you have free.</p>
<p>Each day guys were running NBU command lines to show which tapes were in the scratch pool, but having to manually sift through them to see which tapes were currently sat in drives/libraries and of the ones held off-site, which tapes were of which format (LTO2, 3 or 4).</p>
<p>The following script can be scheduled to email out a list of tapes in the scratch pool, which are in what library and also groups the offsite tapes by format. It was knocked up in a hurry so isn&#8217;t as parameterised or dynamic as it should be, but the comments should help you fix it for your needs&#8230;</p>
<p><span id="more-98"></span>Here&#8217;s the script and HTML header &amp; footer&#8230;</p>
<h4>scratch_list.ps1</h4>
<pre>$debugpreference = "continue"

#This "output" variable runs and stores the output of the NBU command line
#Be sure that this .exe is in your path, otherwise change the below to include the full path to the executable.
$output = vmquery.exe -b -pn Scratch
$htmlfile = ".\output.txt"
$today = Get-Date

#Arrays to hold and sort info about our tapes.
#NOTE: this script is hard-coded to work for LTO2 (HCART2), LTO3 (HCART3) and LTO4 (HCART) tape drives/libraries
[array]$aTapes = @()
[array]$aHOffsite = @()
[array]$aH2Offsite = @()
[array]$aH3Offsite = @()

#NOTE: this script is hard coded to include the specific names of tape drives attached (via various media servers) to the master server
$aRobots = @{"TLD0" = 0; "TLD1" = 0; "TLD2" = 0; "TLD3" = 0; "TLD4" = 0; "TLD5" = 0; "TLD6" = 0; "TLD7" = 0; "TLD8" = 0; "TLD9" = 0; "TLD10" = 0; "TLD11" = 0; "TLD12" = 0; "TLD13" = 0; "TLD14" = 0}
$emailBody = Get-Content "header.html"
$aOffsite = 0

#Function to send mail (currently configured to send via Exchange)
function sendEmail() {
 $eServer = New-Object system.net.mail.smtpClient("exchange_server01")

 $From = "netbackup@yourcompany.com"
 $To = "nbu_reports@yourcompany.com"

 $todayDate = [string] $today.day + "/" + [string] $today.month + "/" + [string] $today.year

 $title = "Scratch tape list for $todayDate"

 $Body = $emailBody
 $eMsg = New-Object System.Net.Mail.MailMessage($From,$To,$title,$body)

 $eMsg.IsBodyHTML = $True

 $eServer.send($eMsg)    
}

#Take output of NBU command line util, and for each line pick out bits of the string
#Chuck everything in to a new array called $aTapes
foreach ($line in $output){
 if (($line.contains("HCART")) -and (-not $line.contains("A00"))) {

 $tName = ($line.substring(0, 6)).trim()
 $tType = ($line.substring(8, 6)).trim()
 $tRobot = $line.substring(23, 5).trim() #this captures a wide area with some white space that needs trimming

 $tRobot = $tRobot.replace(" ", "")

 $aTapes += ,($tName, $tRobot, $tType)
 }
}

#Go through the array we just created and then put the contents in to seperate arrays
#dependant on whether they are LTO, LTO2 or LTO3 tapes...
for ($j = 0; $j -lt $aTapes.length; $j++) {
 $tapeID = $aTapes[$j][0]
 $robot = $aTapes[$j][1]
 $type = $aTapes[$j][2]

 if ($robot.contains("-")) {
 switch ($type ) {
 "HCART" {$aHOffsite += ,($tapeID)}
 "HCART2" {$aH2Offsite += ,($tapeID)}
 "HCART3" {$aH3Offsite += ,($tapeID)}
 }

 } else {#If a library type does not contain HCART, HCART2 or HCART3 we must assume it's offsite (or in a safe))
 $temp = "TLD$robot"
 $aRobots[$temp] = $aRobots[$temp] + 1
 }
}

#Take the contents of $aRobots (offsite tapes) and put it in to a variables ready to be dumped in to our html output
foreach ($element in $aRobots) {
 $element &gt; $htmlfile
}

#Start pipping everything out to the $emailBody variable which will make the body of our email
$emailBody += '&lt;table&gt;&lt;tr&gt;&lt;td&gt;Tape drive&lt;/td&gt;&lt;td&gt;# scratch tapes&lt;/td&gt;&lt;/tr&gt;'
foreach ($line in Get-Content $htmlfile) {

 if ($line.contains("TLD")) {
 $emailBody += "&lt;tr&gt;"

 $robot = $line.substring(0, 5)
 $count = $line.substring(31, 3)

 $emailBody += "&lt;td&gt;$robot&lt;/td&gt;&lt;td&gt;$count&lt;/td&gt;"

 $emailBody += "&lt;/tr&gt;"
 }
}
$emailBody += '&lt;/table&gt;&lt;br/&gt;&lt;br/&gt;'

$emailBody += "&lt;b&gt;Offsite tapes...&lt;/b&gt;&lt;br/&gt;"

$emailBody += "&lt;b&gt;HCART&lt;/b&gt;&lt;br&gt;"
foreach($element in $aHOffsite) {
 $emailBody += "$element&lt;br/&gt;"
}
$emailBody += "&lt;br/&gt;&lt;b&gt;HCART2&lt;/b&gt;&lt;br&gt;"
foreach($element in $aH2Offsite) {
 $emailBody += "$element&lt;br/&gt;"
}
$emailBody += "&lt;br/&gt;&lt;b&gt;HCART3&lt;/b&gt;&lt;br&gt;"
foreach($element in $aH3Offsite) {
 $emailBody += "$element&lt;br/&gt;"
}

$emailBody += Get-Content "footer.html"

sendEmail
</pre>
<p>As per my other NBU scripts I use HTML files to store the CSS and opening HTML in order to easily format nice looking emails. See below for examples&#8230;</p>
<h4>header.html</h4>
<pre>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"&gt;
&lt;html&gt;
&lt;head&gt;
 &lt;title&gt;Scratch tape list&lt;/title&gt;
 &lt;style type="text/css"&gt;
 body {
 font-family: Calibri, Arial, Helvetica;
 color: black;
 font-size: small;
 background-color: #FFFFFF }
 p {
 font-size: small }
 .big {
 font-size: small }
 table {
 font-size: small;
 padding: 0px ;
 border-spacing: 2px ;
 empty-cells: hide ;
 border: 1px solid #AAAAAA }
 td {
 background-color: #EEEEEE;
 vertical-align: top }
 th {
 background-color: #EEEEEE;
 vertical-align: top ;
 text-align: left}
 &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;p&gt;*** This email is now automatically generated ***&lt;br&gt;&lt;/p&gt;
</pre>
<h4>footer.html</h4>
<pre>&lt;br/&gt;
&lt;p&gt;Regards,&lt;br/&gt;&lt;br/&gt;
&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;

</pre>
<p>Let me know if this helps you out at all or if you can suggest any improvements&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/davidwarburton.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/davidwarburton.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/davidwarburton.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/davidwarburton.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/davidwarburton.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/davidwarburton.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/davidwarburton.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/davidwarburton.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/davidwarburton.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/davidwarburton.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/davidwarburton.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/davidwarburton.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/davidwarburton.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/davidwarburton.wordpress.com/98/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=98&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davidwarburton.net/2010/05/04/netbackup-script-to-report-scratch-tapes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3a54ad2551bd756d17e5f75aab3c2acd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">DavidWarburton</media:title>
		</media:content>
	</item>
		<item>
		<title>Using CrashPlan to backup a network share</title>
		<link>http://blog.davidwarburton.net/2010/03/12/using-crashplan-to-backup-a-network-share/</link>
		<comments>http://blog.davidwarburton.net/2010/03/12/using-crashplan-to-backup-a-network-share/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 23:12:07 +0000</pubDate>
		<dc:creator>DavidWarburton</dc:creator>
				<category><![CDATA[Batch]]></category>
		<category><![CDATA[Other Backups]]></category>

		<guid isPermaLink="false">http://blog.davidwarburton.net/?p=87</guid>
		<description><![CDATA[Some time ago I started using CrashPlan with CrashPlan Central to finally start backing up my family photos and important documents off-site. It&#8217;s been working pretty well, despite my frustrations over slow upload speeds. It&#8217;s pretty much a fire and forget solution. Recently I&#8217;ve installed FreeNAS on to an old PC to (a) start getting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=87&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some time ago I started using CrashPlan with <a href="http://b2.crashplan.com/consumer/features-central.html" target="_blank">CrashPlan Central</a> to finally start backing up my family photos and important documents off-site. It&#8217;s been working pretty well, despite my frustrations over slow upload speeds. It&#8217;s pretty much a fire and forget solution.</p>
<p>Recently I&#8217;ve installed <a href="http://freenas.org/FreeNAS" target="_blank">FreeNAS</a> on to an old PC to (a) start getting some stability to my storage solution, and (b) play around with ZFS and iSCSI at home. I tried OpenFiler but it pales in comparison to FreeNAS. I&#8217;ve gone against my better judgement and I&#8217;m using some of the cooler plugins including the Torrent client, Dynamic DNS and I&#8217;ve even installed SABNzbd on it. FreeNAS comes with rsync built in and even <a href="http://www.cis.upenn.edu/~bcpierce/unison/" target="_blank">Unison</a> which is an interesting solution to cross platform backup/synchronisation, but I&#8217;ve payed for my CrashPlan Central plan so want to make use of it!Only problem now is backing up my data!</p>
<p>CrashPlan doesn&#8217;t support backing up from a network share &#8211; either mapped drive or UNC path. There is a <a href="http://support.crashplan.com/doku.php/recipe/back_up_windows_mapped_drives" target="_blank">work around</a> on the CrashPlan site which works but is a little convoluted so wanted to post a nice, quick version here.</p>
<p>Read on after the break&#8230; <span id="more-87"></span>The problem is simply that CrashPlan runs as a service using the SYSTEM account. To allow us to backup a network share we have a couple of options&#8230;.</p>
<ol>
<li>Change the service to run as a standard user account (e.g. the one you&#8217;re logged in to your machine as)</li>
<li>Map a drive under the SYSTEM account so that it is visible to CrashPlan</li>
</ol>
<p>I&#8217;d recommend the latter but if you just plan on using this on a desktop machine and/or want a quick and dirty solution, here&#8217;s how you change the logon account for the service&#8230;</p>
<ul>
<li>Open up the Services MMC and find the <strong>CrashPlan Backup Service</strong>. Double-click it to open its properties<br />
<a href="http://davidwarburton.files.wordpress.com/2010/03/service_1.png"><img class="alignnone size-thumbnail wp-image-88" title="service_1" src="http://davidwarburton.files.wordpress.com/2010/03/service_1.png?w=144&h=150" alt="Select CrashPlan service" width="144" height="150" /></a></li>
<li>Click the <strong>Log On</strong> tab and then select the <strong>This account</strong> radio button. </li>
<li>Enter the username and password of a local/domain user account with full permissions to the network share you want to back up <br />
<a href="http://davidwarburton.files.wordpress.com/2010/03/service_2.png"><img class="alignnone size-thumbnail wp-image-90" title="service_2" src="http://davidwarburton.files.wordpress.com/2010/03/service_2.png?w=150&h=113" alt="Enter a local/domain username" width="150" height="113" /></a></li>
<li>Click <strong>OK</strong> and then restart the service <br />
<a href="http://davidwarburton.files.wordpress.com/2010/03/service_3.png"><img class="alignnone size-thumbnail wp-image-91" title="service_3" src="http://davidwarburton.files.wordpress.com/2010/03/service_3.png?w=150&h=74" alt="Restart the service" width="150" height="74" /></a></li>
<li>Relaunch the CrashPlan application and you&#8217;ll now be able to see drives that you currently have mapped as a backup selection as well as local drives</li>
</ul>
<p> </p>
<p>The preferred method is to map a drive as the SYSTEM account. That in itself is no big deal, the thing is getting the drive mapped as soon as the machine boots and doing it each and every time your machine restarts. To do this we simply make use of Vista/7&#8242;s Task Scheduler.</p>
<p>The batch script, which we&#8217;ll save as <strong>c:\mount.bat</strong> simply uses a<strong> NET USE</strong> command. The one drawback to this method is that the username and <em>password</em> need to be saved in the script. You must use a username which has permissions to the network share. This need not be a local username, in the case of FreeNAS, if you have it joined to a domain as I do.</p>
<p>Here&#8217;s the code:</p>
<pre>net use M: <a href="//\\freenas\media">\\freenas\media</a> /USER:dave@mydomain.lan myP4ssw0rd</pre>
<p>Once you have that saved open up the Task Scheduler&#8230;</p>
<p><a href="http://davidwarburton.files.wordpress.com/2010/03/task_1.png"><img class="alignnone size-thumbnail wp-image-92" title="task_1" src="http://davidwarburton.files.wordpress.com/2010/03/task_1.png?w=128&h=150" alt="Open the task scheduler" width="128" height="150" /></a></p>
<p>Create a new task (I keep my tasks in a seperate folder to the default Windows ones simply for easier administration). Give your ask a name, for example <strong>Mount drive for CrashPlan</strong>. Select <strong>Run whether user is logged on or not</strong>, tick the <strong>Run with highest privileges</strong> box and then click <strong>Change User or Group&#8230;</strong></p>
<p><a href="http://davidwarburton.files.wordpress.com/2010/03/task_2.png"><img class="alignnone size-thumbnail wp-image-93" title="task_2" src="http://davidwarburton.files.wordpress.com/2010/03/task_2.png?w=150&h=111" alt="Change the username" width="150" height="111" /></a></p>
<p>Type <strong>system</strong> and then <strong>Check Names</strong> (it should capitalise and underline). Click <strong>OK</strong>.</p>
<p>Back in the Create Task window slect the <strong>Triggers</strong> tab and click <strong>New&#8230;</strong> Select <strong>At log on&#8230;</strong> from the drop down list and click <strong>OK </strong>to close the window.</p>
<p>Now select the <strong>Actions </strong>tab and, again, click <strong>New&#8230;</strong> leave the action as <strong>Start a program</strong> and then browse to your batch that we created above.</p>
<p><a href="http://davidwarburton.files.wordpress.com/2010/03/task_3.png"><img class="alignnone size-thumbnail wp-image-94" title="task_3" src="http://davidwarburton.files.wordpress.com/2010/03/task_3.png?w=150&h=116" alt="Create the action" width="150" height="116" /></a></p>
<p>Click <strong>OK </strong>to close the New Action window and again for the <strong>Create Task </strong>window.</p>
<p>Job done! You can right click on the task and select Run to try it out.</p>
<p>A much more elegant solution would be to have a native FreeNAS (or just BSD) client for CrashPlan or to make use of rsync/Unison. This will do me for now though.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/davidwarburton.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/davidwarburton.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/davidwarburton.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/davidwarburton.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/davidwarburton.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/davidwarburton.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/davidwarburton.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/davidwarburton.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/davidwarburton.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/davidwarburton.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/davidwarburton.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/davidwarburton.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/davidwarburton.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/davidwarburton.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=87&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davidwarburton.net/2010/03/12/using-crashplan-to-backup-a-network-share/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3a54ad2551bd756d17e5f75aab3c2acd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">DavidWarburton</media:title>
		</media:content>

		<media:content url="http://davidwarburton.files.wordpress.com/2010/03/service_1.png?w=144" medium="image">
			<media:title type="html">service_1</media:title>
		</media:content>

		<media:content url="http://davidwarburton.files.wordpress.com/2010/03/service_2.png?w=150" medium="image">
			<media:title type="html">service_2</media:title>
		</media:content>

		<media:content url="http://davidwarburton.files.wordpress.com/2010/03/service_3.png?w=150" medium="image">
			<media:title type="html">service_3</media:title>
		</media:content>

		<media:content url="http://davidwarburton.files.wordpress.com/2010/03/task_1.png?w=128" medium="image">
			<media:title type="html">task_1</media:title>
		</media:content>

		<media:content url="http://davidwarburton.files.wordpress.com/2010/03/task_2.png?w=150" medium="image">
			<media:title type="html">task_2</media:title>
		</media:content>

		<media:content url="http://davidwarburton.files.wordpress.com/2010/03/task_3.png?w=150" medium="image">
			<media:title type="html">task_3</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Powershell to report on Netapp filer snapshots</title>
		<link>http://blog.davidwarburton.net/2010/03/02/using-powershell-to-report-on-netapp-filer-snapshots/</link>
		<comments>http://blog.davidwarburton.net/2010/03/02/using-powershell-to-report-on-netapp-filer-snapshots/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 09:21:17 +0000</pubDate>
		<dc:creator>DavidWarburton</dc:creator>
				<category><![CDATA[Netapp]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Storage / Backups]]></category>

		<guid isPermaLink="false">http://blog.davidwarburton.net/?p=79</guid>
		<description><![CDATA[We had a few issues recently where SnapManager for Exchange and SnapDrive were failing to communicate properly which resulted in a weeks worth of missed snapshots before anyone realised what was going on. I wrote this script to report on the status of snapshots. The filer name is passed as a variable and a list [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=79&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We had a few issues recently where SnapManager for Exchange and SnapDrive were failing to communicate properly which resulted in a weeks worth of missed snapshots before anyone realised what was going on.</p>
<p>I wrote this script to report on the status of snapshots. The filer name is passed as a variable and a list of volume names is stored as a variable at the top of the script. The output is nicely formatted email.</p>
<ol>
<li>The script uses SSH to connect to the filer (see my <a href="/2010/02/26/scripting-netapp-filers/">SSH guide for Netapp filers</a>)</li>
<li>For each vol listed in the array, the list of snapshots is returned</li>
<li>Any line with &#8220;__daily&#8221; in is processed &#8211; all others are ignored (we only care about our nightly verified snapshots which are all named __daily)</li>
<li>The snapshot name contains the date/time it was taken &#8211; this is read and if the date is within 24 hours of now a success is return (since reports are run the day after the verified job). If the date is over 24 hours a failure is returned.</li>
<li>A nicely formated HTML email is sent out which looks a little something like this&#8230;</li>
</ol>
<p><strong>Please see below for today&#8217;s backup report.</strong></p>
<table style="font-size:xx-small;" border="1" cellpadding="0">
<tbody>
<tr>
<td valign="top"><strong>VOL Name</strong></td>
<td valign="top"><strong>Status</strong></td>
<td valign="top"><strong>Snapshot name</strong></td>
</tr>
<tr>
<td valign="top">Vol_Exc02_DB</td>
<td valign="top"><span style="color:#0000ff;">Success</span></td>
<td valign="top">0% ( 0%) 0% ( 0%) Mar   02 01:44 exchsnap__exchange02_03-01-2010_23.00.14__daily   (busy,backup[0],dump)</td>
</tr>
<tr>
<td valign="top">Vol_Exc02_LOG</td>
<td valign="top"><span style="color:#0000ff;">Success</span></td>
<td valign="top">0% ( 0%) 0% ( 0%) Mar   02 04:38 eloginfo__exchange02_03-01-2010_23.00.14__daily</td>
</tr>
<tr>
<td valign="top">Vol_Exc02_DB1</td>
<td valign="top"><span style="color:#0000ff;">Success</span></td>
<td valign="top">0% ( 0%) 0% ( 0%) Mar 01 23:00 exchsnap__exchange02_03-01-2010_23.00.14__daily</td>
</tr>
<tr>
<td valign="top">Vol_Exc02_LOG1</td>
<td valign="top"><span style="color:#0000ff;">Success</span></td>
<td valign="top">1% ( 0%) 0% ( 0%) Mar   02 01:27 eloginfo__exchange02_03-01-2010_23.00.14__daily</td>
</tr>
<tr>
<td valign="top">Vol_Exc03_DB</td>
<td valign="top"><span style="color:#0000ff;">Success</span></td>
<td valign="top">1% ( 1%) 0% ( 0%) Mar   02 00:50 exchsnap__exchange03_03-01-2010_23.00.13__daily</td>
</tr>
<tr>
<td valign="top">Vol_Exc03_LOG</td>
<td valign="top"><span style="color:#0000ff;">Success</span></td>
<td valign="top">0% ( 0%) 0% ( 0%) Mar   02 02:06 eloginfo__exchange03_03-01-2010_23.00.13__daily</td>
</tr>
<tr>
<td valign="top">Vol_Exc03_DB1</td>
<td valign="top"><span style="color:#ff0000;">FAILURE</span></td>
<td valign="top">1% ( 1%) 0% ( 0%) Feb   26 23:00 exchsnap__exchange03_03-01-2010_23.00.13__daily</td>
</tr>
<tr>
<td valign="top">Vol_Exc03_LOG1</td>
<td valign="top"><span style="color:#ff0000;">FAILURE</span></td>
<td valign="top">0% ( 0%) 0% ( 0%) Feb   26 00:32 eloginfo__exchange03_03-01-2010_23.00.13__daily</td>
</tr>
</tbody>
</table>
<p>See the script and HTML files after the jump&#8230;<span id="more-79"></span></p>
<p>Don&#8217;t forget to change the name of your mail server, your sending and recipient email addresses and, most importantly, the location of plink.exe and your DSA keys used to establish the SSH connection (although you could easily modify this script to use RSH instead).</p>
<h4>snapReport.ps1 script</h4>
<pre># ==============================================================================================
#
# NAME:     Netapp filer snapshot reports
#
# AUTHOR:     David Warburton
# DATE:     12/03/2009
#
# PARAMETERS:    1. $filer
#        Specifies the name of the remote filer to connect to.
#        example: snapReport.ps1 myfiler01
#
# ==============================================================================================
$debugPreference = "continue"
$errorActionPreference = "stop"
$filer = $Args[0]
$htmlFile = "D:\Logs\Exchange Snapshot Report\exchange_Snapshot.html"
$volumes = ("Vol_Exc02_DB", "Vol_Exc02_LOG", "Vol_Exc02_DB1", "Vol_Exc02_LOG1", "Vol_Exc03_DB", "Vol_Exc03_LOG", "Vol_Exc03_DB1", "Vol_Exc03_LOG1")
$header = get-content "header.html"
$header &gt; $htmlFile
$today = get-date
function sendEmail() {
 $eServer = new-object system.net.mail.smtpClient("mailserver.yourdomain.com")
 $From = "youraddress@yourcompany.com"
 $To = "backup_reports@yourcompany.com"
 if ($checkType -eq "weekly") {
 $title = "Weekly "
 } else {
 $title = "Daily "
 }
 $todayDate = [string] $today.day + "/" + [string] $today.month + "/" + [string] $today.year
 $title += "Exchange snapshot Report for $todayDate"
 $Body = get-content $htmlFile
 $eMsg = new-object System.Net.Mail.MailMessage($from,$to,$Title,$body)
 $eMsg.IsBodyHTML = $True
 #$eMsg.cc.add($cc)
 $eServer.send($eMsg)
}
function checkSnap($volName) {
 $output = D:\Utils\PuTTY\plink.exe svc-ssh@$filer -i D:\Utils\PuTTY\id_dsa.ppk snap list $volName
 $validsnap = $False
 $snapname = ""
 foreach ($line in $output){
 if ($line.contains("__daily")) {
 $sMonth = $line.substring(62, 2)
 $sDay = $line.substring(65, 2)
 $sYear = $line.substring(68, 4)
 $sDate = [datetime] "$sMonth $sDay $sYear"
 if (($sDate.date).addDays(1) -eq $today.date) {
 $validsnap = $True
 $snapname = $line
 }
 }
 if ($validsnap) {
 return $snapname
 }
 }
 return $False
}
foreach ($vol in $volumes) {
 $line = "&lt;tr&gt;&lt;td&gt;$vol&lt;/td&gt;"
 $status = checkSnap $vol
 if ($status -eq $false) {
 $line += "&lt;td&gt;&lt;font color=red&gt;FAILED&lt;/font&gt;&lt;/td&gt;"
 } else {
 $line += "&lt;td&gt;&lt;font color=blue&gt;Success&lt;/font&gt;&lt;/td&gt;"
 }
 $line += "&lt;td&gt;$status&lt;/td&gt;&lt;/tr&gt;"
 $line &gt;&gt; $htmlFile
}
$footer = Get-Content "footer.html"
$footer &gt;&gt; $htmlFile
sendEmail
</pre>
<p>Here are the HTML bits for the header and footer of the email&#8230;</p>
<h4>header.html</h4>
<pre>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"&gt;
&lt;html&gt;
&lt;head&gt;
 &lt;title&gt;Backup Report&lt;/title&gt;
 &lt;style type="text/css"&gt;
 body {
 font-family: Calibri, Arial, Helvetica;
 color: black;
 font-size: xx-small;
 background-color: #FFFFFF }
 p {
 font-size: x-small }
 .big {
 font-size: x-small;
 font-weight: bold }
 table {
 padding: 0px ;
 border-spacing: 2px ;
 empty-cells: hide ;
 border: 1px solid #AAAAAA }
 td {
 background-color: #EEEEEE;
 vertical-align: top }
 th {
 background-color: #EEEEEE;
 vertical-align: top ;
 text-align: left}
 &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;*** This email is now automatically generated ***&lt;br&gt;&lt;br&gt;&lt;b&gt;Please see below for today's backup report.&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;
 &lt;b&gt;NOTE: &lt;/b&gt;&lt;br/&gt;
 - Exchange and SQL snapshots are managed by SnapManager and are alerted independantly to this report.&lt;br/&gt;
 - Not &lt;u&gt;all&lt;/u&gt; snapshots are shown in these reports. Hourly snapshots are currently not reported upon.
&lt;/p&gt;
&lt;table&gt;
&lt;tr&gt;
 &lt;th&gt;VOL Name&lt;/th&gt;&lt;th&gt;Status&lt;/th&gt;&lt;th&gt;Number of Snapshots&lt;/th&gt;&lt;th&gt;Last snapshot taken&lt;/th&gt;
&lt;/tr&gt;
</pre>
<h4>footer.html</h4>
<pre>&lt;/table&gt;
&lt;br/&gt;
&lt;p&gt;Regards.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/davidwarburton.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/davidwarburton.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/davidwarburton.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/davidwarburton.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/davidwarburton.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/davidwarburton.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/davidwarburton.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/davidwarburton.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/davidwarburton.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/davidwarburton.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/davidwarburton.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/davidwarburton.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/davidwarburton.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/davidwarburton.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=79&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davidwarburton.net/2010/03/02/using-powershell-to-report-on-netapp-filer-snapshots/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3a54ad2551bd756d17e5f75aab3c2acd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">DavidWarburton</media:title>
		</media:content>
	</item>
		<item>
		<title>NTFS permissions lost when copying from a snapshot</title>
		<link>http://blog.davidwarburton.net/2010/03/01/ntfs-permissions-lost-when-copying-from-a-snapshot/</link>
		<comments>http://blog.davidwarburton.net/2010/03/01/ntfs-permissions-lost-when-copying-from-a-snapshot/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 10:04:24 +0000</pubDate>
		<dc:creator>DavidWarburton</dc:creator>
				<category><![CDATA[Netapp]]></category>
		<category><![CDATA[OnTAP 7.2.6]]></category>
		<category><![CDATA[Windows Server 2003]]></category>

		<guid isPermaLink="false">http://blog.davidwarburton.net/?p=75</guid>
		<description><![CDATA[Something I just remembered when performing a restore for a user. When copying files from a CIFS snapshot using the hidden .snapshot directory NTFS permissions are lost. Instead they are inherited from the folder you are copying to. To maintain permissions, use NDMPCOPY specifying the snapshot name in the source (first) parameter&#8230; ndmpcopy "filer1:/vol/vol_A/qtree_A/.snapshot/nightly.1/MyDocs" "filer1:/vol/vol_A/qtree_A/MyDocs" [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=75&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Something I just remembered when performing a restore for a user.</p>
<p>When copying files from a CIFS snapshot using the hidden .snapshot directory NTFS permissions are lost. Instead they are inherited from the folder you are copying to.</p>
<p>To maintain permissions, use NDMPCOPY specifying the snapshot name in the source (first) parameter&#8230;</p>
<pre>ndmpcopy "filer1:/vol/vol_A/qtree_A/.snapshot/nightly.1/MyDocs" "filer1:/vol/vol_A/qtree_A/MyDocs"</pre>
<p>You can enclose the path in quotes if the path has spaces in.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/davidwarburton.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/davidwarburton.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/davidwarburton.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/davidwarburton.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/davidwarburton.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/davidwarburton.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/davidwarburton.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/davidwarburton.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/davidwarburton.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/davidwarburton.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/davidwarburton.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/davidwarburton.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/davidwarburton.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/davidwarburton.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=75&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davidwarburton.net/2010/03/01/ntfs-permissions-lost-when-copying-from-a-snapshot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3a54ad2551bd756d17e5f75aab3c2acd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">DavidWarburton</media:title>
		</media:content>
	</item>
		<item>
		<title>Netapp Rapid Cloning Utility v3.0</title>
		<link>http://blog.davidwarburton.net/2010/02/26/netapp-rapid-cloning-utility-v3-0/</link>
		<comments>http://blog.davidwarburton.net/2010/02/26/netapp-rapid-cloning-utility-v3-0/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 16:02:01 +0000</pubDate>
		<dc:creator>DavidWarburton</dc:creator>
				<category><![CDATA[ESX]]></category>
		<category><![CDATA[ESXi]]></category>
		<category><![CDATA[Netapp]]></category>
		<category><![CDATA[Storage / Backups]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://blog.davidwarburton.net/?p=71</guid>
		<description><![CDATA[Netapp have released their new version of their Rapid Cloning Utility &#8211; a vCenter plugin which allows you to provision and new datastores and clone hosts (including VMware View 4 VDI&#8217;s) with ease right inside of the Virtual Infrastructure Client. vCenter 4 is needed but it is compatible with ESX 3.5 and 4. The great [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=71&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Netapp have released their new version of their Rapid Cloning Utility &#8211; a vCenter plugin which allows you to provision and new datastores and clone hosts (including VMware View 4 VDI&#8217;s) with ease right inside of the Virtual Infrastructure Client. vCenter 4 is needed but it is compatible with ESX 3.5 and 4.</p>
<p>The great thing is that all the storage processing is offloaded from vCenter and is performed entirely on the filers. I&#8217;ve not had a chance to play with the RCU yet but this just looks utterly awesome! Check out this preview blog post and video from Netapp:</p>
<p><a href="http://blogs.netapp.com/virtualstorageguy/2009/12/preview-rapid-cloning-utility-30-vcenter-plug-in.html" target="_blank">http://blogs.netapp.com/virtualstorageguy/2009/12/preview-rapid-cloning-utility-30-vcenter-plug-in.html</a></p>
<p>If you don&#8217;t have time to sit and read, then at least check out the video. I dare you not to be impressed!</p>
<p><span style="text-align:center; display: block;"><a href="http://blog.davidwarburton.net/2010/02/26/netapp-rapid-cloning-utility-v3-0/"><img src="http://img.youtube.com/vi/dBSC-IOw93I/2.jpg" alt="" /></a></span><br />
Do any other storage vendors have similar tools?</p>
<address>Source: <a href="http://www.ntapgeek.com/2010/02/netapp-updates-rcu-for-vmware-vsphere-4.html" target="_blank">http://www.ntapgeek.com/2010/02/netapp-updates-rcu-for-vmware-vsphere-4.html</a></address>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/davidwarburton.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/davidwarburton.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/davidwarburton.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/davidwarburton.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/davidwarburton.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/davidwarburton.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/davidwarburton.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/davidwarburton.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/davidwarburton.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/davidwarburton.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/davidwarburton.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/davidwarburton.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/davidwarburton.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/davidwarburton.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.davidwarburton.net&#038;blog=11246690&#038;post=71&#038;subd=davidwarburton&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.davidwarburton.net/2010/02/26/netapp-rapid-cloning-utility-v3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3a54ad2551bd756d17e5f75aab3c2acd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">DavidWarburton</media:title>
		</media:content>
	</item>
	</channel>
</rss>
