<?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>VCritical &#187; storage</title>
	<atom:link href="http://www.vcritical.com/tag/storage/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vcritical.com</link>
	<description>Informed Virtualization Criticism</description>
	<lastBuildDate>Fri, 12 Mar 2010 19:13:30 +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>The Truth About VM SAN Transfers</title>
		<link>http://www.vcritical.com/2009/12/the-truth-about-vm-san-transfers/</link>
		<comments>http://www.vcritical.com/2009/12/the-truth-about-vm-san-transfers/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 12:05:59 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[PASS]]></category>
		<category><![CDATA[SCVMM]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[vCenter]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=1959</guid>
		<description><![CDATA[While Microsoft marketing material claims Hyper-V and SCVMM can transfer large virtual machine files and templates over a SAN, the truth is that all VM transfers are done over the network.  Only VMware ESX leverages high-speed storage area networking for VM migration.]]></description>
			<content:encoded><![CDATA[<p>Most enterprise virtualization deployments make use of a robust shared storage infrastructure.  A high-performance SAN allows multiple hypervisors to access virtual machine disks and is the foundation for amazing virtualization benefits such as VMware vMotion and HA.  There are other benefits, too.</p>
<p>Virtualization management tasks such as cloning existing virtual machines or deploying new ones from templates often involve slinging around multi-gigabyte chunks of data.  It&#8217;s preferable to move or copy data on the SAN instead of the LAN because it can be faster, but more importantly, doing so reduces impact to other services that rely on the LAN.</p>
<h2>Use the SAN, ESX!</h2>
<p>VMware ESX will transfer VMs and templates over a SAN connection whenever possible but, if necessary, it also does a fine job of moving those bits over a standard LAN.  This goes for VMs <em>as well as templates</em> because with VMware vSphere, templates live on SAN datastores, too &#8212; shared among multiple ESX hosts &#8212; not on network file shares.  If templates <em>were </em>stored on a file server, there would be no choice other than to copy those multi-gigabyte files over the LAN and potentially impact other production traffic.</p>
<p>Nice design choice, VMware!  [<em>Actually, if you go back to the early days of VirtualCenter 1.x, templates could also be stored directly on the VC server and deployed over the network.  That option was removed as of VC 2.0.</em>]</p>
<p><strong>So far, so good.  Let&#8217;s take a look at how Hyper-V stacks up.<span id="more-1959"></span></strong></p>
<h2>Obfuscating the Inequalities</h2>
<p>In the tradition of the recent <a href="http://www.vcritical.com/2009/11/the-truth-about-storage-hot-add-and-remove/">storage hot add/remove claims</a>, Microsoft has again gone the extra mile to give the appearance of feature parity.</p>
<p>Take a look at this excerpt from the System Center Virtual Machine Manager 2008 R2 <a href="http://www.microsoft.com/systemcenter/virtualmachinemanager/en/us/whats-new-R2.aspx" target="_blank">What&#8217;s New page</a>:</p>
<p style="padding-left: 30px;"><strong>SAN migration into and out of clustered hosts:</strong> This allows virtual machines to migrate into and out of clusters using a SAN transfer, which saves the time required for copying the virtual machine file over the network.</p>
<p>And the <a href="http://www.microsoft.com/systemcenter/virtualmachinemanager/en/us/features.aspx" target="_blank">features page</a> is even more dramatic, proclaiming:</p>
<p style="padding-left: 30px;">Virtual machine images can be large and difficult to move over the network. VMM auto-detects SAN infrastructure and enables copying of virtual machine images over fiber at fast speeds, thus leveraging SAN investments.</p>
<p>Sounds good, just like VMware &#8212; and at one-sixth the price!  But there is a small problem: <strong>it is not true</strong>.</p>
<p>Hyper-V uses the BITS service to transfer VMs over the LAN in almost all cases.  There <em>is</em> a scenario where SCVMM can orchestrate the disconnection and reconnection of a SAN LUN, &#8220;transferring&#8221; a VM to another host.  Enabling the feature requires additional configuration and some software from your SAN vendor.  Of course, it also means going back to <em>one VM per LUN</em> and foregoing the wonders of <a href="http://www.vcritical.com/tag/csv/" target="_blank">CSV</a>.  Any takers?</p>
<h2>The SCVMM Library Server</h2>
<p>SCVMM 2008 R2 provides VM template functionality for Hyper-V.  Templates  and ISO images are stored in a Library, which uses standard Windows file services.  Obviously, that means no SAN copying for template deployments, either &#8212; kind of like VMware VirtualCenter 1.0.</p>
<h2>Conclusion</h2>
<p>&#8220;SAN LUN disconnect and reconnect&#8221; just doesn&#8217;t have the same ring to it as &#8220;SAN transfer&#8221; but I&#8217;m not sure that is sufficient justification for these misleading marketing claims.  And to use the word &#8220;copying&#8221; is simply dishonest.</p>
<p>Don&#8217;t make the mistake of assuming Hyper-V is just like VMware ESX.  Compare for yourself &#8212; seeing is believing.</p>
<p style="padding-left: 30px;">


<p>Related posts:<ol><li><a href='http://www.vcritical.com/2008/12/igt-part-2-san-misers/' rel='bookmark' title='Permanent Link: IGT Part 2: SAN Misers'>IGT Part 2: SAN Misers</a></li>
<li><a href='http://www.vcritical.com/2008/10/storage-vendors-unanimously-applaud-scvmm-innovation/' rel='bookmark' title='Permanent Link: Storage vendors unanimously applaud SCVMM innovation'>Storage vendors unanimously applaud SCVMM innovation</a></li>
<li><a href='http://www.vcritical.com/2009/11/the-truth-about-storage-hot-add-and-remove/' rel='bookmark' title='Permanent Link: The Truth About Storage Hot Add and Remove'>The Truth About Storage Hot Add and Remove</a></li>
<li><a href='http://www.vcritical.com/2009/01/using-scvmm-to-attach-iso-images-to-vmware-esx-vms/' rel='bookmark' title='Permanent Link: Using SCVMM to attach ISO images to VMware ESX VMs'>Using SCVMM to attach ISO images to VMware ESX VMs</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vcritical.com/2009/12/the-truth-about-vm-san-transfers/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>The Truth About Storage Hot Add and Remove</title>
		<link>http://www.vcritical.com/2009/11/the-truth-about-storage-hot-add-and-remove/</link>
		<comments>http://www.vcritical.com/2009/11/the-truth-about-storage-hot-add-and-remove/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 15:34:35 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[PASS]]></category>
		<category><![CDATA[SCVMM]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[VMFS]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=1944</guid>
		<description><![CDATA[VMware vSphere 4 offers multiple options for expanding virtual machine storage with zero downtime, including the ability to grow a running virtual disk.  Hyper-V marketing literature makes a similar claim, but is limited to simply adding another virtual disk.]]></description>
			<content:encoded><![CDATA[<p>VMware vSphere 4 supports a range of hot storage management technologies:</p>
<ul>
<li> vStorage VMFS Volume Grow</li>
<li> Hot Extend for Virtual Disks</li>
<li> Hot Virtual Disk Add/Remove</li>
</ul>
<p>With these capabilities, if space gets tight in your vSphere environment, it is easy to be proactive and address the issue before anyone notices.  The process goes something like this:</p>
<ul>
<li>Allocate additional physical hard disk space on your SAN to an appropriate LUN</li>
<li>Grow your VMFS datastore onto the newly added free space</li>
<li>Extend, or add new, virtual disks for the VMs that need more storage</li>
<li>Expand the volume inside the guest to create more usable space</li>
</ul>
<p>All without a reboot: zero downtime.</p>
<h2>Not All Virtualization Platforms are Created Equal</h2>
<p>Don&#8217;t jump to the conclusion that all hypervisors offer the same flexibility.  Perhaps you are wondering about Hyper-V capabilities?<span id="more-1944"></span></p>
<p>First, let&#8217;s take a look at some Microsoft System Center Virtual Machine Manager 2008 R2 (SCVMM) marketing statements:</p>
<p>The <a href="http://www.microsoft.com/systemcenter/virtualmachinemanager/en/us/whats-new-R2.aspx" target="_blank">What&#8217;s New</a> page announces:</p>
<p style="padding-left: 30px;"><strong>Hot addition/removal of Storage</strong>: Allows the addition and removal of storage to virtualized infrastructure without interruption. Additionally, &#8220;live&#8221; management of virtual hard disk (VHDs) or iSCSI pass through disks, allows administrators to take advantage of additional backup scenarios and readily use mission critical and storage-intensive applications.</p>
<p>The <a href="http://www.microsoft.com/systemcenter/virtualmachinemanager/en/us/top-benefits-R2.aspx" target="_blank">Top Benefits</a> list proclaims:</p>
<p style="padding-left: 30px;"><strong>Hot addition/removal of storage</strong>: With this capability, administrators can quickly and efficiently respond to changing storage requirements of virtual machines. This ability to hot-add additional storage eliminates the previous need to take the host down to upgrade storage thus increasing business continuity for end users and reducing complexity for administrators. Additionally it allows administrators to confidently deploy mission critical applications (in which up-time is of paramount importance) that may have rapidly changing storage requirements such as web, database or other business applications.</p>
<p>An IT decision-maker just might get the impression that both ESX and Hyper-V have essentially the same features. <strong>They do not.</strong></p>
<p>You may be surprised to find out that all of the descriptions above merely refer to <strong>adding a new virtual disk</strong> to a VM &#8212; providing the conditions are right.  You cannot grow an existing VHD, and you can&#8217;t safely remove a VHD with SCVMM.</p>
<h2>Plan Ahead</h2>
<p>First things first.  If your Hyper-V VM does not have a virtual SCSI adapter &#8212; templates and VMs from Hyper-V R1 do not &#8212; you won&#8217;t be able to hot add a new VHD until you correct that shortcoming.  Hello downtime.</p>
<p>SCVMM can add a new blank virtual disk to a VM or it can copy an existing one across the network from the Library &#8212; if you copied it there beforehand, but there is no way to add a VHD that may already be present on your SAN &#8212; even if it is already sitting right next to the destination VM.</p>
<h2>Removal?</h2>
<p>Up-time may be of <em>paramount importance</em>, but preventing data-loss was evidently not part of the original design.  Removing a VHD with SCVMM results in the immediate deletion of the underlying VHD file.  Ouch!  Thankfully, a recent patch improves administrator job security by throwing up a warning before this happens, providing an option to cancel.  There is no way to simply disconnect a VHD using SCVMM.</p>
<p>It turns out that if you really want to take advantage of those &#8220;Additional Backup Scenarios&#8221; by hot adding <em>and removing</em> virtual disks, you need your trusty Hyper-V Manager utility.  Still think System Center is a <a href="http://www.vcritical.com/2009/08/single-pane-of-glass-hyper-v-edition/">single pane of glass</a>?  And that&#8217;s not the only task that requires administrators to switch between Hyper-V interfaces.</p>
<h2>Conclusion</h2>
<p>Microsoft is trying hard to ride the coattails of VMware ESX.  The latest release of Hyper-V R2 still does not have capabilities enjoyed by VMware administrators since the ESX 3.5 days.</p>
<p>Don&#8217;t believe the obfuscated marketing literature.  VMware vSphere is for real.</p>


<p>Related posts:<ol><li><a href='http://www.vcritical.com/2009/11/vsphere-thin-provisioned-disk-performance/' rel='bookmark' title='Permanent Link: vSphere Thin-Provisioned Disk Performance'>vSphere Thin-Provisioned Disk Performance</a></li>
<li><a href='http://www.vcritical.com/2009/10/responsible-thin-provisioning-in-vmware-vsphere/' rel='bookmark' title='Permanent Link: Responsible Thin Provisioning in VMware vSphere'>Responsible Thin Provisioning in VMware vSphere</a></li>
<li><a href='http://www.vcritical.com/2009/12/the-truth-about-vm-san-transfers/' rel='bookmark' title='Permanent Link: The Truth About VM SAN Transfers'>The Truth About VM SAN Transfers</a></li>
<li><a href='http://www.vcritical.com/2009/10/easy-recovery-from-a-full-vmware-esx-datastore/' rel='bookmark' title='Permanent Link: Easy recovery from a full VMware ESX datastore'>Easy recovery from a full VMware ESX datastore</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vcritical.com/2009/11/the-truth-about-storage-hot-add-and-remove/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>vSphere Thin-Provisioned Disk Performance</title>
		<link>http://www.vcritical.com/2009/11/vsphere-thin-provisioned-disk-performance/</link>
		<comments>http://www.vcritical.com/2009/11/vsphere-thin-provisioned-disk-performance/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 06:19:55 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[PASS]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[thin provisioning]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=1934</guid>
		<description><![CDATA[A new paper published by the VMware Performance Team shows that virtual disks using  vStorage Thin Provisioning perform nearly as well as fully allocated thick disks.  ]]></description>
			<content:encoded><![CDATA[<p>Thin disk provisioning is a fully-supported feature in vSphere 4 that can save tons of storage space on your SAN by allowing virtual disks to consume storage space <em>as needed</em> instead all at once.</p>
<p>Under the supervision of VMware vCenter Server, ESX 4 thin provisioning is safe and reliable even for production workloads thanks to<a href="http://www.vcritical.com/2009/10/responsible-thin-provisioning-in-vmware-vsphere/"> advanced storage accounting and built-in monitoring</a>.  And even if the worst does happen &#8212; an unexpectedly full datastore &#8212; <a href="http://www.vcritical.com/2009/10/easy-recovery-from-a-full-vmware-esx-datastore/">recovery is simple</a>.</p>
<p>Now that <em>you </em>are convinced that VMware vSphere thin provisioning has a place in your data center, you may be wondering about performance tradeoffs.</p>
<p><strong>It turns out that thin disks perform just about as well as thick disks.</strong></p>
<h2>New Performance Results</h2>
<p>In this brand-new <a href="http://www.vmware.com/pdf/vsp_4_thinprov_perf.pdf">VMware vStorage Thin Provisioning performance study</a>, VMware performance engineers compare thick and thin disk performance.  This must-read document covers several important topics, such as:</p>
<ul>
<li>I/O-intensive benchmarking with a 16-node ESX cluster</li>
<li>File copy benchmarking with 2 ESX hosts</li>
<li>Fragmentation impact</li>
<li>Thin provisioning affect on co-located thick disks</li>
</ul>
<p>Now, go forth and provision&#8230; thinly.</p>


<p>Related posts:<ol><li><a href='http://www.vcritical.com/2009/01/finding-thin-provisioned-virtual-disks-with-powershell/' rel='bookmark' title='Permanent Link: Finding thin-provisioned virtual disks with PowerShell'>Finding thin-provisioned virtual disks with PowerShell</a></li>
<li><a href='http://www.vcritical.com/2009/10/responsible-thin-provisioning-in-vmware-vsphere/' rel='bookmark' title='Permanent Link: Responsible Thin Provisioning in VMware vSphere'>Responsible Thin Provisioning in VMware vSphere</a></li>
<li><a href='http://www.vcritical.com/2009/10/easy-recovery-from-a-full-vmware-esx-datastore/' rel='bookmark' title='Permanent Link: Easy recovery from a full VMware ESX datastore'>Easy recovery from a full VMware ESX datastore</a></li>
<li><a href='http://www.vcritical.com/2009/11/the-truth-about-storage-hot-add-and-remove/' rel='bookmark' title='Permanent Link: The Truth About Storage Hot Add and Remove'>The Truth About Storage Hot Add and Remove</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vcritical.com/2009/11/vsphere-thin-provisioned-disk-performance/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Easy recovery from a full VMware ESX datastore</title>
		<link>http://www.vcritical.com/2009/10/easy-recovery-from-a-full-vmware-esx-datastore/</link>
		<comments>http://www.vcritical.com/2009/10/easy-recovery-from-a-full-vmware-esx-datastore/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 21:57:37 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[PASS]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[Storage VMotion]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[thin provisioning]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[VMFS]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=1757</guid>
		<description><![CDATA[With VMware vSphere, ESX, and VMFS, running out of space on a datastore does not cause damage to virtual machines.  It is easy to recover without even a guest OS reboot.]]></description>
			<content:encoded><![CDATA[<p>This is the third article in a series on VMware vSphere thin-provisioned virtual disks.  Now that we&#8217;ve covered:</p>
<ul>
<li><a href="http://www.vcritical.com/2009/10/responsible-thin-provisioning-in-vmware-vsphere/">Full accounting for all provisioned storage space and complete monitoring</a></li>
<li><a href="http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/">Automatic response to a nearly-full datastore through vCenter Alarms, PowerShell, and Storage VMotion</a></li>
</ul>
<p>You may be <em>nearly </em>convinced to start using thin provisioning, but still wondering&#8230;</p>
<h2>What happens if a datastore fills up?</h2>
<p>When a datastore runs out of space, thin-provisioned virtual disks can no longer dynamically grow to accommodate additional storage demand.  When VMware ESX detects this condition, <strong>virtual machines in need of additional storage are instantly paused</strong> to prevent guest operating systems from failing.  Conversely, VMs that that read and write to existing allocated storage blocks will continue running without issue &#8212; <strong>not all virtual machines will be paused</strong> just because a datastore is out of space.</p>
<p>If you ever find yourself in this situation, it&#8217;s not hard to fix.  Here is one simple approach, step-by-step:</p>
<ol>
<li>Free up some space by deleting or moving files &#8212; ISO images or powered-off VMs would be perfect</li>
<li>Resume one of the paused VMs</li>
<li>Use Storage VMotion to move the disks for that VM to another datastore</li>
<li>Resume the remaining VMs</li>
</ol>
<p><strong>Watch the procedure in action:</strong><br />
<embed src="http://www.youtube.com/v/4G8MEC14eKU&#038;hl=en&#038;fs=1&#038;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></p>
<p>Depending on the size and storage demand of each VM, additional migrations may be needed.  An alternative resolution would be to add additional space to the SAN LUN and grow the VMFS volume.</p>
<p><span id="more-1757"></span></p>
<h2>The Experiment</h2>
<p>To simulate a sudden storage demand by the thin-provisioned VMs in the above video, I simply copied a large file from a network share to each Windows Server 2003 VM simultaneously.</p>
<p>For the curious, below is a PowerShell script for the task.  Run it from anywhere &#8212; it uses Sysinternals psexec to remotely initiate a file copy on each VM from a network share.</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #008000;"># VM naming convention combines this string with 2-digit number</span>
<span style="color: #800080;">$vmPrefix</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;VM2003e-&quot;</span>
&nbsp;
<span style="color: #008000;"># UNC path to a large file that will be copied into each VM</span>
<span style="color: #800080;">$iso</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;\\fileserver\ISO\large.iso&quot;</span>
&nbsp;
<span style="color: #008000;"># credentials to download above file from \\fileserver</span>
<span style="color: #800080;">$user</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;domain\username&quot;</span>
<span style="color: #800080;">$pass</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;pa55word&quot;</span>
&nbsp;
<span style="color: #008000;"># pass this function a list of numbers</span>
<span style="color: #0000FF;">function</span> createVmList <span style="color: #000000;">&#40;</span><span style="color: #800080;">$series</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #800080;">$vmList</span> <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
&nbsp;
    <span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$id</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$series</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
        <span style="color: #800080;">$vmList</span> <span style="color: pink;">+=</span>  <span style="color: pink;">%</span><span style="color: #000000;">&#123;</span><span style="color: #800000;">&quot;$vmPrefix{0:00}&quot;</span> <span style="color: #FF0000;">-f</span> <span style="color: #800080;">$id</span><span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #800080;">$vmList</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #008000;"># make sure Sysinternals psexec is in your path</span>
<span style="color: #0000FF;">function</span> psexecOnVm <span style="color: #000000;">&#40;</span><span style="color: #800080;">$cmd</span><span style="color: pink;">,</span> <span style="color: #800080;">$vmList</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #800080;">$vmList</span> <span style="color: pink;">|</span> <span style="color: pink;">%</span> <span style="color: #000000;">&#123;</span><span style="color: #008080; font-weight: bold;">Invoke-Expression</span> <span style="color: #800000;">&quot;psexec.exe \\$_ -d -u $user -p $pass $cmd&quot;</span><span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
psexecOnVM <span style="color: #800000;">&quot;cmd /c copy /Y $iso c:\&quot;</span> <span style="color: #000000;">&#40;</span>createVMlist <span style="color: #000000;">&#40;</span>31..39<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span></pre></div></div>

<h2>VMware ESX is Resilient</h2>
<p>You may have been surprised at how easy it is to recover from a full datastore &#8212; without so much as a guest OS reboot.  It&#8217;s a testament to the rock-solid architecture behind VMware ESX and VMFS.  No other virtualization platform comes close.  Try for yourself.  See what happens if a group of thin-provisioned Hyper-V virtual machines suddenly run out of storage &#8212; it&#8217;s not going to be pretty.</p>


<p>Related posts:<ol><li><a href='http://www.vcritical.com/2009/10/responsible-thin-provisioning-in-vmware-vsphere/' rel='bookmark' title='Permanent Link: Responsible Thin Provisioning in VMware vSphere'>Responsible Thin Provisioning in VMware vSphere</a></li>
<li><a href='http://www.vcritical.com/2009/11/vsphere-thin-provisioned-disk-performance/' rel='bookmark' title='Permanent Link: vSphere Thin-Provisioned Disk Performance'>vSphere Thin-Provisioned Disk Performance</a></li>
<li><a href='http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/' rel='bookmark' title='Permanent Link: PowerShell Prevents Datastore Emergencies'>PowerShell Prevents Datastore Emergencies</a></li>
<li><a href='http://www.vcritical.com/2009/01/finding-thin-provisioned-virtual-disks-with-powershell/' rel='bookmark' title='Permanent Link: Finding thin-provisioned virtual disks with PowerShell'>Finding thin-provisioned virtual disks with PowerShell</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vcritical.com/2009/10/easy-recovery-from-a-full-vmware-esx-datastore/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>PowerShell Prevents Datastore Emergencies</title>
		<link>http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/</link>
		<comments>http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 10:30:03 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[PASS]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[Storage VMotion]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[thin provisioning]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=1713</guid>
		<description><![CDATA[When a datastore in your VMware vSphere environment is about to fill up, you can have vCenter automatically spring into action to prevent downtime by using Storage VMotion.]]></description>
			<content:encoded><![CDATA[<p>In my previous post on <a href="http://www.vcritical.com/2009/10/responsible-thin-provisioning-in-vmware-vsphere/">VMware vSphere thin provisioning</a>, I pointed out the new datastore alarm feature.  You can take advantage of this feature to respond to a sudden storage demand and <strong>automatically take action before end users notice</strong>.</p>
<p>When triggered, vCenter Server alarm actions allow several options, including the ability to run an arbitrary command such as a VMware PowerCLI PowerShell script.  Please see <a href="http://blogs.vmware.com/vipowershell/2009/09/how-to-run-powercli-scripts-from-vcenter-alarms.html" target="_blank">Carter Shanklin&#8217;s in-depth article</a> for more details on how this works &#8212; note that he uses a different technique to launch the scripts.</p>
<h2>Storage VMotion to the Rescue</h2>
<p>When a datastore is about to run out of space, the fastest resolution may be to simply migrate virtual disks to another datastore.   VMware Storage VMotion provides that capability with zero downtime for VMs and no disruption to end users.  Fortunately, PowerCLI can perform this feat with ease, thanks to the Move-VM cmdlet.</p>
<p>Let&#8217;s take a look at a functional prototype PowerCLI PowerShell script:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #008080; font-weight: bold;">Add-PSSnapin</span> VMware.Vimautomation.Core
Connect<span style="color: pink;">-</span>VIServer localhost
&nbsp;
<span style="color: #800080;">$vmToMove</span> <span style="color: pink;">=</span> get<span style="color: pink;">-</span>vm <span style="color: pink;">-</span>Datastore <span style="color: #800080;">$env</span>:VMWARE_ALARM_TARGET_NAME <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">select-object</span> <span style="color: #008080; font-style: italic;">-first</span> <span style="color: #000000;">1</span>
&nbsp;
<span style="color: #800080;">$destDS</span> <span style="color: pink;">=</span> Get<span style="color: pink;">-</span>Datastore <span style="color: pink;">|</span> <span style="color: #0000FF;">where</span> <span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.FreeSpaceMB <span style="color: #FF0000;">-gt</span> <span style="color: #000000;">50000</span> <span style="color: #FF0000;">-and</span> <span style="color: #000080;">$_</span>.Accessible <span style="color: #FF0000;">-eq</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#125;</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">select-object</span> <span style="color: #008080; font-style: italic;">-first</span> <span style="color: #000000;">1</span>
&nbsp;
<span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$destDS</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	move<span style="color: pink;">-</span>vm <span style="color: pink;">-</span>VM <span style="color: #800080;">$vmToMove</span> <span style="color: pink;">-</span>Datastore <span style="color: #800080;">$destDS</span> <span style="color: pink;">-</span>RunAsync
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>This script is a proof-of-concept that is not ready for your production environment as it is &#8212; it just picks an arbitrary VM from the nearly-full datastore, finds another datastore with at least 50GB free, and moves the VM disks.  More comprehensive selection logic and error checking are needed for a critical task like this.<span id="more-1713"></span></p>
<p>Save your script on the vCenter Server system somewhere, such as C:\scripts\datastore.ps1.</p>
<h2>Create the Datastore Alarm</h2>
<p>Create a new alarm at an appropriate level in the vCenter hierarchy, such as a datacenter, and configure like this:</p>
<p><img class="alignnone size-full wp-image-1717" title="Datastore Alarm" src="http://www.vcritical.com/wp-content/uploads/2009/09/datastore-emergency-general.png" alt="Datastore Alarm" width="404" height="253" /></p>
<p>On the Triggers tab, add a &#8220;Datastore Disk Usage (%)&#8221; trigger to alert at a reasonable percentage &#8212; I opted for 93.</p>
<h2>Run PowerShell Directly from vCenter Server</h2>
<p>For whatever reason, PowerShell.exe does not do well when launched directly by another process &#8212; it tends to hang instead of exiting when it is finished.  As a workaround, it <em>can</em> be launched from cmd.exe as long as it receives something on standard input.  To do all that, the necessary code looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;">&quot;c:\windows\system32\cmd.exe&quot; &quot;/c <span style="color: #b1b100; font-weight: bold;">echo</span>.|powershell.exe -nologo -noprofile -noninteractive c:\scripts\datastore.ps1&quot;</pre></div></div>

<p>For an alternate approach, take a look at the intermediate batch file solution described by Carter Shanklin in the link above.</p>
<p>On the Actions tab, add a &#8220;Run a command&#8221; action and supply the appropriate command.  You also need to decide whether to run one time or repeat the action.</p>
<p><a href="http://www.vcritical.com/wp-content/uploads/2009/09/datastore-emergency-run-command.png"><img class="alignnone size-medium wp-image-1718" title="Datastore alarm running a PowerShell script" src="http://www.vcritical.com/wp-content/uploads/2009/09/datastore-emergency-run-command-300x191.png" alt="Datastore alarm running a PowerShell script" width="300" height="191" /></a></p>
<h2>Action!</h2>
<p>To test the alarm, either fill up the datastore or temporarily lower the alarm threshold.  When the alarm fires, a Storage VMotion should be seen in the vSphere Client:</p>
<p><img class="alignnone size-full wp-image-1721" title="Storage VMotion in progress" src="http://www.vcritical.com/wp-content/uploads/2009/09/svmotion-inprogress.png" alt="Storage VMotion in progress" width="381" height="39" /></p>
<p>Note the &#8220;Initiated by&#8221; column &#8212; that&#8217;s the machine account for this vCenter Server.  The PowerCLI script is kicked off from vpxd.exe, which is running as LocalSystem.</p>
<p>Additional information is available by looking at the Tasks &amp; Events tab for the datastore.  Here you can see a sample sequence of events, newest on top:</p>
<p><img class="alignnone size-full wp-image-1723" title="Datastore emergency events" src="http://www.vcritical.com/wp-content/uploads/2009/09/datastore-emergency-events.png" alt="Datastore emergency events" width="500" height="418" /></p>
<h2>The Last Resort</h2>
<p>This automated Storage VMotion recovery alarm is a safety valve that could help you avoid suddenly running out of space on a datastore.  It should not take the place of more proactive storage management, but it sure beats VM downtime.</p>
<p style="padding-left: 30px;">In case you are wondering: No, you can&#8217;t do the same thing with Hyper-V because Hyper-V does not have zero-downtime Storage VMotion.  Just another reason to choose VMware vSphere &#8212; as if you needed <em>another</em> reason.</p>
<p><strong>Have you used vCenter alarms to automate any recovery processes in your environment?<br />
</strong></p>


<p>Related posts:<ol><li><a href='http://www.vcritical.com/2009/10/easy-recovery-from-a-full-vmware-esx-datastore/' rel='bookmark' title='Permanent Link: Easy recovery from a full VMware ESX datastore'>Easy recovery from a full VMware ESX datastore</a></li>
<li><a href='http://www.vcritical.com/2009/10/responsible-thin-provisioning-in-vmware-vsphere/' rel='bookmark' title='Permanent Link: Responsible Thin Provisioning in VMware vSphere'>Responsible Thin Provisioning in VMware vSphere</a></li>
<li><a href='http://www.vcritical.com/2009/02/vi-toolkit-for-windows-15-and-the-powershell-prompt/' rel='bookmark' title='Permanent Link: VI Toolkit (for Windows) 1.5 and the PowerShell prompt'>VI Toolkit (for Windows) 1.5 and the PowerShell prompt</a></li>
<li><a href='http://www.vcritical.com/2009/06/vmware-vsphere-4-has-a-snapshot-alarm/' rel='bookmark' title='Permanent Link: VMware vSphere 4 has a Snapshot Alarm'>VMware vSphere 4 has a Snapshot Alarm</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Responsible Thin Provisioning in VMware vSphere</title>
		<link>http://www.vcritical.com/2009/10/responsible-thin-provisioning-in-vmware-vsphere/</link>
		<comments>http://www.vcritical.com/2009/10/responsible-thin-provisioning-in-vmware-vsphere/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 13:49:04 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[PASS]]></category>
		<category><![CDATA[snapshots]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[thin provisioning]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=1684</guid>
		<description><![CDATA[VMware vSphere 4 offers thin provisioned virtual disks backed by management that enables safe use in a production environment thanks to advanced accounting of all provisioned space.]]></description>
			<content:encoded><![CDATA[<p>A cost-saving feature introduced in VMware vSphere 4 is <strong>fully supported</strong> <a href="http://www.vmware.com/products/vstorage-thin-provisioning/overview.html" target="_blank">thin-provisioned virtual disks</a>. Thin-provisioning decreases demand for SAN storage space by permitting virtual disks to consume just the space they actually use &#8212; and grow as needed &#8212; instead of pre-allocating all space up front.</p>
<p>What&#8217;s new is not necessarily the <em>technology</em> &#8212; it&#8217;s the <a href="http://www.youtube.com/watch?v=FRZh-mzchnM&amp;NR=1" target="_blank"><em>management</em></a>.  In fact, veteran VMware ESX admins have been creating thin provisioned virtual disks for years &#8212; for controlled scenarios &#8212; by way of the <strong>vmkfstools</strong> command.</p>
<p>Before vSphere and ESX 4, however, thin disks came with risk &#8212; there was no simple way of accounting for the overcommitted storage on each LUN.  Even with multiple gigabytes of free space, a small gang of thin-provisioned virtual machines could quickly quickly grow to exceed datastore capacity during a sudden demand spike.</p>
<h2>Complete Storage Accounting</h2>
<p>Now in vSphere 4 there is a new element in the capacity section of the datastore summary tab that shows total provisioned space &#8212; the maximum potential growth of all virtual machines if thin provisioned disks were fully utilized:</p>
<p><img class="alignnone size-full wp-image-1686" title="Datastore summary tab shows committed capacity" src="http://www.vcritical.com/wp-content/uploads/2009/09/datastore-summary-tab-capacity.png" alt="Datastore summary tab shows committed capacity" width="350" height="127" /></p>
<p>Virtual machines with snapshots have the potential of consuming <strong>even more</strong> datastore space, so vSphere accounts for this condition, too. <span id="more-1684"></span> Take a look at this VM Summary tab, where the total provisioned storage includes:</p>
<ul>
<li>Virtual hard disk (40GB)</li>
<li>Snapshot (another 40GB potential, worst-case)</li>
<li>VM swap file (1GB &#8212; sized according to RAM in theVM)</li>
</ul>
<p><img class="alignnone size-full wp-image-1692" title="Storage resources for VM with snapshot" src="http://www.vcritical.com/wp-content/uploads/2009/09/vm-resources-with-snapshot-poweredon.png" alt="Storage resources for VM with snapshot" width="374" height="207" /></p>
<p>As you can see, a VM with a 40GB virtual disk can actually consume up to 81GB of space on your SAN because of a forgotten snapshot!  Use the  <a href="http://www.vcritical.com/2009/06/vmware-vsphere-4-has-a-snapshot-alarm/" target="_self">snapshot alarm</a> to stay in control.  And don&#8217;t forget that VMware vSphere snapshots are perfectly <a href="http://www.vcritical.com/2009/04/hyper-v-snapshots-not-for-production/">suitable for production</a>.</p>
<h2>New Datastore Alarms</h2>
<p>New alarms in vSphere prevent out-of-space surprises.  Administrators can monitor not only the free space on a datastore, but also the percentage overallocated &#8212; making it easy to adhere to policies concerning thin provisioning aggressiveness in your environment.</p>
<p><img class="alignnone size-full wp-image-1699" title="Datastore alarm for disk overallocation" src="http://www.vcritical.com/wp-content/uploads/2009/09/datastore-disk-overalloc-alarm.png" alt="Datastore alarm for disk overallocation" width="397" height="137" /></p>
<h2>Flexible Virtual Disk Re-configuration</h2>
<p>When creating a new VM, opting for thin-provisioned disks is as easy as checking a box.  If you change your mind later, you don&#8217;t have to start over &#8212; during a Storage VMotion operation, administrators can opt to change the VM disk format on the fly (see below).  It is also possible to inflate thin disks into thick via a new menu in the Datastore Browser.</p>
<p><img class="alignnone size-full wp-image-1687" title="VM disk format selection during Storage VMotion" src="http://www.vcritical.com/wp-content/uploads/2009/09/vm-disk-format-selection.png" alt="VM disk format selection during Storage VMotion" width="512" height="256" /></p>
<h2>Danger!</h2>
<p>You&#8217;ve probably heard the now-famous quote by Tom Bittman from Gartner:</p>
<blockquote><p>Virtualization without good management is more dangerous than not using virtualization in the first place.</p></blockquote>
<p>That goes <em>double </em>for thin-provisioned virtual disks.  Without comprehensive accounting and monitoring in place, your virtual infrastructure may be heading for disaster.  <strong>This level of insight is only available with VMware vSphere 4 &#8212; and it&#8217;s built right into the platform.</strong></p>
<p>What about Microsoft virtualization?  Hyper-V R2 thin provisioning &#8212; known as &#8220;dynamic disks&#8221; &#8212; is not a <a href="http://blogs.technet.com/mghazai/archive/2009/09/04/hyper-v-dynamic-expanding-or-fixed-size-vhd.aspx" target="_blank">best practice</a>.  Perhaps due to the lack of accounting and monitoring of storage overcommitment &#8212; especially critical now with Cluster Shared Volumes and multiple VMs per LUN.</p>
<p><strong>Are <em>you</em> using vSphere thin provisioning?</strong></p>


<p>Related posts:<ol><li><a href='http://www.vcritical.com/2009/11/vsphere-thin-provisioned-disk-performance/' rel='bookmark' title='Permanent Link: vSphere Thin-Provisioned Disk Performance'>vSphere Thin-Provisioned Disk Performance</a></li>
<li><a href='http://www.vcritical.com/2009/10/easy-recovery-from-a-full-vmware-esx-datastore/' rel='bookmark' title='Permanent Link: Easy recovery from a full VMware ESX datastore'>Easy recovery from a full VMware ESX datastore</a></li>
<li><a href='http://www.vcritical.com/2009/01/finding-thin-provisioned-virtual-disks-with-powershell/' rel='bookmark' title='Permanent Link: Finding thin-provisioned virtual disks with PowerShell'>Finding thin-provisioned virtual disks with PowerShell</a></li>
<li><a href='http://www.vcritical.com/2009/06/vmware-vsphere-4-has-a-snapshot-alarm/' rel='bookmark' title='Permanent Link: VMware vSphere 4 has a Snapshot Alarm'>VMware vSphere 4 has a Snapshot Alarm</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vcritical.com/2009/10/responsible-thin-provisioning-in-vmware-vsphere/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>VMware vSphere 4 has a Snapshot Alarm</title>
		<link>http://www.vcritical.com/2009/06/vmware-vsphere-4-has-a-snapshot-alarm/</link>
		<comments>http://www.vcritical.com/2009/06/vmware-vsphere-4-has-a-snapshot-alarm/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 18:16:03 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[snapshots]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=1222</guid>
		<description><![CDATA[Snapshots have always been a powerful feature of VMware ESX &#8212; even in production deployments.  There are tons of innovative tools and scripts out there to monitor snapshots &#8212; just check out this new one from Virtu-Al.
If you happen to want a simple, built-in way to monitor your snapshots in VMware vSphere 4, look no [...]]]></description>
			<content:encoded><![CDATA[<p>Snapshots have always been a powerful feature of VMware ESX &#8212; <a href="http://www.vcritical.com/2009/04/hyper-v-snapshots-not-for-production/">even in production deployments</a>.  There are tons of innovative tools and scripts out there to monitor snapshots &#8212; just check out this <a href="http://www.virtu-al.net/2009/06/22/powercli-snapreminder/" target="_blank">new one from Virtu-Al</a>.</p>
<p>If you happen to want a simple, built-in way to monitor your snapshots in VMware vSphere 4, look no further than this new alarm:</p>
<p><img class="alignnone size-full wp-image-1223" title="VM Alarm for Snapshot Size" src="http://www.vcritical.com/wp-content/uploads/2009/06/vm_alarm_snapshot_size.png" alt="VM Alarm for Snapshot Size" width="406" height="219" /></p>
<p>Very nice addition.</p>


<p>Related posts:<ol><li><a href='http://www.vcritical.com/2009/10/responsible-thin-provisioning-in-vmware-vsphere/' rel='bookmark' title='Permanent Link: Responsible Thin Provisioning in VMware vSphere'>Responsible Thin Provisioning in VMware vSphere</a></li>
<li><a href='http://www.vcritical.com/2008/12/half-the-vm-reboots-on-patch-tuesday/' rel='bookmark' title='Permanent Link: Half the VM reboots on Patch Tuesday'>Half the VM reboots on Patch Tuesday</a></li>
<li><a href='http://www.vcritical.com/2010/02/taking-snapshots-of-vmware-esx-4-running-in-a-vm/' rel='bookmark' title='Permanent Link: Taking snapshots of VMware ESX 4 running in a VM'>Taking snapshots of VMware ESX 4 running in a VM</a></li>
<li><a href='http://www.vcritical.com/2009/04/hyper-v-snapshots-not-for-production/' rel='bookmark' title='Permanent Link: Hyper-V snapshots: not for production'>Hyper-V snapshots: not for production</a></li>
</ol></p><div style="font-family:Verdana; color:#000000; background-color: #C0C0C0; padding: 7px;border: dashed thin">

<a href="http://www.vcritical.com/2009/06/vmware-vsphere-4-has-a-snapshot-alarm/#comments">Leave a Comment</a> •
<a href="http://feedproxy.google.com/vcritical">Subscribe to RSS</a> •
<a href="http://feedburner.google.com/fb/a/mailverify?uri=vcritical&loc=en_US">Subscribe via Email</a> •
<a href="http://www.twitter.com/eric_gray">Follow Eric Gray on Twitter</a><br/>

More articles on: <a href="http://www.vcritical.com/tag/esx/" rel="tag">ESX</a>, <a href="http://www.vcritical.com/tag/snapshots/" rel="tag">snapshots</a>, <a href="http://www.vcritical.com/tag/storage/" rel="tag">storage</a>, <a href="http://www.vcritical.com/tag/vcenter/" rel="tag">vCenter</a>, <a href="http://www.vcritical.com/tag/vsphere/" rel="tag">vSphere</a> • <a href="http://www.vcritical.com/category/virtualizationism/">Browse All Virtualization Content</a><br/>

<a href="http://www.vcritical.com/2009/06/vmware-vsphere-4-has-a-snapshot-alarm/">VMware vSphere 4 has a Snapshot Alarm</a> by <a href="http://www.vcritical.com/about/">Eric Gray</a> © 2009 • <a href="http://www.vcritical.com/">VCritical</a>

</div>]]></content:encoded>
			<wfw:commentRss>http://www.vcritical.com/2009/06/vmware-vsphere-4-has-a-snapshot-alarm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Finding thin-provisioned virtual disks with PowerShell</title>
		<link>http://www.vcritical.com/2009/01/finding-thin-provisioned-virtual-disks-with-powershell/</link>
		<comments>http://www.vcritical.com/2009/01/finding-thin-provisioned-virtual-disks-with-powershell/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 18:26:39 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[VI Client]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=514</guid>
		<description><![CDATA[Even though the VI Client does not offer creation of VMs with thin-provisioned disks, they may exist.  Use a PowerShell script to identify them.]]></description>
			<content:encoded><![CDATA[<p>By default, all virtual hard disks in VI3 are <strong>thick disks</strong> &#8212; space is allocated on the VMFS datastore for the entire disk.  <strong>Thin disks</strong>, on the other hand, grow dynamically according to guest OS demand.  There is a slight performance penalty with thin disks, but the real risk when using them is inadvertently filling up datastores after overcommitting storage resources.</p>
<p>The VI Client interface will not let administrators create new virtual machines with thin-provisioned disks.  Even so, it is entirely possible that your environment contains such disks.  Let&#8217;s take a look at a couple of ways to create these disks and then use a VI Toolkit (for Windows) PowerShell script to see if any exist.<span id="more-514"></span></p>
<h2>Manual VMDK Creation</h2>
<p>One way that thin disks may be introduced into an environment is by manually creating a VMDK file and then attaching that file to a virtual machine.  This can be accomplished by the vmkfstools command with the -d thin option.  This procedure is not for beginners, so if you have used it you presumably evaluated the risks of overcommitting your storage.  But what if one of your colleagues did this without telling you?</p>
<h2>Compact Clones</h2>
<p><img class="alignleft size-full wp-image-515" title="VI Client - Clone to template" src="http://www.vcritical.com/wp-content/uploads/2009/01/clone-to-template-menu.png" alt="VI Client - Clone to template" width="181" height="207" />Another source of thin disks requires a little background first:</p>
<p>There is a prominent option in the VI Client interface to convert a virtual machine to template (and vice versa).  But if you right-click a VM in the inventory, you are presented with a variation of that feature:  <strong>Clone to Template</strong>.</p>
<p>The wizard that launches in response to that option allows an administrator to optionally choose the <strong>Compact</strong> disk format &#8212; this is a thin-provisioned disk.  If your template has a 50GB virtual disk but only 8GB are actually used, this feature can provide significant storage savings.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-516" style="border: 1px solid black;" title="Clone to Template Wizard - Compact disk" src="http://www.vcritical.com/wp-content/uploads/2009/01/wizard-compact.png" alt="Clone to Template Wizard - Compact disk" width="499" height="347" /></p>
<p>So far so good.  Now, what do you suppose happens if you decide to convert that template to a VM?  Nothing happens &#8212; it just works.  You are free to use that VM just like any other in your inventory.  But this VM keeps its thin-provisioned disk, a fact that is not discernible through the user interface.</p>
<h2>Find the Thin-Provisioned Disks</h2>
<p>I wrote a small VI Toolkit (for Windows) PowerShell script that identifies latent thin disks in both VMs and templates.  I hope you find it useful:</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #008000;"># FindThinDisks.ps1</span>
<span style="color: #008000;">#</span>
<span style="color: #008000;"># Identifies VMs and templates that are using thin-provisioned</span>
<span style="color: #008000;"># virtual disks.</span>
&nbsp;
<span style="color: #008000;"># Version 1.0  January 14, 2009</span>
<span style="color: #008000;"># Eric Gray</span>
&nbsp;
<span style="color: #800080;">$vmtp</span> <span style="color: pink;">=</span> Get<span style="color: pink;">-</span>VM
<span style="color: #800080;">$vmtp</span> <span style="color: pink;">+=</span> Get<span style="color: pink;">-</span>Template
&nbsp;
<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$vm</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$vmtp</span> <span style="color: pink;">|</span> Get<span style="color: pink;">-</span>View<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
  <span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$dev</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$vm</span>.Config.Hardware.Device<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
    <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$dev</span>.GetType<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.Name <span style="color: #FF0000;">-eq</span> <span style="color: #800000;">&quot;VirtualDisk&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
      <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$dev</span>.Backing.ThinProvisioned <span style="color: #FF0000;">-eq</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
        <span style="color: #800080;">$vm</span>.Name <span style="color: pink;">+</span> <span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`t</span>&quot;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$dev</span>.Backing.FileName
      <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
  <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p style="text-align: left;">Thin-provisioning is a great tool to have in your toolbox, when used properly.</p>
<p style="text-align: right;"><em>Script inspired by <a href="http://communities.vmware.com/message/1136794" target="_blank">this thread</a>.</em></p>


<p>Related posts:<ol><li><a href='http://www.vcritical.com/2009/11/vsphere-thin-provisioned-disk-performance/' rel='bookmark' title='Permanent Link: vSphere Thin-Provisioned Disk Performance'>vSphere Thin-Provisioned Disk Performance</a></li>
<li><a href='http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/' rel='bookmark' title='Permanent Link: PowerShell Prevents Datastore Emergencies'>PowerShell Prevents Datastore Emergencies</a></li>
<li><a href='http://www.vcritical.com/2009/10/responsible-thin-provisioning-in-vmware-vsphere/' rel='bookmark' title='Permanent Link: Responsible Thin Provisioning in VMware vSphere'>Responsible Thin Provisioning in VMware vSphere</a></li>
<li><a href='http://www.vcritical.com/2009/10/easy-recovery-from-a-full-vmware-esx-datastore/' rel='bookmark' title='Permanent Link: Easy recovery from a full VMware ESX datastore'>Easy recovery from a full VMware ESX datastore</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vcritical.com/2009/01/finding-thin-provisioned-virtual-disks-with-powershell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using SCVMM to attach ISO images to VMware ESX VMs</title>
		<link>http://www.vcritical.com/2009/01/using-scvmm-to-attach-iso-images-to-vmware-esx-vms/</link>
		<comments>http://www.vcritical.com/2009/01/using-scvmm-to-attach-iso-images-to-vmware-esx-vms/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 20:59:04 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[ESXi]]></category>
		<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[ISO]]></category>
		<category><![CDATA[SCVMM]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=497</guid>
		<description><![CDATA[By design, System Center Virtual Machine Manager copies ISO CD/DVD images to managed hosts instead of sharing.  For VMware ESX it uses SFTP.  For ESXi, it fails.]]></description>
			<content:encoded><![CDATA[<p>When a virtual machine requires access to a CD or DVD, it is very typical to connect an ISO image file to the VM instead of using a physical disc.  When using VMware ESX or ESXi, multiple VMs are allowed to access a single ISO image on shared storage.  System Center Virtual Machine Manager 2008 (SCVMM) uses a different design &#8212; instead of sharing a single image from the library server, a copy of the image is made to the SAN for each VM before use.  I have <a href="http://www.vcritical.com/2008/10/storage-vendors-unanimously-applaud-scvmm-innovation/">written about this before</a>.</p>
<p>If VMware vCenter and SCVMM use opposing techniques to perform this operation, what happens when an administrator tries to use SCVMM to manage ESX or ESXi?  Evidently not wanting to give ESX special treatment, SCVMM copies the ISO just like it does for Hyper-V.</p>
<p>&#8220;Copies it how?&#8221; you must be thinking.  With SFTP through the ESX service console, of course!</p>
<p><img class="aligncenter size-full wp-image-498" title="esx-deploy-sftp" src="http://www.vcritical.com/wp-content/uploads/2009/01/esx-deploy-sftp.png" alt="esx-deploy-sftp" width="382" height="225" /></p>
<p>Let&#8217;s review the numerous disadvantages of not having a shared ISO image repository:</p>
<ol>
<li>Takes longer to mount an ISO to a VM</li>
<li>Ties up expensive SAN storage for duplicate copies of images</li>
<li>Uses network bandwidth to copy these multi-gigabyte files</li>
<li>Wastes ESX service console CPU cycles to receive SFTP uploads</li>
</ol>
<p><span id="more-497"></span>I was giving a presentation this morning to the VMware Sales team and a question was raised by one of the participants:  If you are using VMware ESXi how is the image transferred &#8212; there is no service console and therefore no SSH daemon.  Not having tried this operation, I theorized that it would be done using the API &#8212; similar to how the VI Client can easily upload files to an ESXi datastore.</p>
<p>After that presentation, I hijacked a colleague&#8217;s ESXi system and tried to connect an ISO image to a VM.  Sure enough, the file was transferred via HTTP.  So far, so good.</p>
<p><img class="aligncenter size-full wp-image-499" title="SCVMM deploying ISO image via HTTP" src="http://www.vcritical.com/wp-content/uploads/2009/01/esxi-deploy-http.png" alt="SCVMM deploying ISO image via HTTP" width="357" height="182" /></p>
<p>But there was a problem.  Shortly after this job finished, the VM in question started showing warning messages about not being able to locate the file.  I opened the VI Client and used the datastore browser to look at the VM directory.  There was no ISO image to be found.</p>
<p>Digging a little deeper, I grabbed the hostd.log file from the ESXi server to look for clues.   Here is an excerpt:</p>
<pre style="font-family:monospace;"> warning] Exception while processing request: Input/output error
 info] Incomplete message body received for PUT /folder/win2k3r2/en_win_srv_</pre>
<p>Looks like a problem with the SCVMM/ESXi integration.  As far as I can tell the host is properly configured in SCVMM &#8212; which is accomplished by providing the root password so tasks like this can be performed.  (But that&#8217;s an entirely different issue to talk about.)  I separately verified that I could upload a file to that same host using the VI Client.</p>
<p>I must conclude that it is not possible to use SCVMM to attach an ISO image file to VMware ESXi virtual machines.  Is SCVMM a <strong>single pane of glass</strong> to manage your entire virtual infrastructure?  I don&#8217;t think so.</p>


<p>Related posts:<ol><li><a href='http://www.vcritical.com/2008/10/storage-vendors-unanimously-applaud-scvmm-innovation/' rel='bookmark' title='Permanent Link: Storage vendors unanimously applaud SCVMM innovation'>Storage vendors unanimously applaud SCVMM innovation</a></li>
<li><a href='http://www.vcritical.com/2008/12/igt-part-2-san-misers/' rel='bookmark' title='Permanent Link: IGT Part 2: SAN Misers'>IGT Part 2: SAN Misers</a></li>
<li><a href='http://www.vcritical.com/2009/08/if-vmware-esxi-4-is-so-small-why-is-it-so-big/' rel='bookmark' title='Permanent Link: If VMware ESXi 4 is so small, why is it so big?'>If VMware ESXi 4 is so small, why is it so big?</a></li>
<li><a href='http://www.vcritical.com/2009/03/managing-vi3-with-scvmm-considered-harmful/' rel='bookmark' title='Permanent Link: Managing VI3 with SCVMM considered harmful'>Managing VI3 with SCVMM considered harmful</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vcritical.com/2009/01/using-scvmm-to-attach-iso-images-to-vmware-esx-vms/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Snapshots that shoot back</title>
		<link>http://www.vcritical.com/2008/12/snapshots-that-shoot-back/</link>
		<comments>http://www.vcritical.com/2008/12/snapshots-that-shoot-back/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 21:09:09 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[SCVMM]]></category>
		<category><![CDATA[snapshots]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=402</guid>
		<description><![CDATA[Although the Hyper-V Manager and SCVMM allow removing snapshots from running VMs, they are not actually merged until the VM is powered off.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-411" style="border: 1px solid black; margin-right: 3px;" title="new-checkpoint" src="http://www.vcritical.com/wp-content/uploads/2008/12/new-checkpoint.png" alt="new-checkpoint" width="127" height="79" /></p>
<p>Snapshots are one of the great features of virtualization, but forget about one on an active VM for too long and you may be calling for cleanup on aisle one.  Recently there was a fair amount of discussion among VM bloggers about snapshots.  Jason Boche had a <a href="http://www.boche.net/blog/?p=553">nice article that summarized some monitoring strategies</a> and <a href="http://vmetc.com/2008/12/06/esx-snapshots-are-like-a-loaded-gun/">Rich Brambley also weighed in</a>.</p>
<p>You may be wondering what makes snapshots so great.  At the top of the list is the ability to have an easy roll-back plan for failed upgrades.  For example, an administrator can take a VM snapshot before applying patches to a guest OS.  After rebooting and testing, if all is well, simply delete the snapshot and move on &#8212; the changes are merged while the virtual machine is running.  If for some reason a patch caused problems, the previous state can be quickly restored.</p>
<p>That&#8217;s how VMware ESX works.  Is Microsoft Hyper-V the same?<span id="more-402"></span></p>
<p>It turns out that Hyper-V snapshots (or <a href="http://www.vcritical.com/2008/12/checkshots-or-snappoints/">SCVMM checkpoints</a>, depending on which single pane of glass you are using) use a slightly different design. The Microsoft interfaces allow administrators to remove snapshots from powered-on VMs, and after doing so, they <em>appear</em> to be gone:</p>
<p><img class="alignnone size-full wp-image-403" style="border: 1px solid black;" title="selected-vm-has-no-snapshots" src="http://www.vcritical.com/wp-content/uploads/2008/12/selected-vm-has-no-snapshots.png" alt="selected-vm-has-no-snapshots" width="439" height="85" /></p>
<p>But, upon closer inspection, the changes are not actually merged until the VM is <strong>powered off</strong>:</p>
<p><img class="alignnone size-full wp-image-404" style="border: 1px solid black;" title="merge-in-progress" src="http://www.vcritical.com/wp-content/uploads/2008/12/merge-in-progress.png" alt="merge-in-progress" width="487" height="56" /></p>
<p>What happens if an administrator is not aware of this behavior?  Just as if the snapshot was never deleted, it grow and grow until the LUN on which it lives runs out of space:</p>
<p><img class="alignnone size-full wp-image-406" title="low-disk-space" src="http://www.vcritical.com/wp-content/uploads/2008/12/low-disk-space.png" alt="low-disk-space" width="336" height="89" /></p>
<p>And when that happens, the VM will go into a Paused-Critical state:</p>
<p><img class="alignnone size-full wp-image-405" style="border: 1px solid black;" title="hyper-v-vm-paused-critical" src="http://www.vcritical.com/wp-content/uploads/2008/12/hyper-v-vm-paused-critical.png" alt="hyper-v-vm-paused-critical" width="255" height="90" /></p>
<p><strong>Cleanup on aisle one!</strong></p>
<p>What is the best way to recover gracefully from such a problem, if there really is no free space on the LUN? Gabes Virtual World published a <a href="http://www.gabesvirtualworld.com/?p=108">great tip</a> that could help next time.  Maybe all that <a href="http://www.vcritical.com/2008/10/storage-vendors-unanimously-applaud-scvmm-innovation/">ISO file copying</a> isn&#8217;t so bad after all.</p>


<p>Related posts:<ol><li><a href='http://www.vcritical.com/2009/04/hyper-v-snapshots-not-for-production/' rel='bookmark' title='Permanent Link: Hyper-V snapshots: not for production'>Hyper-V snapshots: not for production</a></li>
<li><a href='http://www.vcritical.com/2008/12/half-the-vm-reboots-on-patch-tuesday/' rel='bookmark' title='Permanent Link: Half the VM reboots on Patch Tuesday'>Half the VM reboots on Patch Tuesday</a></li>
<li><a href='http://www.vcritical.com/2009/01/igt-part-5-hyper-v-snapshots-are-not-gone-until-the-vm-is-powered-off/' rel='bookmark' title='Permanent Link: IGT Part 5:  Hyper-V snapshots are not gone until the VM is powered off'>IGT Part 5:  Hyper-V snapshots are not gone until the VM is powered off</a></li>
<li><a href='http://www.vcritical.com/2008/12/checkshots-or-snappoints/' rel='bookmark' title='Permanent Link: Checkshots or Snappoints?'>Checkshots or Snappoints?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vcritical.com/2008/12/snapshots-that-shoot-back/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
