<?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>laurensdekoning.nl &#187; ESX</title>
	<atom:link href="http://laurensdekoning.nl/tag/esx/feed/" rel="self" type="application/rss+xml" />
	<link>http://laurensdekoning.nl</link>
	<description>All about VMware, NetApp, PowerShell, Windows, Microsoft and Linux in general.</description>
	<lastBuildDate>Thu, 19 Jan 2012 13:22:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PowerCLI: Migrate VM&#8217;s to another VLAN/Portgroup</title>
		<link>http://laurensdekoning.nl/powercli-migrate-vms-to-another-vlanportgroup/</link>
		<comments>http://laurensdekoning.nl/powercli-migrate-vms-to-another-vlanportgroup/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 12:57:44 +0000</pubDate>
		<dc:creator>laez</dc:creator>
				<category><![CDATA[ESX]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[migrate]]></category>
		<category><![CDATA[move]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[portgroup]]></category>
		<category><![CDATA[vlan]]></category>

		<guid isPermaLink="false">http://laez.nl/powercli-migrate-vms-to-another-vlanportgroup/</guid>
		<description><![CDATA[Scenario: Suppose you have several Virtual Machines running in a VLAN of which you decide they should be migrated to a new VLAN because of infrastructural changes in your network. Mind you this is only handy if the machines you are about to migrate use DHCP to get their network addresses. Approach: First of all [...]]]></description>
			<content:encoded><![CDATA[<h5></h5>
<h5>Scenario:</h5>
<p>Suppose you have several Virtual Machines running in a VLAN of which you decide they should be migrated to a new VLAN because of infrastructural changes in your network. Mind you this is only handy if the machines you are about to migrate use DHCP to get their network addresses.</p>
<h5>Approach:</h5>
<p>First of all you need to make sure all the ESX-servers in your cluster have the ability to use that VLAN so you need to have your your switchports/trunks tagged with it.</p>
<p>Secondly you need to add the new VLAN (portgroup) to the complete cluster, in this example I’m using vSwitch0 as your Virtual Switch name, make sure you change it into what applies to you in case if it’s different.</p>
<pre><span style="color: #5f9ea0; font-weight: bold">Get-Cluster</span><span style="color: #000000"> </span><span style="color: #800000">"</span><span style="color: #800000">Your Cluster</span><span style="color: #800000">"</span><span style="color: #000000"> | </span><span style="color: #5f9ea0; font-weight: bold">Get-VMHost</span><span style="color: #000000"> | </span><span style="color: #5f9ea0; font-weight: bold">Get-VirtualSwitch</span><span style="color: #000000"> </span><span style="font-style: italic; color: #5f9ea0">-Name</span><span style="color: #000000"> </span><span style="color: #800000">"</span><span style="color: #800000">vSwitch0</span><span style="color: #800000">"</span><span style="color: #5f9ea0; font-weight: bold">`</span><span style="color: #000000">
| </span><span style="color: #5f9ea0; font-weight: bold">New-VirtualPortGroup</span><span style="color: #000000"> </span><span style="font-style: italic; color: #5f9ea0">-Name</span><span style="color: #000000"> </span><span style="color: #800000">"</span><span style="color: #800000">New VLAN</span><span style="color: #800000">"</span><span style="color: #000000"> </span><span style="font-style: italic; color: #5f9ea0">-VLanId</span><span style="color: #000000"> </span><span style="color: #000000">123</span></pre>
<p>This will add the “New VLAN” to all of the ESX Servers in “Your Cluster” with VLAN ID 123 on vSwitch0.</p>
<p>Since all the ESX Server are provided with access to the new VLAN to place their Virtual Machines in it’s time to migrate them to the new VLAN. There are two ways you can do this:</p>
<p>The first is to configure all the network adapters of all VM’s from the old to the new VLAN/Portgroup and the second is to do exactly the same but to shortly disconnect/reconnect the network adapters of the Virtual Machines to initiate a DHCP request for your VM’s.</p>
<h6>First method:</h6>
<pre><span style="color: #5f9ea0; font-weight: bold">Get-Cluster</span><span style="color: #000000"> </span><span style="color: #800000">"</span><span style="color: #800000">Your Cluster</span><span style="color: #800000">"</span><span style="color: #000000"> | </span><span style="color: #5f9ea0; font-weight: bold">Get-VM</span><span style="color: #000000"> | </span><span style="color: #5f9ea0; font-weight: bold">Get-NetworkAdapter</span><span style="color: #000000"> | </span><span style="color: #5f9ea0; font-weight: bold">`</span><span style="color: #000000">
</span><span style="color: #5f9ea0; font-weight: bold">Where</span><span style="color: #000000"> { </span><span style="color: #800080">$_</span><span style="color: #000000">.NetworkName </span><span style="color: #ff0000">-eq</span><span style="color: #000000"> </span><span style="color: #800000">"</span><span style="color: #800000">Old VLAN</span><span style="color: #800000">"</span><span style="color: #000000"> } | </span><span style="color: #5f9ea0; font-weight: bold">`</span><span style="color: #000000">
</span><span style="color: #5f9ea0; font-weight: bold">Set-NetworkAdapter</span><span style="color: #000000"> </span><span style="font-style: italic; color: #5f9ea0">-NetworkName</span><span style="color: #000000"> </span><span style="color: #800000">"</span><span style="color: #800000">New VLAN</span><span style="color: #800000">"</span></pre>
<h6>Second method:</h6>
<pre><span style="color: #5f9ea0; font-weight: bold">Get-Cluster</span><span style="color: #000000"> </span><span style="color: #800000">"</span><span style="color: #800000">Your Cluster</span><span style="color: #800000">"</span><span style="color: #000000"> | </span><span style="color: #5f9ea0; font-weight: bold">Get-VM</span><span style="color: #000000"> | </span><span style="color: #5f9ea0; font-weight: bold">Get-NetworkAdapter</span><span style="color: #000000"> | </span><span style="color: #5f9ea0; font-weight: bold">`</span><span style="color: #000000">
</span><span style="color: #5f9ea0; font-weight: bold">Where</span><span style="color: #000000"> { </span><span style="color: #800080">$_</span><span style="color: #000000">.NetworkName </span><span style="color: #ff0000">-eq</span><span style="color: #000000"> </span><span style="color: #800000">"</span><span style="color: #800000">Old VLAN</span><span style="color: #800000">"</span><span style="color: #000000"> } | </span><span style="color: #5f9ea0; font-weight: bold">`</span><span style="color: #000000">
</span><span style="color: #5f9ea0; font-weight: bold">Set-NetworkAdapter</span><span style="color: #000000"> </span><span style="font-style: italic; color: #5f9ea0">-NetworkName</span><span style="color: #000000"> </span><span style="color: #800000">"</span><span style="color: #800000">New VLAN</span><span style="color: #800000">"</span><span style="color: #000000"> </span><span style="font-style: italic; color: #5f9ea0">-Connected</span><span style="color: #000000">:</span><span style="color: #800080">$false</span><span style="color: #000000"> | </span><span style="color: #5f9ea0; font-weight: bold">`</span><span style="color: #000000">
</span><span style="color: #5f9ea0; font-weight: bold">Set-NetworkAdapter</span><span style="color: #000000"> </span><span style="font-style: italic; color: #5f9ea0">-Connected</span><span style="color: #000000">:</span><span style="color: #800080">$True</span></pre>
<h5>Note:</h5>
<p>Then again if you do use static addresses for your Virtual Machines you will need to configure them within the Operating Systems afterwards. Although that might be scriptable I haven’t found a way to do this.</p>
]]></content:encoded>
			<wfw:commentRss>http://laurensdekoning.nl/powercli-migrate-vms-to-another-vlanportgroup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vizioncore vRanger 4.0 Pro Crashes vCenter 2.5 Update 3, 4 and 5</title>
		<link>http://laurensdekoning.nl/vizioncore-vranger-4-0-pro-crashes-vcenter-2-5-update-4-update-5/</link>
		<comments>http://laurensdekoning.nl/vizioncore-vranger-4-0-pro-crashes-vcenter-2-5-update-4-update-5/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 14:19:21 +0000</pubDate>
		<dc:creator>laez</dc:creator>
				<category><![CDATA[vCenter]]></category>
		<category><![CDATA[Vizioncore]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[center]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[crashed]]></category>
		<category><![CDATA[crashes]]></category>
		<category><![CDATA[dpp]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[virtual]]></category>
		<category><![CDATA[virtual center]]></category>
		<category><![CDATA[visioncore]]></category>
		<category><![CDATA[vranger]]></category>

		<guid isPermaLink="false">http://laez.nl/vizioncore-vranger-4-0-pro-crashes-vcenter-2-5-update-4-update-5/</guid>
		<description><![CDATA[Update (09/25/2009): Vizioncore&#8217;s new version of vRanger (4.1.0 build 11581) has solved this issue. If you had experienced these issues you are advised to upgrade as soon as Vizioncore has released this new version officially! Update (08/28/2009): Vizioncore announced that the new version where I suppose this problem is fixed in will be released Mid-September. [...]]]></description>
			<content:encoded><![CDATA[<p><strong> </strong></p>
<blockquote><p><span style="color: #ff0000;"><strong>Update (09/25/2009):</strong></span></p>
<p><em>Vizioncore&#8217;s new version of <strong>vRanger </strong>(</em><strong>4.1.0 build 11581</strong>) has <strong><em>solved </em></strong>this issue. If you had experienced these issues you are advised to upgrade as soon as Vizioncore has released this new version officially!</p></blockquote>
<blockquote><p><strong>Update (08/28/2009):<br />
</strong>Vizioncore announced that the new version where I suppose this problem is fixed in will be released Mid-September.</p>
<p>Original <a href="http://twitter.com/vizioncore/statuses/3579608344" target="_blank">Twitter-message</a>:</p>
<p><em>Vizioncore vRanger Pro 4.1 DPP to be released in Mid-Sept. More info @ VMworld 2009 and VirtualVizion <a href="http://tinyurl.com/vc-vvizion">http://tinyurl.com/vc-vvizion</a></em></p></blockquote>
<p>Since not too long I have been having problems with a crashing Virtual Center. The version where the problems started with was 2.5 Update 4. The problem was caused by <strong><em>vRanger Pro 4.0 DPP</em></strong>. Please keep on reading to see the complete story on this problem.</p>
<h6>Problem occurrence and symptoms:</h6>
<p><strong> </strong>In short this is how the problems first occurred: our DBA installed SP3 on our SQL 2005 Server and rebooted our SQL Server afterwards which normally wouldn&#8217;t be much of a problem but in this case our Virtual Center wouldn&#8217;t start anymore. The service starts and crashes after 5 seconds. The vpxd.log shows an Win32_Exception and some debug data and that&#8217;s it.</p>
<h6>Attempts to solve the problem:</h6>
<p>At first the problems appeared to have been caused by the update on the SQL Database Server, so these are the steps I’ve taken in my attempts to solve the problem.</p>
<ul>
<li>The things we&#8217;ve tried to solve this mysterious problem: Reinstalled VC against our production database: same problem</li>
<li>Reinstalled VC against our production database on another SQL Sever<br />
with <em>SQL Server 2005 SP2</em> on it: same problem</li>
<li>Reinstalled VC with a clean database and reconfigured our entire<br />
environment, but after a reboot of the VC: same problem except this<br />
time we installed <em>VC 2.5 Update 5</em> instead of <em>Update 4</em>.</li>
<li>Cleanly installed a new server with a fresh Windows 2003 install and<br />
all recent updates and installed VC 2.5 Update 5 again with a clean<br />
database but the same problem occurred after rebooting the VC server</li>
</ul>
<p>We repeated the last step probably about 2 times and it was really making me desperate for a solution because we have a pretty big environment.</p>
<h6>The actual problem:</h6>
<p>After desperately creating a Support Request at VMware they asked me to disable <em>vRanger</em> if we had that running in our environment because it was known to cause problems to Virtual Center.</p>
<p>The thing that already raised questions on my behalf before this incident was that the new <em>vRanger</em> constantly kept an open connection to Virtual Center, and as soon as you killed that session from Virtual Center the <em>vRanger</em> service immediately reconnected. So it appeared to me that during the startup of the Virtual Center service it constantly tried to connect and initiate something or tried to retrieve data from it which caused the Virtual Center service to crash right after startup.</p>
<h6>Resolution:</h6>
<p>After disabling the <em>vRanger</em> service –which wasn’t installed on our Virtual Center server itself by the way- we held our breath and restarted our Virtual Center server, and surprisingly the service started flawlessly.<br />
To make sure it really was <em>vRanger</em> we re-enabled the <em>vRanger </em>service and restarted the Virtual Center service and it crashed immediately.</p>
<p>After disabling the <em>vRanger</em> service VC functioned flawlessly again.</p>
<h6>Final note:</h6>
<p>The road to the solution has taken around two weeks. It was horrible. Finally the solution is known. By the way, previous versions of vRanger do <em>NOT</em> cause these problems!</p>
<p><strong>Update (helpful reaction from Vizioncore, see comments below for original message):</strong></p>
<div>
<div id="commentbody-20">
<blockquote><p>We are working very diligently to get this fix in the hands of our users, we have a fix that already out of our development process and is now in the hands of our QA team. You can also reference the following Knowledgebase article here <a rel="nofollow" href="http://www.vizioncore.com/support/knowledgebase/index.php" target="_blank">http://www.vizioncore.com/support/knowledgebase/index.php</a> and search for <strong>KB 00000296</strong> about this issue. This KB will also be updated shortly for a root cause once the issue is fully cleared by development and QA, for those that are interested in the technical details about the issue. Thanks again for everyone’s support! And we hope to get everyone taken care of very soon!</p></blockquote>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://laurensdekoning.nl/vizioncore-vranger-4-0-pro-crashes-vcenter-2-5-update-4-update-5/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Quick and simple VMware ESX Host Statistics</title>
		<link>http://laurensdekoning.nl/quick-and-simple-vmware-esx-host-statistics/</link>
		<comments>http://laurensdekoning.nl/quick-and-simple-vmware-esx-host-statistics/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 11:04:37 +0000</pubDate>
		<dc:creator>laez</dc:creator>
				<category><![CDATA[ESX]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[datacenter]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[posh]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[usage]]></category>

		<guid isPermaLink="false">http://laez.nl/quick-and-simple-vmware-esx-host-statistics/</guid>
		<description><![CDATA[Just a small oneliner to display all the servers, their overall status, CPU and Memory usage in all your Datacenters (can be handy if you have multiple datacenters). Get-Datacenter &#124; Sort &#124; Get-VMHost &#124; Sort &#124; Get-View &#124;` Select Name, OverallStatus, ` @{N="CPU Usage (GHz)";E={[math]::round( $_.Summary.QuickStats.OverallCpuUsage/1024,2)}}, ` @{N="Memory Usage (GB)";E={[math]::round( $_.Summary.QuickStats.OverallMemoryUsage/1024,2)}}  And it will give [...]]]></description>
			<content:encoded><![CDATA[<p>Just a small oneliner to display all the servers, their overall status, CPU and Memory usage in all your Datacenters (can be handy if you have multiple datacenters).</p>
<pre><span style="font-weight: bold; color: #5f9ea0">Get-Datacenter</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Sort</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Get-VMHost</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Sort</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Get-View</span><span style="color: #000000"> |`
</span><span style="font-weight: bold; color: #5f9ea0">Select</span><span style="color: #000000"> </span><span style="color: #800000">Name</span><span style="color: #000000">, </span><span style="color: #800000">OverallStatus</span><span style="color: #000000">, `</span><span style="color: #000000">
@{N</span><span style="color: #ff0000">=</span><span style="color: #800000">"</span><span style="color: #800000">CPU Usage (GHz)</span><span style="color: #800000">"</span><span style="color: #000000">;E</span><span style="color: #ff0000">=</span><span style="color: #000000">{[</span><span style="color: #008080">math</span><span style="color: #000000">]::</span><span style="color: #8b4513">round(</span><span style="color: #000000"><span style="color: #000080">
$_</span><span style="color: #000000">.Summary.QuickStats.OverallCpuUsage</span><span style="color: #ff0000">/</span><span style="color: #000000">1024</span><span style="color: #000000">,</span><span style="color: #000000">2</span><span style="color: #000000">)}}, `
@{N</span><span style="color: #ff0000">=</span><span style="color: #800000">"</span><span style="color: #800000">Memory Usage (GB)</span><span style="color: #800000">"</span><span style="color: #000000">;E</span><span style="color: #ff0000">=</span><span style="color: #000000">{[</span><span style="color: #008080">math</span><span style="color: #000000">]::</span><span style="color: #8b4513">round</span><span style="color: #000000">(</span><span style="color: #000080">
$_</span><span style="color: #000000">.Summary.QuickStats.OverallMemoryUsage</span><span style="color: #ff0000">/</span><span style="color: #000000">1024</span><span style="color: #000000">,</span><span style="color: #000000">2</span><span style="color: #000000">)}}</span></span><span style="color: #000080"> </span></pre>
<p>And it will give you an output that looks like this:</p>
<p><a href="http://laez.nl/wp-content/uploads/2009/07/image4.png"><img style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" title="image" src="http://laez.nl/wp-content/uploads/2009/07/image_thumb4.png" border="0" alt="image" width="411" height="315" /></a></p>
<p>You may not find it very useful like this, but you can also add a <strong>Where </strong>statement to this line to filter on several things. For example, you can decide you only want to see the servers that have <em>yellow</em> or <em>red</em> Overall Status due to high memory or CPU usage:</p>
<pre><span style="font-weight: bold; color: #5f9ea0">Get-Datacenter</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Sort</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Get-VMHost</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Sort</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Get-View</span><span style="color: #000000"> | `</span><span style="font-weight: bold; color: #5f9ea0">
Select</span><span style="color: #000000"> </span><span style="color: #800000">Name</span><span style="color: #000000">, </span><span style="color: #800000">OverallStatus</span><span style="color: #000000">, `
@{N</span><span style="color: #ff0000">=</span><span style="color: #800000">"</span><span style="color: #800000">CPU Usage (GHz)</span><span style="color: #800000">"</span><span style="color: #000000">;E</span><span style="color: #ff0000">=</span><span style="color: #000000">{[</span><span style="color: #008080">math</span><span style="color: #000000">]::</span><span style="color: #8b4513">round</span><span style="color: #000000">(
</span><span style="color: #000080">$_</span><span style="color: #000000">.Summary.QuickStats.OverallCpuUsage</span><span style="color: #ff0000">/</span><span style="color: #000000">1024</span><span style="color: #000000">,</span><span style="color: #000000">2</span><span style="color: #000000">)}}, `
@{N</span><span style="color: #ff0000">=</span><span style="color: #800000">"</span><span style="color: #800000">Memory Usage (GB)</span><span style="color: #800000">"</span><span style="color: #000000">;E</span><span style="color: #ff0000">=</span><span style="color: #000000">{[</span><span style="color: #008080">math</span><span style="color: #000000">]::</span><span style="color: #8b4513">round</span><span style="color: #000000">(</span><span style="color: #000080">
$_</span><span style="color: #000000">.Summary.QuickStats.OverallMemoryUsage</span><span style="color: #ff0000">/</span><span style="color: #000000">1024</span><span style="color: #000000">,</span><span style="color: #000000">2</span><span style="color: #000000">)}} | `</span><span style="font-weight: bold; color: #5f9ea0">
Where</span><span style="color: #000000"> { </span><span style="color: #000080">$_</span><span style="color: #000000">.OverallStatus </span><span style="color: #ff0000">-ne</span><span style="color: #000000"> </span><span style="color: #800000">"</span><span style="color: #800000">green</span><span style="color: #800000">"</span><span style="color: #000000"> }</span></pre>
<p>Which will give you something like this:</p>
<p><a href="http://laez.nl/wp-content/uploads/2009/07/image5.png"><img style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" title="image" src="http://laez.nl/wp-content/uploads/2009/07/image_thumb5.png" border="0" alt="image" width="427" height="139" /></a></p>
<p>Ofcourse these onliners are cool and handy to use, but you can also use these oneliners to write a script around it to monitor your servers. I will post a script like that soon to show you different interpretations of this script.</p>
]]></content:encoded>
			<wfw:commentRss>http://laurensdekoning.nl/quick-and-simple-vmware-esx-host-statistics/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>List all of your snapshots (oneliners)</title>
		<link>http://laurensdekoning.nl/list-all-of-your-snapshots-oneliners/</link>
		<comments>http://laurensdekoning.nl/list-all-of-your-snapshots-oneliners/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 10:46:25 +0000</pubDate>
		<dc:creator>laez</dc:creator>
				<category><![CDATA[ESX]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[datacenter]]></category>
		<category><![CDATA[datacenters]]></category>
		<category><![CDATA[infrastructure]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[overview]]></category>
		<category><![CDATA[posh]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[snapshots]]></category>

		<guid isPermaLink="false">http://laez.nl/?p=110</guid>
		<description><![CDATA[It’s not hard to create a PowerShell script to list your current snapshots, but of course it’s a nice challenge to create a oneliner that’ll take care of this. I’ve created several oneliners with different output, for instance: this one is to show snapshots of your total VMware infrastructure: Get-VM &#124; Sort Name &#124; Get-Snapshot [...]]]></description>
			<content:encoded><![CDATA[<p>It’s not hard to create a PowerShell script to list your current snapshots, but of course it’s a nice challenge to create a oneliner that’ll take care of this.</p>
<p>I’ve created several oneliners with different output, for instance: this one is to show snapshots of your total VMware infrastructure:</p>
<pre><span style="font-weight: bold; color: #5f9ea0">Get-VM</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Sort</span><span style="color: #000000"> </span><span style="color: #800000">Name</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Get-Snapshot</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Where</span><span style="color: #000000"> { </span><span style="color: #000080">$_</span><span style="color: #000000">.Name.Length </span><span style="color: #ff0000">-gt</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000"> } | </span><span style="font-weight: bold; color: #5f9ea0">Select</span><span style="color: #000000">
</span><span style="color: #800000">VM</span><span style="color: #000000">,</span><span style="color: #800000">Name</span><span style="color: #000000">,</span><span style="color: #800000">Description</span><span style="color: #000000">,</span><span style="color: #800000">Created</span></pre>
<p>While in fact in the organisation I work for we have several locations throughout the country and several VMware ESX Servers running on each one which we’ve divided in different Datacenters in our VMware Infrastructure.</p>
<p>So for instance you can also use the following line to list all Snapshots in a specific Datacenter:</p>
<pre><span style="font-weight: bold; color: #5f9ea0">Get-Datacenter</span><span style="color: #000000"> </span><span style="color: #5f9ea0; font-style: italic">-Name</span><span style="color: #000000"> </span><span style="color: #800000">"</span><span style="color: #800000">Your Datacenter</span><span style="color: #800000">"</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Get-VM</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Sort</span><span style="color: #000000"> </span><span style="color: #800000">Name</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Get-Snapshot</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">
Where</span><span style="color: #000000"> { </span><span style="color: #000080">$_</span><span style="color: #000000">.Name.Length </span><span style="color: #ff0000">-gt</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000"> } | </span><span style="font-weight: bold; color: #5f9ea0">Select</span><span style="color: #000000"> </span><span style="color: #800000">VM</span><span style="color: #000000">,</span><span style="color: #800000">Name</span><span style="color: #000000">,</span><span style="color: #800000">Description</span><span style="color: #000000">,</span><span style="color: #800000">Created</span></pre>
<p>Or just for one specific cluster:</p>
<pre><span style="font-weight: bold; color: #5f9ea0">Get-Cluster</span><span style="color: #000000"> </span><span style="color: #800000">"</span><span style="color: #800000">Cluster Name</span><span style="color: #800000">"</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Get-VM</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Sort</span><span style="color: #000000"> </span><span style="color: #800000">Name</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Get-Snapshot</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Where</span><span style="color: #000000">
{ </span><span style="color: #000080">$_</span><span style="color: #000000">.Name.Length </span><span style="color: #ff0000">-gt</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000"> } | </span><span style="font-weight: bold; color: #5f9ea0">Select</span><span style="color: #000000"> </span><span style="color: #800000">VM</span><span style="color: #000000">,</span><span style="color: #800000">Name</span><span style="color: #000000">,</span><span style="color: #800000">Description</span><span style="color: #000000">,</span><span style="color: #800000">Created</span></pre>
<p>All of these oneliners give somewhat the same output, which looks like this (company sensitive names are sensored, sorry <img src='http://laurensdekoning.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</p>
<p><a href="http://laez.nl.consumer0.webhosting.transip.nl/wp-content/uploads/2009/07/image2.png"><img style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" title="Snapshot listing" src="http://laez.nl/wp-content/uploads/2009/07/image_thumb2.png" border="0" alt="Snapshot listing" width="454" height="246" /></a></p>
<p>You can also add several other cmdlets to change the output of the result data, such as  <strong>ConvertTo-HTML</strong> or <strong>Out-GridView</strong> (if you use PowerShell 2.0 already).</p>
]]></content:encoded>
			<wfw:commentRss>http://laurensdekoning.nl/list-all-of-your-snapshots-oneliners/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Refresh Datastores with PowerShell (oneliner)</title>
		<link>http://laurensdekoning.nl/refresh-datastores-with-powershell-oneliner/</link>
		<comments>http://laurensdekoning.nl/refresh-datastores-with-powershell-oneliner/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 16:41:07 +0000</pubDate>
		<dc:creator>laez</dc:creator>
				<category><![CDATA[ESX]]></category>
		<category><![CDATA[NetApp]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>
		<category><![CDATA[datastore]]></category>
		<category><![CDATA[datastores]]></category>
		<category><![CDATA[ntfs]]></category>
		<category><![CDATA[oneliner]]></category>
		<category><![CDATA[posh]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://laez.nl/?p=101</guid>
		<description><![CDATA[As I mentioned in the previous article about Refreshing Datastores I would see if I could make a oneliner for this action and I succeed in doing that. This is what the line should be: Get-Datacenter &#124; Get-Cluster -Name "ClusterName" &#124; Get-VMHost &#124; ForEach { $_ } { Get-VMHostStorage -VMHost:$_ -Refresh } The result on [...]]]></description>
			<content:encoded><![CDATA[<p>As I mentioned in the <a href="http://laez.nl/?p=98">previous article about Refreshing Datastores</a> I would see if I could make a oneliner for this action and I succeed in doing that.</p>
<p>This is what the line should be:</p>
<pre><span style="font-weight: bold; color: #5f9ea0">Get-Datacenter</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Get-Cluster</span><span style="color: #000000"> </span><span style="color: #5f9ea0; font-style: italic">-Name</span><span style="color: #000000"> </span><span style="color: #800000">"</span><span style="color: #800000">ClusterName</span><span style="color: #800000">"</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Get-VMHost</span><span style="color: #000000"> |
</span><span style="font-weight: bold; color: #5f9ea0">ForEach</span><span style="color: #000000"> { </span><span style="color: #000080">$_</span><span style="color: #000000"> } { </span><span style="font-weight: bold; color: #5f9ea0">Get-VMHostStorage</span><span style="color: #000000"> </span><span style="color: #5f9ea0; font-style: italic">-VMHost</span><span style="color: #000000">:</span><span style="color: #000080">$_</span><span style="color: #000000"> </span><span style="color: #5f9ea0; font-style: italic">-Refresh</span><span style="color: #000000"> }</span></pre>
<p>The result on the PowerCLI would probably look like this:</p>
<p><a href="http://laez.nl/wp-content/uploads/2009/07/image1.png"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="image" src="http://laez.nl/wp-content/uploads/2009/07/image_thumb1.png" border="0" alt="image" width="553" height="242" /></a></p>
<p>The ‘Recent Tasks’ window in the vSphere client will show you a line with “<em>Refresh Host Storage System</em>” for each server.</p>
<p>Thanks for <a href="http://ict-freak.nl" target="_blank">Arne Fokkema</a> for helping me out with the start of the oneliner <img src='http://laurensdekoning.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Cheers!</p>
<p>NOTE: Get-Datacenter isn&#8217;t really required so the oneliner can actually be shorter <img src='http://laurensdekoning.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://laurensdekoning.nl/refresh-datastores-with-powershell-oneliner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Refresh Datastores with PowerShell</title>
		<link>http://laurensdekoning.nl/refresh-datastores-with-powershell/</link>
		<comments>http://laurensdekoning.nl/refresh-datastores-with-powershell/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 07:21:00 +0000</pubDate>
		<dc:creator>laez</dc:creator>
				<category><![CDATA[ESX]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>
		<category><![CDATA[datastore]]></category>
		<category><![CDATA[datastores]]></category>
		<category><![CDATA[NetApp]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[posh]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[refresh]]></category>

		<guid isPermaLink="false">http://laez.nl/?p=98</guid>
		<description><![CDATA[When using NFS for your datastores on your SAN (eg. NetApp) and you resize your datastore on the fly it always takes a while before the ESX/vSphere servers refresh the datastore so you can see the new size of the volume. This can be annoying when you want to create a VM on one of [...]]]></description>
			<content:encoded><![CDATA[<p>When using NFS for your datastores on your SAN (eg. NetApp) and you resize your datastore on the fly it always takes a while before the ESX/vSphere servers refresh the datastore so you can see the new size of the volume.</p>
<p>This can be annoying when you want to create a VM on one of these volumes and ESX still thinks the volume is too small because it hasn’t refreshed it’s datastores yet. Normally I would pick one ESX server where I want to put the VM on for starters and refresh the NFS volume which I want to use:</p>
<p><a href="http://laez.nl/wp-content/uploads/2009/07/image.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="110" alt="image" src="http://laez.nl/wp-content/uploads/2009/07/image_thumb.png" width="318" border="0" /></a> </p>
<p>Ofcourse I wanted to make it easier for myself so I wrote a little PowerShell script to refresh the datastores on all ESX Servers in our Cluster. I think it’s also possible to make a oneliner out of this and I will try to create one and if I succeed I’ll post it again <img src='http://laurensdekoning.nl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<pre><span style="color: #800080">$vcHost</span><span style="color: #000000"> </span><span style="color: #ff0000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">virtual.center.host</span><span style="color: #800000">&quot;</span><span style="color: #000000">
</span><span style="color: #800080">$vcClusterName</span><span style="color: #000000"> </span><span style="color: #ff0000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">Your ClusterName</span><span style="color: #800000">&quot;</span><span style="color: #000000">
</span><span style="color: #800080">$vcUser</span><span style="color: #000000"> </span><span style="color: #ff0000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">username</span><span style="color: #800000">&quot;</span><span style="color: #000000">
</span><span style="color: #800080">$vcPass</span><span style="color: #000000"> </span><span style="color: #ff0000">=</span><span style="color: #000000"> </span><span style="color: #800000">&quot;</span><span style="color: #800000">password</span><span style="color: #800000">&quot;</span><span style="color: #000000">

</span><span style="color: #800080">$vcServer</span><span style="color: #000000"> </span><span style="color: #ff0000">=</span><span style="color: #000000"> </span><span style="font-weight: bold; color: #5f9ea0">Connect-VIServer</span><span style="color: #000000"> </span><span style="color: #5f9ea0; font-style: italic">-Server</span><span style="color: #000000">:</span><span style="color: #800080">$vcHost</span><span style="color: #000000"> </span><span style="color: #5f9ea0; font-style: italic">-User</span><span style="color: #000000">:</span><span style="color: #800080">$vcUser</span><span style="color: #000000"> </span><span style="color: #5f9ea0; font-style: italic">-Password</span><span style="color: #000000">:</span><span style="color: #800080">$vcPass</span><span style="color: #000000"> </span><span style="color: #5f9ea0; font-style: italic">-WarningAction</span><span style="color: #000000">:</span><span style="color: #800000">SilentlyContinue</span><span style="color: #000000">

</span><span style="color: #800080">$vmHosts</span><span style="color: #000000"> </span><span style="color: #ff0000">=</span><span style="color: #000000"> </span><span style="font-weight: bold; color: #5f9ea0">Get-Datacenter</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Get-Cluster</span><span style="color: #000000"> </span><span style="color: #5f9ea0; font-style: italic">-Name</span><span style="color: #000000">:</span><span style="color: #800080">$vcClusterName</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Get-VMHost</span><span style="color: #000000"> | </span><span style="font-weight: bold; color: #5f9ea0">Sort</span><span style="color: #000000">

</span><span style="color: #0000ff">ForEach</span><span style="color: #000000"> (</span><span style="color: #800080">$vmHost</span><span style="color: #000000"> </span><span style="color: #0000ff">in</span><span style="color: #000000"> </span><span style="color: #800080">$vmHosts</span><span style="color: #000000">) {
    </span><span style="color: #0000ff">If</span><span style="color: #000000"> (</span><span style="font-weight: bold; color: #5f9ea0">Get-VMHostStorage</span><span style="color: #000000"> </span><span style="color: #5f9ea0; font-style: italic">-VMHost</span><span style="color: #000000">:</span><span style="color: #800080">$vmHost</span><span style="color: #000000"> </span><span style="color: #5f9ea0; font-style: italic">-Refresh</span><span style="color: #000000"> </span><span style="color: #5f9ea0; font-style: italic">-ErrorAction</span><span style="color: #000000">:</span><span style="color: #800000">SilentlyContinue</span><span style="color: #000000"> </span><span style="color: #5f9ea0; font-style: italic">-WarningAction</span><span style="color: #000000">:</span><span style="color: #800000">SilentlyContinue</span><span style="color: #000000">) {
        </span><span style="font-weight: bold; color: #5f9ea0">Write-Host</span><span style="color: #000000"> </span><span style="color: #800080">$vmHost</span><span style="color: #000000">.</span><span style="color: #8b4513">Name</span><span style="color: #000000">,</span><span style="color: #800000">&quot;</span><span style="color: #800000"> host storage information refreshed</span><span style="color: #800000">&quot;</span><span style="color: #000000">
    } </span><span style="color: #0000ff">else</span><span style="color: #000000"> {
        </span><span style="font-weight: bold; color: #5f9ea0">Write-Host</span><span style="color: #000000"> </span><span style="color: #800080">$vmHost</span><span style="color: #000000">.</span><span style="color: #8b4513">Name</span><span style="color: #000000">,</span><span style="color: #800000">&quot;</span><span style="color: #800000"> host storage refresh failed!</span><span style="color: #800000">&quot;</span><span style="color: #000000">
    }
}

</span><span style="font-weight: bold; color: #5f9ea0">Disconnect-VIServer</span><span style="color: #000000"> </span><span style="color: #5f9ea0; font-style: italic">-Server</span><span style="color: #000000">:</span><span style="color: #800080">$vcServer</span><span style="color: #000000"> </span><span style="color: #5f9ea0; font-style: italic">-Confirm</span><span style="color: #000000">:</span><span style="color: #0000ff">$false</span></pre>
<p>&#160;</p>
<p>After the script has been running the datastores on all your ESX-servers in the cluster will be refreshed so all resizes&#160; of your NFS volumes on your SAN will be visible and “active”.</p>
]]></content:encoded>
			<wfw:commentRss>http://laurensdekoning.nl/refresh-datastores-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

