<?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; Technical</title>
	<atom:link href="http://www.vcritical.com/tag/technical/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vcritical.com</link>
	<description>Informed Virtualization Criticism</description>
	<lastBuildDate>Mon, 12 Jul 2010 22:38:36 +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>Taking snapshots of VMware ESX 4 running in a VM</title>
		<link>http://www.vcritical.com/2010/02/taking-snapshots-of-vmware-esx-4-running-in-a-vm/</link>
		<comments>http://www.vcritical.com/2010/02/taking-snapshots-of-vmware-esx-4-running-in-a-vm/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 19:08:38 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[PASS]]></category>
		<category><![CDATA[snapshots]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=2377</guid>
		<description><![CDATA[VMware ESX 4 can virtualize itself, and by using a special undocumented configuration setting it is now possible to take snapshots of virtual VMware ESX 4 systems.]]></description>
			<content:encoded><![CDATA[<p>Clearly, the capability introduced with VMware vSphere 4 <a href="http://www.vcritical.com/2009/05/vmware-esx-4-can-even-virtualize-itself/">that allows VMware ESX 4 to virtualize itself</a> is a real crowd-pleaser.</p>
<p>However, one limitation that some have discovered while using this lab-testing technique is the lack of ability to use snapshots with virtual ESX systems.  In fact, after taking a snapshot of a virtual ESX VM, you will see the system boot into the recovery shell like so:</p>
<p><img class="alignnone size-full wp-image-2380" title="Virtual VMware ESX 4 system fails to boot after taking snapshot" src="http://www.vcritical.com/wp-content/uploads/2010/02/recovery-shell-when-snapshot.png" alt="" width="589" height="246" /></p>
<p>Ouch.</p>
<h2>Can we fix it?</h2>
<p>I asked some super-smart engineers inside VMware about the issue, and of course they know all about it and how to make it work.</p>
<p>The solution is to enable an undocumented advanced configuration option on the <strong>physical ESX host</strong> like so:</p>
<p><img class="alignnone size-full wp-image-2379" title="Changing advanced configuration option on physical VMware ESX 4 host" src="http://www.vcritical.com/wp-content/uploads/2010/02/putty-esxcfg-permitvmfs.png" alt="" width="528" height="142" /></p>
<p><span id="more-2377"></span>In other words:</p>
<ul>
<li>Log into the console of the <strong>physical</strong> VMware ESX 4 host</li>
<li>Run the following command: esxcfg-advcfg -s 1  /COW/PermitVmfsOnRedoHierarchy</li>
<li>Verify the setting with the &#8220;get&#8221; flag: esxcfg-advcfg -g /COW/PermitVmfsOnRedoHierarchy</li>
</ul>
<p><em>Do I even need to say that this stuff is not supported by VMware Global Support Services (GSS)?  Well, I just did.</em></p>
<h2>Yes we can!</h2>
<p>After executing that one command on your <strong>physical </strong>machine, take a snapshot and boot up your virtual ESX:</p>
<p><img class="alignnone size-full wp-image-2381" title="Virtual VMware ESX 4 booted with snapshot in place" src="http://www.vcritical.com/wp-content/uploads/2010/02/virtual-esx-booted-with-snapshot.png" alt="" width="582" height="425" /></p>
<p>Everything works just like you need it to now &#8212; you can even create a snapshot hierarchy:</p>
<p><img class="alignnone size-full wp-image-2378" title="Snapshot tree for virtual VMware ESX 4 system" src="http://www.vcritical.com/wp-content/uploads/2010/02/multiple-snapshots.png" alt="" width="459" height="234" /></p>
<h2>Now what?</h2>
<p>Were you constrained by the lack of virtual ESX snapshots?  <strong>What interesting things will you use this for?</strong></p>


<p>Related posts:<ol><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/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>
<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/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>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vcritical.com/2010/02/taking-snapshots-of-vmware-esx-4-running-in-a-vm/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>VMware vCenter CapacityIQ 1.0.1 for vSphere</title>
		<link>http://www.vcritical.com/2009/12/vmware-vcenter-capacityiq-1-0-1-for-vsphere/</link>
		<comments>http://www.vcritical.com/2009/12/vmware-vcenter-capacityiq-1-0-1-for-vsphere/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 18:18:52 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[CapacityIQ]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[PASS]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=1976</guid>
		<description><![CDATA[VMware vCenter CapacityIQ 1.0.1 is now fully integrated with VMware vSphere.  The product deploys quickly as an OVF virtual appliance and the user interface is a vSphere Client plugin.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.vmware.com/products/vcenter-capacityiq/"><img class="alignleft size-full wp-image-1980" title="VMware vCenter CapacityIQ" src="http://www.vcritical.com/wp-content/uploads/2009/12/ciq-icon.png" alt="VMware vCenter CapacityIQ" width="78" height="69" /></a>Today VMware released <a href="http://www.vmware.com/support/ciq100/doc/releasenotes_ciq101.html" target="_blank">vCenter CapacityIQ 1.0.1</a> &#8212; an update to support VMware vSphere 4.  Like vSphere, CapacityIQ is offered with a <a href="https://www.vmware.com/tryvmware/?p=vcenter-capacityiq&amp;lp=1" target="_blank">60-day trial</a>.</p>
<p>If you are not familiar with CapacityIQ (a.k.a. CapIQ or CIQ), it is an add-on management product for vCenter Server that assists in planning and managing virtualization resources.</p>
<p>CapIQ is very easy to deploy since it ships as a virtual appliance in OVF format &#8212; just load it onto an ESX host and perform a few simple configuration steps. It&#8217;s also simple to use since the user interface is a vSphere Client plug-in.  That means no additional web interfaces or user accounts to deal with &#8212; just a single pane of glass.</p>
<p>To learn more, check out the <a href="http://www.vmware.com/resources/techresources/10072" target="_blank">Evaluator&#8217;s Guide</a> and <a href="http://www.vmware.com/support/pubs/ciq_pubs.html" target="_blank">other documentation</a>.<span id="more-1976"></span></p>
<h2>Installation Experience</h2>
<p>For those curious about the installation experience, here is an overview of the very simple procedure.</p>
<h3>Upload the CapacityIQ VM using vSphere Client</h3>
<p><img class="alignnone size-full wp-image-1986" title="Deploy OVF" src="http://www.vcritical.com/wp-content/uploads/2009/12/deploy-ovf-menu.png" alt="Deploy OVF" width="235" height="186" /></p>
<h3>Configure Credentials</h3>
<p>The CapacityIQ appliance has two user accounts: root and ciqadmin.  When you first power on the VM, you will be prompted to enter passwords for those accounts.  Unlike some VM appliances, there are no default passwords involved.</p>
<p><img class="alignnone size-full wp-image-1985" title="Configure root and ciqadmin passwords" src="http://www.vcritical.com/wp-content/uploads/2009/12/configure-ciq-passwords.png" alt="Configure root and ciqadmin passwords" width="493" height="120" /></p>
<h3>Connect CapacityIQ to vCenter Server</h3>
<p>After the appliance is finished booting, a URL will be shown on the console.  Open that with your browser and log in using the ciqadmin account.</p>
<p><img class="alignnone size-full wp-image-1979" title="CapacityIQ Admin Portal" src="http://www.vcritical.com/wp-content/uploads/2009/12/ciq-admin-portal-login.png" alt="CapacityIQ Admin Portal" width="499" height="241" /></p>
<p>Enter the address and credentials needed to connect to your vCenter Server:</p>
<p><img class="alignnone size-full wp-image-1982" title="Register vCenter Server with CapIQ" src="http://www.vcritical.com/wp-content/uploads/2009/12/ciq-register-vcenter.png" alt="Register vCenter Server with CapIQ" width="504" height="341" /></p>
<h3>vSphere Client Interface</h3>
<p>After CapacityIQ is registered with your vCenter Server, restart your vSphere Client.  Verify that the plug-in has been installed automatically.</p>
<p><img class="alignnone size-full wp-image-1981" title="CapIQ vSphere Client plugin" src="http://www.vcritical.com/wp-content/uploads/2009/12/ciq-plugin-installed.png" alt="CapIQ vSphere Client plugin" width="504" height="198" /></p>
<p>If everything is in order, you&#8217;ll find a new icon on the vSphere Client Home screen:</p>
<p><img class="alignnone size-full wp-image-1988" title="vSphere Client Home with CapIQ" src="http://www.vcritical.com/wp-content/uploads/2009/12/vsphere-client-home-with-ciq1.png" alt="vSphere Client Home with CapIQ" width="224" height="244" /></p>
<h3>Views and Reports</h3>
<p>CapacityIQ comes with a number of preconfigured views and reports, as seen here:</p>
<p><img class="alignnone size-full wp-image-1984" title="CapIQ Views" src="http://www.vcritical.com/wp-content/uploads/2009/12/ciq-views.png" alt="CapIQ Views" width="410" height="643" /></p>
<p><img class="alignnone size-full wp-image-1983" title="CapIQ Reports" src="http://www.vcritical.com/wp-content/uploads/2009/12/ciq-reports.png" alt="CapIQ Reports" width="410" height="693" /></p>


<p>Related posts:<ol><li><a href='http://www.vcritical.com/2009/04/vmware-vcenter-server-40-installation-video/' rel='bookmark' title='Permanent Link: VMware vCenter Server 4.0 installation video'>VMware vCenter Server 4.0 installation video</a></li>
<li><a href='http://www.vcritical.com/2009/02/installing-vcenter-on-linux-technical-preview/' rel='bookmark' title='Permanent Link: Installing vCenter on Linux Technical Preview'>Installing vCenter on Linux Technical Preview</a></li>
<li><a href='http://www.vcritical.com/2010/04/red-hat-enterprise-linux-is-not-enterprise-virtualization/' rel='bookmark' title='Permanent Link: Red Hat Enterprise Linux is not Enterprise Virtualization'>Red Hat Enterprise Linux is not Enterprise Virtualization</a></li>
<li><a href='http://www.vcritical.com/2009/04/vmware-vcenter-server-4-task-and-event-retention/' rel='bookmark' title='Permanent Link: VMware vCenter Server 4 task and event retention'>VMware vCenter Server 4 task and event retention</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vcritical.com/2009/12/vmware-vcenter-capacityiq-1-0-1-for-vsphere/feed/</wfw:commentRss>
		<slash:comments>7</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>13</slash:comments>
		</item>
		<item>
		<title>Use Coreinfo to view VM core and socket count</title>
		<link>http://www.vcritical.com/2009/09/use-coreinfo-to-view-vm-core-and-socket-count/</link>
		<comments>http://www.vcritical.com/2009/09/use-coreinfo-to-view-vm-core-and-socket-count/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 03:58:19 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[Sysinternals]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[VM hardware]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=1633</guid>
		<description><![CDATA[By using an unsupported VM configuration file (vmx) option called cpuid.coresPerSocket, it is possible to present multi-core virtual CPUs to VMware ESX virtual machines.]]></description>
			<content:encoded><![CDATA[<p>A VMware ESX 4 (and ESXi 4) virtual machine can have up to 8 virtual CPUs.  Even though the underlying physical hardware has multiple cores per socket, each virtual CPU presented to the guest OS appears as a separate socket.</p>
<p>This normally does not matter because guest operating systems treat cores as CPUs anyway.  However, there is one significant area that is affected &#8212; licensing.  Some operating systems and applications are licensed by physical CPU, regardless of the core count.  If this license is enforced only by a legal agreement, and not by technology, then there is still no problem &#8212; configure a four vCPU VM on a system with a quad-core processor and you are in the clear.</p>
<p>The issue arises when software <em>enforces </em>the CPU socket limitation.  One good example of this is an operating system like Windows XP, which supports a maximum of two sockets &#8212; there is no way to use four cores if each is presented as a socket even though such an action would still be allowed within the license agreement.</p>
<p>To address this, vSphere 4 introduced a new undocumented VM configuration option called <strong>cpuid.coresPerSocket</strong>.</p>
<p>If you have experimented with the feature &#8212; Duncan Epping <a href="http://www.yellow-bricks.com/2009/06/04/per-processor-licenses-for-your-application/" target="_blank">already wrote about it</a> a while back &#8212; you may have wondered if there is a method to see how many cores and sockets a Windows system has.  After all, Device Manager simply shows each core as a CPU.</p>
<p>One of the more recent Sysinternals tools from Mark Russinovich does that very thing.</p>
<p style="padding-left: 30px;">Acquiring Sysinternals, and gaining Mark Russinovich, was an exceptionally wise move by Microsoft.  So far, so good &#8212; knock on wood &#8212; Microsoft has not done anything ridiculous like restricting the  tools to be part of a Software Assurance (SA) incentive.</p>
<p>The <a href="http://technet.microsoft.com/en-us/sysinternals/cc835722.aspx" target="_blank">Sysinternals utility is called Coreinfo</a>.  In these examples I am using it with two flags to show cores and sockets:</p>
<p><strong>coreinfo -c -s</strong></p>
<p>Here is a default VMware ESX 4 VM with 8 vCPUs:</p>
<p><img class="alignnone size-full wp-image-1636" title="8-socket CPU" src="http://www.vcritical.com/wp-content/uploads/2009/09/8-socket.png" alt="8-socket CPU" width="382" height="366" /></p>
<p><span id="more-1633"></span></p>
<p>After changing cpuid.coresPerSocket to 8, like so:</p>
<p><img class="alignnone size-full wp-image-1637" title="Set option cpuid.coresPerSocket=8" src="http://www.vcritical.com/wp-content/uploads/2009/09/coresPerSocket_8.png" alt="Set option cpuid.coresPerSocket=8" width="454" height="219" /></p>
<p>The guest OS sees a single socket, 8-core VM:</p>
<p><img class="alignnone size-full wp-image-1635" title="8-core CPU" src="http://www.vcritical.com/wp-content/uploads/2009/09/8-core.png" alt="8-core CPU" width="384" height="329" /></p>
<p>Setting the value to 4 divides the 8 cores into two sockets like this:</p>
<p><img class="alignnone size-full wp-image-1638" title="Dual quad-core CPUs" src="http://www.vcritical.com/wp-content/uploads/2009/09/dual-quad-core.png" alt="Dual quad-core CPUs" width="384" height="330" /></p>
<p>That last setting is the most legitimate for licensing purposes, as the underlying hardware here is a dual quad-core.</p>
<p>Please remember that this feature is currently not supported by VMware GSS.  If you need to use it in production, please contact your VMware account team so that your use case can be taken into account when planning future releases.</p>


<p>Related posts:<ol><li><a href='http://www.vcritical.com/2009/02/new-vmware-esxi-management-kit/' rel='bookmark' title='Permanent Link: New VMware ESXi Management Kit'>New VMware ESXi Management Kit</a></li>
<li><a href='http://www.vcritical.com/2009/12/easily-view-guest-ip-addresses-with-vsphere-client/' rel='bookmark' title='Permanent Link: Easily view guest IP addresses with vSphere Client'>Easily view guest IP addresses with vSphere Client</a></li>
<li><a href='http://www.vcritical.com/2008/12/vm-resource-management-hyper-v-versus-scvmm/' rel='bookmark' title='Permanent Link: VM Resource Management: Hyper-V versus SCVMM'>VM Resource Management: Hyper-V versus SCVMM</a></li>
<li><a href='http://www.vcritical.com/2008/12/let-them-eat-cake/' rel='bookmark' title='Permanent Link: Let them eat cake!'>Let them eat cake!</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/09/use-coreinfo-to-view-vm-core-and-socket-count/#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/sysinternals/" rel="tag">Sysinternals</a>, <a href="http://www.vcritical.com/tag/technical/" rel="tag">Technical</a>, <a href="http://www.vcritical.com/tag/vm-hardware/" rel="tag">VM hardware</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/09/use-coreinfo-to-view-vm-core-and-socket-count/">Use Coreinfo to view VM core and socket count</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/09/use-coreinfo-to-view-vm-core-and-socket-count/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>VMware ESX 4 can even virtualize itself</title>
		<link>http://www.vcritical.com/2009/05/vmware-esx-4-can-even-virtualize-itself/</link>
		<comments>http://www.vcritical.com/2009/05/vmware-esx-4-can-even-virtualize-itself/#comments</comments>
		<pubDate>Tue, 19 May 2009 03:25:45 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=1091</guid>
		<description><![CDATA[VMware ESX 4 can run multiple virtual instances of ESX 4 on a single physical server and even allows powering on and VMotion of nested VMs inside virtual ESX (vESX).  Perfect for a small VMware vSphere test lab!]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1103" title="ESX on ESX" src="http://www.vcritical.com/wp-content/uploads/2009/05/esxonesx-200.png" alt="ESX on ESX" width="200" height="205" />Running VMware ESX inside a virtual machine is a great way to experiment with different configurations and features without building out a whole lab full of hardware and storage.  It is pretty common to do this on VMware Workstation nowadays &#8212; the first public documentation of this process that I know of was published by <a href="http://xtravirt.com/" target="_blank">Xtravirt</a> a couple of years ago.</p>
<p>But what if you prefer to run ESX on ESX instead of Workstation?</p>
<p>You may be pleased to know that the GA build of ESX 4 allows installing ESX 4 as a virtual machine as well as powering on nested virtual machines &#8212; VMs running on the virtual ESX host.  You can even <a href="http://www.vcritical.com/2009/05/vmotion-from-physical-esx-4-to-virtual-esx-4/">VMotion a running virtual machine from the physical ESX to a virtual ESX</a> &#8212; on the same physical server!</p>
<p>The extra tweaks to make it all work are minimal, and I will show you how without even opening up a text editor.</p>
<p>After installing ESX 4 onto your real hardware, configure as desired and enable promiscuous mode on a vSwitch:</p>
<p><img class="alignnone size-full wp-image-1093" title="vswitch0 promiscuous mode" src="http://www.vcritical.com/wp-content/uploads/2009/05/vswitch0_promisc.png" alt="vswitch0 promisc" width="456" height="231" /></p>
<p>Create a new VM with the following guidance (choose &#8220;Custom&#8221;):</p>
<ul>
<li>Virtual Machine Version 7</li>
<li> Guest OS: Linux / Red Hat Enterprise Linux 5 (64-bit)</li>
<li> 2 VCPUs, 2GB RAM</li>
<li> 2 NICs &#8211; e1000</li>
<li> LSI Logic Parallel</li>
<li> New disk &#8211; reasonable size</li>
</ul>
<p>After you have the VM ready, simply attach a VMware ESX 4 ISO image, power on, and install ESX as a guest OS.</p>
<p><img class="alignnone size-full wp-image-1096" title="Virtual ESX 4" src="http://www.vcritical.com/wp-content/uploads/2009/05/esx_booted_in_vm.png" alt="Virtual ESX 4" width="474" height="397" /></p>
<p>After installation, add the new virtual ESX to vCenter 4 and create a new VM.</p>
<p><a href="http://www.vcritical.com/wp-content/uploads/2009/05/vsphere_client_virtual_esx.png"><img class="size-medium wp-image-1097 alignnone" title="vSphere Client with virtual ESX" src="http://www.vcritical.com/wp-content/uploads/2009/05/vsphere_client_virtual_esx-300x225.png" alt="vSphere Client with virtual ESX" width="300" height="225" /></a></p>
<p>If you do not need to run VMs on your virtual ESX, you can stop there.  However, if you try to power on that nested VM, you will see the following error:</p>
<p><img class="alignnone size-full wp-image-1094" title="You maynot power on a virtual machine inside a VM." src="http://www.vcritical.com/wp-content/uploads/2009/05/you_may_not.png" alt="You maynot power on a virtual machine inside a VM." width="362" height="126" /></p>
<p>To prevent this, just one tweak is needed:</p>
<ul>
<li>Shut down the virtual ESX VM</li>
<li> Click Edit Settings</li>
<li> Click the Options tab</li>
<li> Click Advanced / General / Configuration Parameters&#8230;</li>
<li> Click Add Row</li>
<li> For the Name/Value enter: <strong>monitor_control.restrict_backdoor / TRUE</strong></li>
</ul>
<p><a href="http://www.vcritical.com/wp-content/uploads/2009/05/monitor_control.png"><img class="alignnone size-medium wp-image-1095" title="Editing VM configuration." src="http://www.vcritical.com/wp-content/uploads/2009/05/monitor_control-300x265.png" alt="Editing VM configuration." width="300" height="265" /></a></p>
<p><em>The above procedure is just an alternative to hand-editing the .vmx file &#8212; if you prefer to do it that way, feel free.</em></p>
<p>Now you are ready to power your virtual ESX VM back on, as well as the nested VMs.  This capability should come in handy as you start investigating the new features of vSphere 4.</p>
<p>You may be interested in this related post where a <a href="http://www.vcritical.com/2009/05/vmotion-from-physical-esx-4-to-virtual-esx-4/">VM is migrated between the physical and virtual ESX hosts</a>.</p>


<p>Related posts:<ol><li><a href='http://www.vcritical.com/2009/05/vmotion-from-physical-esx-4-to-virtual-esx-4/' rel='bookmark' title='Permanent Link: VMotion from physical ESX 4 to virtual ESX 4'>VMotion from physical ESX 4 to virtual ESX 4</a></li>
<li><a href='http://www.vcritical.com/2009/07/even-gpl-cant-make-hyper-v-linux-vms-well/' rel='bookmark' title='Permanent Link: Even GPL can&#8217;t make Hyper-V Linux VMs well'>Even GPL can&#8217;t make Hyper-V Linux VMs well</a></li>
<li><a href='http://www.vcritical.com/2009/05/pentacore-cpus-in-vmware-esx-4/' rel='bookmark' title='Permanent Link: Pentacore CPUs in VMware ESX 4'>Pentacore CPUs in VMware ESX 4</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>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vcritical.com/2009/05/vmware-esx-4-can-even-virtualize-itself/feed/</wfw:commentRss>
		<slash:comments>94</slash:comments>
		</item>
		<item>
		<title>VMware vCenter Server performance stats levels</title>
		<link>http://www.vcritical.com/2009/04/vmware-vcenter-server-performance-stats-levels/</link>
		<comments>http://www.vcritical.com/2009/04/vmware-vcenter-server-performance-stats-levels/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 17:43:54 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[PASS]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[vCenter]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=976</guid>
		<description><![CDATA[VirtualCenter (vCenter) database storage requirements grow rapidly as administrators increase the levels from default settings.]]></description>
			<content:encoded><![CDATA[<p>In a recent post, I explained the <a href="http://www.vcritical.com/2009/04/vmware-vcenter-really-needs-an-agent/">essential role that your database job scheduler</a> (e.g., SQL Server Agent) plays in keeping the vCenter (VirtualCenter) database size under control.  The <strong>statistics level</strong> is another critical factor that affects your database storage and performance requirements.</p>
<p>The statistics levels are easily &#8212; perhaps <em>too </em>easily &#8212; configured by using the VI Client:</p>
<p><a href="http://www.vcritical.com/wp-content/uploads/2009/04/vc_stats_config.png"><img class="alignnone size-medium wp-image-978" title="vCenter Server statistics configuration dialog" src="http://www.vcritical.com/wp-content/uploads/2009/04/vc_stats_config-300x238.png" alt="vCenter Server statistics configuration dialog" width="300" height="238" /></a></p>
<p>You can read in more depth about the performance statistics in the <a href="http://pubs.vmware.com/vi35u2/wwhelp/wwhimpl/js/html/wwhelp.htm">Basic System Administration</a> manual and the <a href="http://www.vmware.com/resources/techresources/771">VirtualCenter Monitoring and Performance Statistics</a> Tech Note, which has this to say about stats level selection:</p>
<blockquote><p>Level 1 has very low overhead on both the VirtualCenter server as well as the ESX Server hosts. Levels 2 – 4 have slightly greater overhead on ESX, but can adversely impact VirtualCenter performance if there are more than 10 ESX Server hosts. In particular Level 4 can quickly fill the VirtualCenter database, so it should only be turned on for limited periods of time.</p></blockquote>
<p>When it says <strong>Level 4 can quickly fill the VirtualCenter database</strong>, that&#8217;s not hyperbole.  Take a look at this chart to see what happens when the &#8220;5 minute&#8221; interval is changed from level 1 to level 4:</p>
<p><a href="http://www.vcritical.com/wp-content/uploads/2009/04/level4_enabled.png"><img class="alignright size-medium wp-image-990" title="Statistics level 4 enabled" src="http://www.vcritical.com/wp-content/uploads/2009/04/level4_enabled-300x198.png" alt="Statistics level 4 enabled" width="300" height="198" /></a>The VPX_HIST_STAT1 table &#8212; the one that corresponds with the &#8220;5 minute&#8221; interval &#8212; immediately begins consuming many times its previous size.  After a day, the number of rows in that table increased about 20 times!  (The tick marks across the x-axis of this chart each represent an hour.)<span id="more-976"></span></p>
<p>Recovery is simple, but not immediate.  After resetting to level 1, the additional rows disappear through attrition as the rollup process does its job.</p>
<p><a href="http://www.vcritical.com/wp-content/uploads/2009/04/level4_recovered.png"><img class="size-medium wp-image-992 alignnone" title="Statistics level 1 re-enabled" src="http://www.vcritical.com/wp-content/uploads/2009/04/level4_recovered-300x199.png" alt="Statistics level 1 re-enabled" width="300" height="199" /></a></p>
<p>The statistics levels are configurable in order to collect more detailed performance data on your VMware infrastructure.  As with most things, there is a tradeoff &#8212; making it critical for administrators to know that a seemingly simple change via the UI can put a huge hit on your database &#8212; not only in storage requirements but performance, too.  Do yourself a favor and talk to your DBA before changing your vCenter Server performance stats levels.</p>


<p>Related posts:<ol><li><a href='http://www.vcritical.com/2009/04/vmware-vcenter-server-4-task-and-event-retention/' rel='bookmark' title='Permanent Link: VMware vCenter Server 4 task and event retention'>VMware vCenter Server 4 task and event retention</a></li>
<li><a href='http://www.vcritical.com/2009/04/vmware-vcenter-really-needs-an-agent/' rel='bookmark' title='Permanent Link: VMware vCenter really needs an agent'>VMware vCenter really needs an agent</a></li>
<li><a href='http://www.vcritical.com/2009/08/new-vsphere-resource-distribution-chart/' rel='bookmark' title='Permanent Link: New: vSphere Resource Distribution Chart'>New: vSphere Resource Distribution Chart</a></li>
<li><a href='http://www.vcritical.com/2008/10/upgrading-your-management-platform-from-the-entry-level-edition/' rel='bookmark' title='Permanent Link: Upgrading your management platform from the entry-level edition'>Upgrading your management platform from the entry-level edition</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vcritical.com/2009/04/vmware-vcenter-server-performance-stats-levels/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VMware vCenter really needs an agent</title>
		<link>http://www.vcritical.com/2009/04/vmware-vcenter-really-needs-an-agent/</link>
		<comments>http://www.vcritical.com/2009/04/vmware-vcenter-really-needs-an-agent/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 02:24:26 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[PASS]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[vCenter]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=954</guid>
		<description><![CDATA[As vCenter Server (VirtualCenter) collects performance data, it is stored in the VC database.  As the data ages, it is aggregated to save storage space.]]></description>
			<content:encoded><![CDATA[<p>One of the great features of VMware vCenter Server (a.k.a. VirtualCenter, or VC) is the performance charts for virtual machines and other objects in the inventory.  Here is a typical chart:</p>
<p><a href="http://www.vcritical.com/wp-content/uploads/2009/04/performance_chart.png"><img class="alignnone size-medium wp-image-955" title="VMware vCenter Server performance chart" src="http://www.vcritical.com/wp-content/uploads/2009/04/performance_chart-300x161.png" alt="VMware vCenter Server performance chart" width="300" height="161" /></a></p>
<p>Managing the data behind these charts is actually a very demanding responsibility of vCenter: receiving, storing, and later aggregating to keep the database size under control.  Starting with VC 2.5, a couple of big changes were made in this area to help with scalability: the schema was modified to divide stats data into multiple tables, and the rollup duty (data aggregation) was delegated to the database server&#8217;s native job scheduling mechanism.  This article focuses on SQL Server and the SQL Server Agent; there is an equivalent capability in Oracle as you would suspect.</p>
<p><img class="size-full wp-image-958 alignright" title="SQL Server Agent vCenter jobs" src="http://www.vcritical.com/wp-content/uploads/2009/04/sql_agent_jobs.png" alt="SQL Server Agent vCenter jobs" width="255" height="204" /></p>
<p>The VC 2.5 installer creates a set of three jobs (for past day, month, and week) and throws up a notice reminding you to make sure the SQL Server Agent is running on your database server &#8212; for good reason, ignore it at your own peril.  You can see the jobs in the SQL Server Management Studio.</p>
<p>You&#8217;ll notice in this example there are actually three instances of each of the three jobs because there are multiple vCenter databases hosted on this SQL Server.  While not typical, it makes perfect sense in a test environment.<span id="more-954"></span></p>
<p style="padding-left: 30px;"><strong>Backstory</strong> In the initial VC 2.5 release, the jobs always had a static name, thus making it impossible to run multiple vCenter Servers against one SQL Server instance.  I knew that was going to annoy a lot of people, so I filed a bug to have it changed &#8212; finally got it in 2.5 Update 2.</p>
<p>What happens if the SQL Server Agent is stopped and these rollup jobs quit running?  A picture is worth a thousand words:</p>
<p><a href="http://www.vcritical.com/wp-content/uploads/2009/04/sql_agent_jobs_disabled.png"><img class="size-medium wp-image-960 alignleft" title="SQL Agent jobs disabled" src="http://www.vcritical.com/wp-content/uploads/2009/04/sql_agent_jobs_disabled-300x199.png" alt="SQL Agent jobs disabled" width="300" height="199" /></a></p>
<p>In this chart, the abrupt increase in database rows corresponds to the point in time that the rollup jobs were disabled.  vCenter continues receiving performance stats from hosts and dutifully depositing them in VPX_HIST_STAT1.</p>
<p>Essentially, the most granular data (VPX_HIST_STAT1) starts piling up, never aggregating into the summarized tables for longer-term storage.  In a large environment, it is not uncommon to see millions of rows in these tables.  If something goes wrong with the rollup jobs, those millions start multiplying in a hurry.</p>
<p>One nice thing about having the rollups controlled by the SQL Agent is that VC does not even need to be running for the process to take place, which also takes some load off of the VC server.  After resuming the jobs, the data flood quickly subsides and things go back on track:</p>
<p><a href="http://www.vcritical.com/wp-content/uploads/2009/04/agent_jobs_resumed.png"><img class="alignnone size-medium wp-image-962" title="SQL Agent jobs resumed" src="http://www.vcritical.com/wp-content/uploads/2009/04/agent_jobs_resumed-300x200.png" alt="SQL Agent jobs resumed" width="300" height="200" /></a></p>
<p>One note about <strong>SQL Server Express</strong>, the bundled database included with VC: There is no SQL Agent in that product.  Before you panic, please realize that VMware engineers <em>know this</em>.  For those deployments, the rollup stored procedures are simply kicked off by vCenter Server (vpxd), just like VC 2.0.x.  I could not believe the creative workarounds some well-meaning folks have attempted to implement because of this situation &#8212; it had something to do with the Windows task scheduler.  Please do not do that!</p>
<p>Hopefully now you have a little better understanding of the relationship between your database job scheduler, vCenter Server, and the size of your vCenter database.</p>


<p>Related posts:<ol><li><a href='http://www.vcritical.com/2009/04/vmware-vcenter-server-4-task-and-event-retention/' rel='bookmark' title='Permanent Link: VMware vCenter Server 4 task and event retention'>VMware vCenter Server 4 task and event retention</a></li>
<li><a href='http://www.vcritical.com/2009/04/vmware-vcenter-server-performance-stats-levels/' rel='bookmark' title='Permanent Link: VMware vCenter Server performance stats levels'>VMware vCenter Server performance stats levels</a></li>
<li><a href='http://www.vcritical.com/2009/02/installing-vcenter-on-linux-technical-preview/' rel='bookmark' title='Permanent Link: Installing vCenter on Linux Technical Preview'>Installing vCenter on Linux Technical Preview</a></li>
<li><a href='http://www.vcritical.com/2009/03/vcenter-for-linux-article-disappointing/' rel='bookmark' title='Permanent Link: vCenter for Linux article disappointing'>vCenter for Linux article disappointing</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vcritical.com/2009/04/vmware-vcenter-really-needs-an-agent/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VM Encapsulation</title>
		<link>http://www.vcritical.com/2009/02/vm-encapsulation/</link>
		<comments>http://www.vcritical.com/2009/02/vm-encapsulation/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 23:47:34 +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[Technical]]></category>
		<category><![CDATA[VI Client]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=699</guid>
		<description><![CDATA[Encapsulation is one of the four key benefits of VMware virtual machines.  On the surface it may seem like this is a common feature across all virtualization platforms &#8212; but it&#8217;s not.
If you are a VMware ESX administrator, you know that a VMware virtual machine consists of several files,  normally contained in a single directory.  [...]]]></description>
			<content:encoded><![CDATA[<p><img style=' float: left; padding: 4px; margin: 0 7px 2px 0;'  class="alignleft size-full wp-image-701" title="VMware encapsulation makes VMs independent and portable." src="http://www.vcritical.com/wp-content/uploads/2009/02/vmware-3d-6vm-125.png" alt="VMware encapsulation makes VMs independent and portable." width="125" height="135" />Encapsulation is one of the four <a href="http://www.vmware.com/technology/virtual-machine.html" target="_blank">key benefits of VMware virtual machines</a>.  On the surface it may seem like this is a common feature across all virtualization platforms &#8212; but it&#8217;s not.</p>
<p>If you are a VMware ESX administrator, you know that a VMware virtual machine consists of several files,  normally contained in a single directory.  There is a configuration file, virtual disk files, and a few other supporting files.  Having all necessary VM files in one directory is the essence of encapsulation.</p>
<p>Let&#8217;s say that you have a development environment &#8212; not protected by VMware HA &#8212; that experiences a host failure.  You repair the host, reinstall ESX, and reattach the disk that contains your virtual machines.  In order to have ESX recognize a VM, it must be registered.  This is easily done with the Datastore Browser, just right-click on the .vmx file and select &#8220;Add to Inventory.&#8221;</p>
<p><img class="alignnone size-full wp-image-700" title="VI Client Datastore Browser can easily add a VM to inventory." src="http://www.vcritical.com/wp-content/uploads/2009/02/add_vm_to_inventory.png" alt="VI Client Datastore Browser can easily add a VM to inventory." width="462" height="383" /></p>
<p>This task can also be performed on the ESX service console (i.e., not ESXi) by using the vmware-cmd utility.  <span id="more-699"></span>Here is an easy technique, just cd into the VM directory first:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">vmware-cmd <span style="color: #660033;">-s</span> register <span style="color: #007800;">$PWD</span><span style="color: #000000; font-weight: bold;">/</span>whatever.vmx</pre></div></div>

<p>After that you are ready to power on your VMs and get back to work &#8212; <strong>snapshots</strong> and all.</p>
<h2>Recovering Hyper-V VMs</h2>
<p>Unfortunately, with Hyper-V you need to be more proactive &#8212; unless a VM is explicitly &#8220;exported&#8221; it cannot be &#8220;imported.&#8221;  There is no supported method of importing a VM from a failed host, especially if it has snapshots.  Or is that <a href="http://www.vcritical.com/2008/12/checkshots-or-snappoints/">checkpoints</a>?</p>
<p>Don&#8217;t believe me?</p>
<p><img class="alignnone size-full wp-image-704" title="Hyper-V VM import failed." src="http://www.vcritical.com/wp-content/uploads/2009/02/hyper-v_import_failed.png" alt="Hyper-V VM import failed." width="438" height="188" /></p>
<p>For the curious, there evidently is an <a href="http://blogs.msdn.com/robertvi/archive/2008/12/19/howto-manually-add-a-vm-configuration-to-hyper-v.aspx" target="_blank">unsupported technique</a> to put <span style="text-decoration: line-through;">Humpty Dumpty</span> a Hyper-V VM back together again &#8212; for data recovery purposes only.  If making symlinks to XML files is your thing, go check it out.</p>
<p>When choosing a virtualization platform, don&#8217;t forget about the little things that can make a big difference.</p>


<p>Related posts:<ol><li><a href='http://www.vcritical.com/2010/06/these-are-not-the-files-you-are-looking-for/' rel='bookmark' title='Permanent Link: These are not the files you are looking for'>These are not the files you are looking for</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>
<li><a href='http://www.vcritical.com/2008/12/snapshots-that-shoot-back/' rel='bookmark' title='Permanent Link: Snapshots that shoot back'>Snapshots that shoot back</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><div style="font-family:Verdana; color:#000000; background-color: #C0C0C0; padding: 7px;border: dashed thin">

<a href="http://www.vcritical.com/2009/02/vm-encapsulation/#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/hyper-v/" rel="tag">Hyper-V</a>, <a href="http://www.vcritical.com/tag/pass/" rel="tag">PASS</a>, <a href="http://www.vcritical.com/tag/technical/" rel="tag">Technical</a>, <a href="http://www.vcritical.com/tag/vi-client/" rel="tag">VI Client</a>, <a href="http://www.vcritical.com/tag/vmware/" rel="tag">VMware</a> • <a href="http://www.vcritical.com/category/virtualizationism/">Browse All Virtualization Content</a><br/>

<a href="http://www.vcritical.com/2009/02/vm-encapsulation/">VM Encapsulation</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/02/vm-encapsulation/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Better console for PowerShell and VITK</title>
		<link>http://www.vcritical.com/2009/02/better-console-for-powershell-and-vitk/</link>
		<comments>http://www.vcritical.com/2009/02/better-console-for-powershell-and-vitk/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 11:00:37 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=584</guid>
		<description><![CDATA[By using Console2 with PowerShell and the VI Toolkit, users have much better text manipulation capabilities as well as the option to use different fonts.]]></description>
			<content:encoded><![CDATA[<p>The stock Windows command prompt (cmd.exe) is pretty limited&#8211;if you want to use <a href="http://www.vcritical.com/2009/01/get-a-better-font-for-putty/">a better font</a> or copy text in lines instead of clunky rectangular blocks, you need something else.  For Windows command-line utilities, PowerShell, and the VI Toolkit (for Windows), I have been using the open-source <a href="http://sourceforge.net/projects/console/">Console2</a> with much satisfaction.  The tabbed interface is pretty cool:</p>
<p><img class="alignnone size-full wp-image-657" title="Console2 with VI Toolkit and PowerShell tabs." src="http://www.vcritical.com/wp-content/uploads/2009/02/console2-vitk-ps.gif" alt="Console2 with VI Toolkit and PowerShell tabs." width="500" height="280" /></p>
<p>If that looks interesting, here is what you do:<span id="more-584"></span></p>
<ul>
<li>Download <a href="http://sourceforge.net/projects/console/" target="_blank">Console2</a> (current version is 2.00 Beta, build 142); extract on your system somewhere</li>
<li>Grab <a href="http://www.vcritical.com/wp-content/uploads/2009/02/console2-vcritical-2009-02-04.zip">this file</a> with icons and a replacement configuration file (console.xml); extract into the same location</li>
<li>Make a shortcut to console.exe
<ul>
<li>Multiple tabs can be opened during launch by adding -t to your shortcut target (e.g., -t Console2 -t &#8220;VI Toolkit&#8221;)</li>
</ul>
</li>
<li>Optional: <a href="http://www.vcritical.com/2009/02/vi-toolkit-for-windows-15-and-the-powershell-prompt/">fix your prompts</a></li>
</ul>
<p>My configuration file has a few changes to the mouse behavior:</p>
<ul>
<li>Left &#8211; select + copy automatically</li>
<li>Right &#8211; paste</li>
<li>Middle &#8211; pop-up menu</li>
</ul>
<p>If you prefer to not use my entire configuration file, just copy the applicable portions from the &lt;tabs&gt; element.</p>
<p>I hope you  have enjoyed this slight diversion from the regular VCritical programming lineup.  Thanks for reading.</p>


<p>Related posts:<ol><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/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/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/clean-up-vcenter-with-powershell-after-scvmm-leaves/' rel='bookmark' title='Permanent Link: Clean up vCenter with PowerShell after SCVMM leaves'>Clean up vCenter with PowerShell after SCVMM leaves</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.vcritical.com/2009/02/better-console-for-powershell-and-vitk/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>
