<?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; VI Client</title>
	<atom:link href="http://www.vcritical.com/tag/vi-client/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vcritical.com</link>
	<description>Informed Virtualization Criticism</description>
	<lastBuildDate>Wed, 19 Oct 2011 22:08:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<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 [...]]]></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/08/register-a-lun-full-of-vms-with-powercli/' rel='bookmark' title='Register a LUN full of VMs with PowerCLI'>Register a LUN full of VMs with PowerCLI</a></li>
<li><a href='http://www.vcritical.com/2010/06/these-are-not-the-files-you-are-looking-for/' rel='bookmark' title='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='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='Snapshots that shoot back'>Snapshots that shoot back</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/#respond">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>6</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 style=' float: left; padding: 4px; margin: 0 7px 2px 0;'  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;;  display: block; margin-right: auto; margin-left: auto;" 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='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='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='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/powershell-prevents-datastore-emergencies/' rel='bookmark' title='PowerShell Prevents Datastore Emergencies'>PowerShell Prevents Datastore Emergencies</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/01/finding-thin-provisioned-virtual-disks-with-powershell/#respond">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/powercli/" rel="tag">PowerCLI</a>, <a href="http://www.vcritical.com/tag/powershell/" rel="tag">PowerShell</a>, <a href="http://www.vcritical.com/tag/storage/" rel="tag">storage</a>, <a href="http://www.vcritical.com/tag/technical/" rel="tag">Technical</a>, <a href="http://www.vcritical.com/tag/templates/" rel="tag">templates</a>, <a href="http://www.vcritical.com/tag/vcenter/" rel="tag">vCenter</a>, <a href="http://www.vcritical.com/tag/vi-client/" rel="tag">VI Client</a> • <a href="http://www.vcritical.com/category/virtualizationism/">Browse All Virtualization Content</a><br/>

<a href="http://www.vcritical.com/2009/01/finding-thin-provisioned-virtual-disks-with-powershell/">Finding thin-provisioned virtual disks with PowerShell</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/01/finding-thin-provisioned-virtual-disks-with-powershell/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Thanks for all the port groups!</title>
		<link>http://www.vcritical.com/2008/12/thanks-for-all-the-port-groups/</link>
		<comments>http://www.vcritical.com/2008/12/thanks-for-all-the-port-groups/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 00:48:41 +0000</pubDate>
		<dc:creator>Eric Gray</dc:creator>
				<category><![CDATA[Virtualizationism]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[SCVMM]]></category>
		<category><![CDATA[VI Client]]></category>

		<guid isPermaLink="false">http://www.vcritical.com/?p=362</guid>
		<description><![CDATA[VMware ESX virtual machine networking is pretty straightforward.  A virtual switch (vSwitch) is created on each host by default and is associated with one or more physical NICs.  When multiple physical NICs are used, virtual machines benefit from added redundancy and load balancing by simply connecting to such a vSwitch. However, VMs don&#8217;t connect directly [...]]]></description>
			<content:encoded><![CDATA[<p><img style=' float: left; padding: 4px; margin: 0 7px 2px 0;'  class="size-medium wp-image-370 alignleft" title="viclient-networks" src="http://www.vcritical.com/wp-content/uploads/2008/12/viclient-networks.png" alt="" width="233" height="135" /></p>
<p>VMware ESX virtual machine networking is pretty straightforward.  A virtual switch (vSwitch) is created on each host by default and is associated with one or more physical NICs.  When multiple physical NICs are used, virtual machines benefit from added redundancy and load balancing by simply connecting to such a vSwitch.</p>
<p><strong>However, VMs don&#8217;t connect directly to vSwitches, they connect to port groups on a vSwitch.</strong> Port groups offer a means of configuring different settings, like VLAN and security, on a single vSwitch.  ESX virtual network administrators perform the infrequent task of creating port groups on hosts.  Later, virtual machine administrators simply select appropriate port groups when configuring VMs, seen as friendly names like this in the VI Client:</p>
<p><img class="size-full wp-image-383 alignnone" title="viclient-vm-network" src="http://www.vcritical.com/wp-content/uploads/2008/12/viclient-vm-network.png" alt="viclient-vm-network" width="243" height="73" /></p>
<p>VM administrators do not necessarily know or care about VLAN or security settings, so this model abstracts some of the complexity that is a result of this network configuration flexibility.  Here is what a vSwitch with two port groups and two physical NICs looks like:</p>
<p><img class="alignnone size-full wp-image-384" title="vswitch1-2pg" src="http://www.vcritical.com/wp-content/uploads/2008/12/vswitch1-2pg.png" alt="vswitch1-2pg" width="463" height="149" /></p>
<p>Unfortunately, if you use Microsoft System Center Virtual Machine Manager (SCVMM) to configure your VMware ESX virtual machines, <span id="more-362"></span>you are only offered vSwitches in the configuration interfaces, not port groups:</p>
<p><img class="size-full wp-image-382 alignnone" title="esxvm-network-connect-scvmm" src="http://www.vcritical.com/wp-content/uploads/2008/12/esxvm-network-connect-scvmm.png" alt="esxvm-network-connect-scvmm" width="373" height="200" /></p>
<p>When creating a new VM, or modifying an existing  one, SCVMM simply introduces new port groups on the fly into your environment.  Well, that&#8217;s one way to avoid having to figure out which existing port group to use, but it might have been better if the SCVMM interface actually presented the correct objects in the first place.</p>
<p>After making such a configuration change, the VM is then connected to a cryptically-named network like this:</p>
<p><img class="alignnone size-full wp-image-369" title="esxvm-network" src="http://www.vcritical.com/wp-content/uploads/2008/12/esxvm-network.png" alt="" width="233" height="82" /></p>
<p>And new port groups are added to the vSwitches on all ESX hosts, something the virtual network administrator might not appreciate:</p>
<p><img class="alignnone size-full wp-image-385" title="vswitch1-4pg" src="http://www.vcritical.com/wp-content/uploads/2008/12/vswitch1-4pg.png" alt="vswitch1-4pg" width="448" height="244" /></p>
<p>Are you thinking about managing VMware ESX with SCVMM?  Are you also the virtual network administrator?  If not, you may have some explaining to do.</p>


<p>Related posts:<ol><li><a href='http://www.vcritical.com/2011/05/the-secret-of-ephemeral-port-groups/' rel='bookmark' title='The Secret of Ephemeral Port Groups'>The Secret of Ephemeral Port Groups</a></li>
<li><a href='http://www.vcritical.com/2009/01/clean-up-vcenter-with-powershell-after-scvmm-leaves/' rel='bookmark' title='Clean up vCenter with PowerShell after SCVMM leaves'>Clean up vCenter with PowerShell after SCVMM leaves</a></li>
<li><a href='http://www.vcritical.com/2011/05/nic-teaming-update-hyper-v-still-cloudy-as-ever/' rel='bookmark' title='NIC Teaming Update: Hyper-V Still Cloudy as Ever'>NIC Teaming Update: Hyper-V Still Cloudy as Ever</a></li>
<li><a href='http://www.vcritical.com/2009/03/managing-vi3-with-scvmm-considered-harmful/' rel='bookmark' title='Managing VI3 with SCVMM considered harmful'>Managing VI3 with SCVMM considered harmful</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/2008/12/thanks-for-all-the-port-groups/#respond">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/networking/" rel="tag">networking</a>, <a href="http://www.vcritical.com/tag/scvmm/" rel="tag">SCVMM</a>, <a href="http://www.vcritical.com/tag/vi-client/" rel="tag">VI Client</a> • <a href="http://www.vcritical.com/category/virtualizationism/">Browse All Virtualization Content</a><br/>

<a href="http://www.vcritical.com/2008/12/thanks-for-all-the-port-groups/">Thanks for all the port groups!</a> by <a href="http://www.vcritical.com/about/">Eric Gray</a> © 2008 • <a href="http://www.vcritical.com/">VCritical</a>

</div>]]></content:encoded>
			<wfw:commentRss>http://www.vcritical.com/2008/12/thanks-for-all-the-port-groups/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

