<?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>ben.neise.co.uk &#187; vSphere</title>
	<atom:link href="http://ben.neise.co.uk/index.php/tag/vsphere/feed/" rel="self" type="application/rss+xml" />
	<link>http://ben.neise.co.uk</link>
	<description>vSphere &#38; Powershell Scripting</description>
	<lastBuildDate>Thu, 24 Jun 2010 21:03:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Eric Sloof&#8217;s quick guide to using the VMware VIX API with vCenter</title>
		<link>http://ben.neise.co.uk/index.php/2010/04/eric-sloofs-quick-guide-to-using-the-vmware-vix-api-with-vcenter/</link>
		<comments>http://ben.neise.co.uk/index.php/2010/04/eric-sloofs-quick-guide-to-using-the-vmware-vix-api-with-vcenter/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 11:45:32 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://ben.neise.co.uk/?p=373</guid>
		<description><![CDATA[Eric Sloof from NTPro.NL has posted an excellent short video showing how easy it is to create a VB application to do some simple operations on vSphere virtual machines. Online Training – Automating vSphere with the VIX API from Eric Sloof NTPRO.NL on Vimeo. I can&#8217;t wait to try this out, although I think I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/esloof">Eric Sloof</a> from <a href="http://www.ntpro.nl/blog/">NTPro.NL</a> has posted an excellent short video showing how easy it is to create a VB application to do some simple operations on <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> virtual machines.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=11193427&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=24ff95&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://vimeo.com/moogaloop.swf?clip_id=11193427&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=24ff95&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a href="http://vimeo.com/11193427">Online Training – Automating vSphere with the VIX API</a> from <a href="http://vimeo.com/esloof">Eric Sloof NTPRO.NL</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>I can&#8217;t wait to try this out, although I think I&#8217;m going to have to do a little Visual Basic study first.</p>
]]></content:encoded>
			<wfw:commentRss>http://ben.neise.co.uk/index.php/2010/04/eric-sloofs-quick-guide-to-using-the-vmware-vix-api-with-vcenter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linked Clones</title>
		<link>http://ben.neise.co.uk/index.php/2010/01/linked-clones/</link>
		<comments>http://ben.neise.co.uk/index.php/2010/01/linked-clones/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 16:18:57 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Powershell Script]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://ben.neise.co.uk/?p=330</guid>
		<description><![CDATA[We've started our first “proper” implemenation of Linked Clones in our vSphere 4 environment. While we've done some limited proof-of-concept work, this is the first project to be entirely deployed using Linked Clones. The objective is to reduce the space used by our training machines on our new environment.]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve started our first “proper” implemenation of Linked Clones in our <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> 4 environment. While we&#8217;ve done some limited proof-of-concept work, this is the first project to be entirely deployed using Linked Clones. The objective is to reduce the space used by our training machines on our new environment.</p>
<p>Linked clones allow multiple machines to share a common read-only &#8220;base&#8221; VMDK file, with each machine generating their own delta (REDO). Under normal usage circumstances, the REDO would continue to grow throughout the life of the machine; however as our machines have non-persistent hard drives, they reset to a clean state when powered-down. This makes our environment ideally suited to taking advanatage of the functionality offered by Linked Clones. They can either be created manually (by moving and renaming files on the datastore), or via the APIs, you can get more information on them in this <a href="http://www.vmware.com/support/developer/vc-sdk/linked_vms_note.pdf">White Paper from VMware</a>.</p>
<p>Our training machines are functionally identical to our production machines, and similarly consist of three types &#8211; Capture, Packaging and Verification. These are 11, 8, and 8 GB respectively. The usage patterns are slightly different, as &#8211; unlike &#8220;live&#8221; projects which have a steady stream of work, trainees tend to come in in large batches. This means that the training environment either needs to be continuously large, but mostly idle, or it needs to be regularly redeployed then stripped back.</p>
<p>The benefits achieved via the implementation of Linked Clones in this project resulted in roughly the same ratio of space saving as our proof-of-concepts, but as the number of machines involved was greater, the differences are more pronounced. Also this is the first time we’ve exceeded 8 machines sharing the same VMDK, which is a notable milestone as it is only possible if we limit the number of possible hosts that the machines can run on (<a href="http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&amp;cmd=displayKC&amp;externalId=1003319">there is a VMFS limitation of 8 hosts accessing a VMDK concurrently</a>). As we have DRS enabled, this meant reducing the number of hosts in each cluster to 8 or less.</p>
<p>We deployed twenty-five machines each, of  the three different builds used in a project. All were Windows XP virtual machines</p>
<p>The three machines being used as the parents had their <a href="http://ben.neise.co.uk/index.php/2009/10/using-sdelete-to-maximise-the-amount-of-disk-space-reclaimed-during-conversion-to-thin-provisioned-disks/">slack space on the drives was cleaned</a> using <a href="http://technet.microsoft.com/en-us/sysinternals/bb897443.aspx">SDelete</a>, then the machine was converted to Thin Provisioned using Storage vMotion. It was switched off, and a snapshot was created. This snapshot will form the base for the parent&#8217;s clones.</p>
<p>The machines were deployed using the a <a href="http://ben.neise.co.uk/index.php/tag/script/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Script">script</a> similar to the one at the bottom of this post, and it took just over an hour to deploy and customize all 75 machines. This was considerably faster than the time it would have taken to deploy 75 machines using the normal &#8220;Deploy from template&#8221;  method.</p>
<p>Here are the data:-</p>
<ul>
<li>Estimated space used if deployed traditionally: <strong>675 GB</strong>
<ul>
<li>Capture: 11 GB per machine</li>
<li> Packaging: 8 GB per machine</li>
<li>Verification: 8 GB per machine</li>
</ul>
</li>
</ul>
<ul>
<li>Estimated Space if Deployed as Thin Provisioned, but not Linked Clones: <strong>238.75 GB</strong>
<ul>
<li>Capture: 3.34 GB per machine</li>
<li>Packaging: 3.72 GB per machine</li>
<li>Verification: 2.49 GB per machine</li>
</ul>
</li>
</ul>
<ul>
<li>Space used in current configuration: <strong>19.3 GB</strong>
<ul>
<li>Capture 3.34 GB for parent, plus 0.13 GB per Linked Clone</li>
<li>Packaging 3.72 GB for parent, plus 0.13 GB per Linked Clone</li>
<li>Verification 2.49 GB for parent, plus 0.13 GB per Linked Clone</li>
</ul>
</li>
</ul>
<p>And in graph-format, for extra impact:-</p>
<p><a href="../wp-content/uploads/2010/01/DiskSpaceUsed1.png"><img title="DiskSpaceUsed" src="../wp-content/uploads/2010/01/DiskSpaceUsed1.png" alt="" width="478" height="284" /></a></p>
<p>All size estimates are based on the machines in a powered-down state. When powered on, a swap file (equal to the size of the assigned RAM) is created, and (assuming the machines are non-persistent) REDO files are created on all types of machines.</p>
<p>I’ve been on a few of the machines and they don’t appear to suffer from any noticeable performance degradation, although the true test won’t come until we get considerable concurrent use.</p>
<p>I&#8217;m tentatively declaring this a huge success. Rather than the training environment using 240 GB between training engagaments, it&#8217;s now down to a svelte 20GB, with no reduction in functionality.</p>
<p>Below is a <a href="http://ben.neise.co.uk/index.php/tag/script/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Script">script</a> similar to the one I used to deploy the linked clones. The actual &#8220;meat&#8221;, which deploys the machines was based on Hal Rottenberg&#8217;s <a href="http://poshcode.org/1549">New-LinkedClone.ps1</a> <a href="http://ben.neise.co.uk/index.php/tag/script/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Script">script</a>. As far as possible, I&#8217;ve tried to strip out stuff that&#8217;s specific to our environment (we use the Custom Attributes as an asset management database and to track which machines were deployed from which templates). There&#8217;s probably going to be stuff in there that doesn&#8217;t make much sense, but if you&#8217;ve got a bit of an understanding of <a href="http://ben.neise.co.uk/index.php/tag/powershell/" class="st_tag internal_tag" rel="tag" title="Posts tagged with PowerShell">PowerShell</a>, you should be able to cut and keep the bits you want.</p>
<pre class="brush: powershell;"># <a href="http://ben.neise.co.uk/index.php/tag/script/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Script">Script</a> to deploy linked clones

# List of custom attributes which you'<a href="http://ben.neise.co.uk/index.php/tag/re/" class="st_tag internal_tag" rel="tag" title="Posts tagged with re">re</a> wanting to copy from the template or parent to the newly created machine
# (Machines deployed from templates no longer inherit CAs in <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> 4.0)
# These help us track provenance, and provide information to the user
$arrStrAttributesToCopy = @(
&quot;AD Object Location&quot;,
&quot;Customisation&quot;,
&quot;Infrastructure Consultant&quot;,
&quot;Logon Administrator Name&quot;,
&quot;Logon Administrator Password&quot;,
&quot;Logon User Name&quot;,
&quot;Logon User Password&quot;,
&quot;Mobilisation Consultant&quot;,
&quot;Project&quot;,
&quot;Role&quot;,
)

# Name of the Custom Attribute on the parent which contains the name of the customisation to use
$CustomFieldName = &quot;Customisation&quot;

Function DeployLinkedClone ($strSourceVM, $intToBeDeployed, $intStartDeployingAtNumber, $CustomFieldName){
# Bases the name of the machine on the second part of the string split by spaces. This assumes that the template follows the standard naming convention of &quot;Tmpl [Name] x.x&quot;
$strMachinePrefix = ($strSourceVM.split(' ')[1])
$objVM = Get-VM $strSourceVM
$viewVM = $objVM | Get-View
$objCustomization = Get-OSCustomizationSpec ($objVM.CustomFields.Item($CustomFieldName))
# Ensure that the machines does not have a non persistent HD
If ($objVM | Get-HardDisk | Where-Object {$_.Persistence -like &quot;IndependentNonPersistent&quot;}){
Write-Host $objTemplate has a non-persistent HD!
}
# If the customisation, as specified in the parent's custom attribute does not exist, then quit.
If (!$objCustomization){
Write-Host Customisation ($objVM.CustomFields.Item($CustomFieldName)) not found. Exiting.
Break
}
$i = 1
Do {
# Convert the single digit integer (i.e., &quot;1&quot;) into a double digit (i.e., &quot;01&quot;)
$strMachineNumber = (&quot;{0:0#}&quot; -f $intStartDeployingAtNumber)
# Concatenate the machine name prefix (from the template name) with the double-digit integer, which is incrememted on each loop
$strMachineBeingDeployed = $strMachinePrefix+$strMachineNumber
# Check that the machine doesn't already exist
If ((Get-VM -Name $strMachineBeingDeployed -ErrorAction SilentlyContinue)){
Write-Host &quot;Machine $strMachineBeingDeployed already exists!&quot;
Break
}
# Let the user know what's going on
Write-Host &quot;&quot;
Write-Host &quot;Deploying new linked-clone &quot; -NoNewline
Write-Host $strMachineBeingDeployed -ForegroundColor Blue -NoNewline
Write-Host &quot;, from template &quot; -NoNewline
Write-Host $strSourceVM -ForegroundColor Blue -NoNewline
Write-Host &quot;, using customisation &quot; -NoNewline
Write-Host $objCustomization -ForegroundColor Blue -NoNewline
Write-Host &quot;, on the same Host as the parent&quot; -NoNewline
Write-Host &quot;&quot;
# Create the new machine using all these variables
$objFolder = $viewVM.parent
$specClone = New-Object <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">Vmware</a>.Vim.VirtualMachineCloneSpec
# Get the most recent snapshot attached to the machine
$specClone.Snapshot = $viewVM.Snapshot.CurrentSnapshot
# Create an object to represent the location of the clone
$specClone.Location = New-Object <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">Vmware</a>.Vim.VirtualMachineRelocateSpec
# This is the move-type that specifies the new disk backing (which is the bit that makes a linked clone)
$specClone.Location.DiskMoveType = &quot;createNewChildDiskBacking&quot;
# Run the task with the specified parameters
$task = $viewVM.CloneVM_Task($objFolder, $strMachineBeingDeployed, $specClone)
Get-VIObjectByVIView $task | Wait-Task | Out-Null
# Get the object for the machine which was just deployed
$objTargetVM = Get-VM $strMachineBeingDeployed
# Apply the customisation specification to the newly created clone
Set-VM -VM $objTargetVM -OSCustomizationSpec $objCustomization -Confirm:$false
# Start the clone
Start-VM -VM $objTargetVM
# Get the view (needed for writing custom attributes)
$viewTarget = $objTargetVM | Get-View
# Loop through each of the custom attributes which are to be copied
ForEach ($arrStrAttributeToCopy in $arrStrAttributesToCopy){
# Read the attribute from the source template
$objAttribute = $objVM.CustomFields.Item($arrStrAttributeToCopy)
# Apply the attribute to the machine object
$viewTarget.setCustomValue($arrStrAttributeToCopy,$objAttribute)
}
# Set the &quot;Template&quot; custom attribute to the parent templates
$arrStrAttributeToCopy = &quot;Template&quot;
$viewTarget.setCustomValue($arrStrAttributeToCopy,$strSourceTemplate)
# Increment the number used for naming the machines
$intStartDeployingAtNumber ++
# Increment the number used to count the number of machines deployed
$i ++
}
# Continue to loop while the number of machines deployed is less than the number required
While ($i -le $intToBeDeployed)
}

# Get the current time (for timing how long the <a href="http://ben.neise.co.uk/index.php/tag/script/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Script">script</a> took to run)
$dteStart = Get-Date

# Name of source VM, should be persistent, should have a snapshot and the customisation specified in the nominated custom attribute
$strSourceVM = &quot;Tmpl Capture 1.0&quot;
# Number to be deployed
$intToBeDeployed = 25
# Number to start deploying from
$intStartDeployingAtNumber = 1
DeployLinkedClone $strSourceVM $intToBeDeployed $intStartDeployingAtNumber $CustomFieldName

# Name of source VM, should be persistent, should have a snapshot and the customisation specified in the nominated custom attribute
$strSourceVM = &quot;Tmpl Packaging 1.0&quot;
# Number to be deployed
$intToBeDeployed = 25
# Number to start deploying from
$intStartDeployingAtNumber = 1
DeployLinkedClone $strSourceVM $intToBeDeployed $intStartDeployingAtNumber $CustomFieldName

# Name of source VM, should be persistent, should have a snapshot and the customisation specified in the nominated custom attribute
$strSourceVM = &quot;Tmpl Verification 1.0&quot;
# Number to be deployed
$intToBeDeployed = 25
# Number to start deploying from
$intStartDeployingAtNumber = 1
DeployLinkedClone $strSourceVM $intToBeDeployed $intStartDeployingAtNumber $CustomFieldName

$dteEnd = Get-Date
$dteDiff = New-TimeSpan $dteStart $dteEnd
$timeTaken = [math]::round($dteDiff.totalMinutes, 2)
Write-Host &quot;&quot;
Write-Host &quot;It took&quot; $timeTaken &quot;minutes for these machines to deploy&quot;

# End of <a href="http://ben.neise.co.uk/index.php/tag/script/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Script">script</a>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ben.neise.co.uk/index.php/2010/01/linked-clones/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Happy New Year</title>
		<link>http://ben.neise.co.uk/index.php/2010/01/happy-new-year/</link>
		<comments>http://ben.neise.co.uk/index.php/2010/01/happy-new-year/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 14:00:06 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://ben.neise.co.uk/?p=326</guid>
		<description><![CDATA[Happy New Year to everyone!

I passed the VCP on vSphere 4 just before Christmas with 463/500. At the time the deadline for taking the exam without having to the attend the What's New was 31st December 2009, but that's now been extended to the 31st January. It was nice to have it out of the way before Christmas though.]]></description>
			<content:encoded><![CDATA[<p>Happy New Year to everyone!</p>
<p>I passed the VCP on <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> 4 just before Christmas with 463/500. At the time the deadline for taking the exam without having to the attend the <a href="http://mylearn.vmware.com/mgrreg/courses.cfm?ui=www&amp;a=one&amp;id_subject=10069">What&#8217;s New</a> was 31st December 2009, but that&#8217;s <a href="http://mylearn.vmware.com/portals/certification/">now been extended to the 31st January</a>. It was nice to have it out of the way before Christmas though.</p>
<p>The exam seemed no more difficult than the VCP on VI 3; I think they even reused a few of the questions. I found the following useful:-</p>
<ul>
<li><a href="http://www.simonlong.co.uk/blog/vcp-vsphere-4-practice-exam/">Simon Long&#8217;s VCP vSphere 4 Practice Exams</a></li>
<li><a href="http://www.vmware.com/pdf/vsphere4/r40/vsp_40_config_max.pdf">vSphere 4 Configuration Maximums</a></li>
<li><a href="http://virtualisedreality.wordpress.com/vcp-in-vsphere-4-0-study-notes/">Barry Coombs&#8217; VMware vSphere cue-cards</a></li>
</ul>
<p>Those sites also contain numerous links to other resources, so I&#8217;m sure you&#8217;ll find something which will suit your revision style.</p>
<p>Next on my to-do list is the <a href="http://www.microsoft.com/learning/en/us/exam.aspx?ID=70-431&amp;locale=en-us">Microsoft 70-431 Microsoft SQL Server 2005 &#8211; Implementation and Maintenance</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ben.neise.co.uk/index.php/2010/01/happy-new-year/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vSphere Bug with DRS, StandBy and Non-Perisistent Hard Drives</title>
		<link>http://ben.neise.co.uk/index.php/2009/12/vsphere-bug-with-drs-standby-and-non-perisistent-hard-drives/</link>
		<comments>http://ben.neise.co.uk/index.php/2009/12/vsphere-bug-with-drs-standby-and-non-perisistent-hard-drives/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 10:36:55 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[Onyx]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://ben.neise.co.uk/?p=321</guid>
		<description><![CDATA[We've been in touch with VMware recently about an issue we were experiencing in vSphere 4, where machines in standby could not be powered on. VMware have now confirmed that this is a bug, and that there will be a fix in R2.

While it's fairly specific to our use-case, I thought I'd share the details in case anyone else runs into this.]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been in touch with <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> recently about an issue we were experiencing in <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> 4, where machines in standby could not be powered on. <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> have now confirmed that this is a bug, and that there will be a fix in R2.</p>
<p>While it&#8217;s fairly specific to our use-case, I thought I&#8217;d share the details in case anyone else runs into this.</p>
<p>First of all, this bug will only affect you if the following conditions are met:</p>
<ul>
<li>You are using <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> 4.0 (or 4.0 Update 1)</li>
<li> Guest OS power-saving settings cause the virtual machine to enter standby</li>
<li> One or more of the guest&#8217;s hard drives are set to &#8220;independent non-persistent&#8221;</li>
<li> DRS is enabled on the virtual machine&#8217;s cluster</li>
</ul>
<p>The machine enters standby as normal. The issue arises when you try to power the virtual machine back on: if DRS has allocated the machine to another host based on load the machine will not resume, and gives an error similar to the following:-</p>
<blockquote><p>&#8220;Virtual Machine is configured to use a device that prevents the operation: Device &#8216;Hard disk 1&#8242; is disk which is not in persistent mode. Device &#8216;Hard disk 1&#8242; which is not in persistent mode&#8221;.</p></blockquote>
<p>You cannot manually migrate the machine (even back to the original host). You cannot change the power-state on the machine, edit the virtual machine settings, or delete the machine.</p>
<p>If this has happened to you, the only way we&#8217;ve found to get the machine back up-and-running seems to be to remove the machine from inventory, then create a new virtual machine with the same specifications, and add the old machine&#8217;s VMDK.</p>
<p>Fortunately, there are a couple of workarounds. You can either disable power-saving settings in the guest OS or change the guest power management settings from &#8220;Suspend the virtual machine&#8221; to &#8220;Put the guest OS into standby mode and leave the virtual machine powered on&#8221; (you can automate this as described <a href="http://ben.neise.co.uk/index.php/2009/11/changing-standbyaction-using-powershell-script-generated-with-help-from-onyx/">in my previous post</a>).</p>
<ul></ul>
<p>Changing the guest power-management settings means that when the guest enters standby, although <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> shows the machine as &#8220;powered-on&#8221;, <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> Tools is not running, which can cause problems (i.e., when trying to gracefully shut down a batch of machines).</p>
<p>This was also my first time working with the <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> support and I was impressed. They quickly replicated the problem and confirmed that it was indeed a bug. As most people nowadays tend to use snapshots rather than non-persistent drives, and few users virtualise desktop operating systems (which are more likely to have power-saving settings on by default) I can understand why this particular set of circumstances went untested.</p>
]]></content:encoded>
			<wfw:commentRss>http://ben.neise.co.uk/index.php/2009/12/vsphere-bug-with-drs-standby-and-non-perisistent-hard-drives/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing StandByAction Using PowerShell Script Generated with Help from Onyx</title>
		<link>http://ben.neise.co.uk/index.php/2009/11/changing-standbyaction-using-powershell-script-generated-with-help-from-onyx/</link>
		<comments>http://ben.neise.co.uk/index.php/2009/11/changing-standbyaction-using-powershell-script-generated-with-help-from-onyx/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 11:09:33 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Powershell Script]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[Onyx]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://ben.neise.co.uk/?p=302</guid>
		<description><![CDATA[Using Onyx to generate PowerShell/PowerCLI script to change the StandBy action on a number of machines.]]></description>
			<content:encoded><![CDATA[<p>We&#8217;<a href="http://ben.neise.co.uk/index.php/tag/re/" class="st_tag internal_tag" rel="tag" title="Posts tagged with re">re</a> currently having some issues caused by the <a href="http://communities.vmware.com/thread/244259?tstart=0">convergence of vSphere 4.0, IndependentNonPersistent drives, StandBy and DRS</a> (I&#8217;ll post more on that later).  As a workaround, we needed to modify 228 machines so that they did not go into hibernation. You can do this though the <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> Client by right clicking the virtual machine, click <strong>Edit Settings</strong>, go to the <strong>Options Tab</strong>, then select <strong>Power Management</strong>, and changing the radio button. We were wanting to change from &#8220;Suspend the virtual machine&#8221; to &#8220;Put the guest OS into standby mode and leave the virtual machine powered on&#8221;.</p>
<p><img class="size-medium wp-image-303 alignleft" title="PowerSettings" src="http://ben.neise.co.uk/wp-content/uploads/2009/11/PowerSettings-300x264.PNG" alt="PowerSettings" width="300" height="264" /></p>
<p>To do this the machines need to be powered down. We had an imminent maintenance window, but it wouldn&#8217;t allow us the time to make this change manually (even if we wanted to), this necessitated some automation. Unfortunately I had no idea how to go about editing this setting using the <a href="http://ben.neise.co.uk/index.php/tag/powercli/" class="st_tag internal_tag" rel="tag" title="Posts tagged with PowerCLI">PowerCLI</a>, even after a little search through the <a href="http://communities.vmware.com/community/vmtn/vsphere/automationtools/windows_toolkit">VMware PowerCLI community</a>.</p>
<p>This seemed like the perfect opportunity to try out <a href="http://ben.neise.co.uk/index.php/2009/11/alpha-build-of-project-onyx/">Project Onyx</a>.</p>
<p><a href="http://blogs.vmware.com/vipowershell/2009/11/project-onyx-is-here.html">Carter Shanklin&#8217;s video</a> does a good job of explaining how to <a href="http://ben.neise.co.uk/index.php/tag/onyx/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Onyx">Onyx</a> up and running, and it worked exactly as described (even on my Windows 7 machine).</p>
<ol>
<li><a href="http://bit.ly/vmwOnyx15">Download the Onyx files</a> and extract to a folder</li>
<li>Run the <a href="http://ben.neise.co.uk/index.php/tag/onyx/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Onyx">Onyx</a> executable</li>
<p><img class="size-medium wp-image-304 alignright" title="OnyxWindow" src="http://ben.neise.co.uk/wp-content/uploads/2009/11/OnyxWindow-300x203.PNG" alt="OnyxWindow" width="300" height="203" /></p>
<li>Click the <strong>Connect</strong> button, and connect to your VirtualCenter server.</li>
<li>Once that&#8217;s launched, start <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> client, but instead of connecting to your VirtualCenter server, connect to <strong>http://localhost:1545</strong> (Carter actually says <strong>1445</strong> in the video, but you can see on screen that he&#8217;s using <strong>1545</strong>). Use your normal credentials.</li>
<li>Ignore the warning about unencrypted traffic (as Carter explains, the unencrypted traffic is local-only, the network traffic is still encrypted)</li>
<li>Click the <strong>Start </strong>button on <a href="http://ben.neise.co.uk/index.php/tag/onyx/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Onyx">Onyx</a></li>
<li>In <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> client make whatever changes it is that you&#8217;<a href="http://ben.neise.co.uk/index.php/tag/re/" class="st_tag internal_tag" rel="tag" title="Posts tagged with re">re</a> wanting to record.</li>
<li>Click the <strong>Pause</strong> button on <a href="http://ben.neise.co.uk/index.php/tag/onyx/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Onyx">Onyx</a>, and you&#8217;ll see in the window a <a href="http://ben.neise.co.uk/index.php/tag/script/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Script">script</a> has been created.</li>
<li>Copy this into <a href="http://thevesi.org/index.jspa">your favourite PowerShell editor</a>, and modify until it&#8217;s suitable for your purposes.</li>
</ol>
<p>The original capture from the <a href="http://ben.neise.co.uk/index.php/tag/onyx/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Onyx">Onyx</a> Window</p>
<pre class="brush: powershell;">$spec = New-Object <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a>.Vim.VirtualMachineConfigSpec
$spec.changeVersion = &quot;2009-11-27T09:16:04.570821Z&quot;
$spec.powerOpInfo = New-Object <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a>.Vim.VirtualMachineDefaultPowerOpInfo
$spec.powerOpInfo.defaultPowerOffType = &quot;soft&quot;
$spec.powerOpInfo.defaultSuspendType = &quot;hard&quot;
$spec.powerOpInfo.defaultResetType = &quot;soft&quot;
$spec.powerOpInfo.standbyAction = &quot;checkpoint&quot;

$_this = Get-View -Id 'VirtualMachine-vm-1074'
$_this.ReconfigVM_Task($spec)</pre>
<p>A second capture changing the setting back to isolate the exact line that makes the changes</p>
<pre class="brush: powershell;">$spec = New-Object <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a>.Vim.VirtualMachineConfigSpec
$spec.changeVersion = &quot;2009-11-27T09:16:33.872017Z&quot;
$spec.powerOpInfo = New-Object <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a>.Vim.VirtualMachineDefaultPowerOpInfo
$spec.powerOpInfo.defaultPowerOffType = &quot;soft&quot;
$spec.powerOpInfo.defaultSuspendType = &quot;hard&quot;
$spec.powerOpInfo.defaultResetType = &quot;soft&quot;
$spec.powerOpInfo.standbyAction = &quot;powerOnSuspend&quot;

$_this = Get-View -Id 'VirtualMachine-vm-1074'
$_this.ReconfigVM_Task($spec)</pre>
<p>And a finished <a href="http://ben.neise.co.uk/index.php/tag/script/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Script">script</a>, which will run it against all machines in a specified blue folder comment/uncomment one of the $specVM.powerOpInfo.standbyAction lines to choose which option you want.</p>
<pre class="brush: powershell;">$objVMs = Get-Folder &quot;Folder Name&quot; | Get-VM
ForEach ($objVM in $objVMs){
	$specVM = New-Object <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a>.Vim.VirtualMachineConfigSpec
	$specVM.powerOpInfo = New-Object <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a>.Vim.VirtualMachineDefaultPowerOpInfo
	$specVM.powerOpInfo.standbyAction = &quot;checkpoint&quot; 			# Put the guest OS into StandBy Mode and leave the Virtual Machine powered On
	#$specVM.powerOpInfo.standbyAction = &quot;powerOnSuspend&quot; 		# Suspend the Virtual Machine
	$viewVM = Get-View -Id $objVM.Id
	$viewVM.ReconfigVM_Task($specVM)
}</pre>
<p>I was actually surprised at how easy this was; and I think it&#8217;s going to make me a bit more adventurous with what I attempt to do via the <a href="http://ben.neise.co.uk/index.php/tag/powercli/" class="st_tag internal_tag" rel="tag" title="Posts tagged with PowerCLI">PowerCLI</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ben.neise.co.uk/index.php/2009/11/changing-standbyaction-using-powershell-script-generated-with-help-from-onyx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>vSphere 4.0 Update 1 Released</title>
		<link>http://ben.neise.co.uk/index.php/2009/11/vsphere-4-0-update-1-released/</link>
		<comments>http://ben.neise.co.uk/index.php/2009/11/vsphere-4-0-update-1-released/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 13:22:27 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://ben.neise.co.uk/?p=298</guid>
		<description><![CDATA[VMware have released update 1 for vSphere 4.0.]]></description>
			<content:encoded><![CDATA[<p><a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> have released update 1 for <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> 4.0.</p>
<p>The following enhancements have been made to ESX (from the <a href="http://www.vmware.com/support/vsphere4/doc/vsp_esx40_u1_rel_notes.html#whatsnew">release notes</a>):-</p>
<blockquote><p><strong><a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> View 4.0 support</strong> <strong>–</strong> This release adds support for <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> View 4.0, a solution built specifically for delivering desktops as a managed service from the protocol to the platform.</p>
<p><strong>Windows 7 and Windows 2008 R2 support –</strong>This release adds support for 32-bit and 64-bit versions of Windows 7 as well as 64-bit Windows 2008 R2 as guest OS platforms. In addition, the <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> Client is now supported and can be installed on a Windows 7 platform. For a complete list of supported guest operating systems with this release, see the <a href="http://www.vmware.com/resources/compatibility/search.php" target="_blank"><em>VMware Compatibility Guide</em></a>.</p>
<p><strong>Enhanced Clustering Support for Microsoft Windows –</strong> Microsoft Cluster Server (MSCS) for Windows 2000 and 2003 and Windows Server 2008 Failover Clustering is now supported on an <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> High Availability (HA) and Dynamic Resource Scheduler (DRS) cluster in a limited configuration. HA and DRS functionality can be effectively disabled for individual MSCS virtual machines as opposed to disabling HA and DRS on the entire ESX/ESXi host<strong>. </strong>Refer to the <em><a href="http://www.vmware.com/pdf/vsphere4/r40_u1/vsp_40_u1_mscs.pdf" target="_blank">Setup for Failover Clustering and  Microsoft Cluster Service</a></em> guide for additional configuration guidelines.</p>
<p><strong>Enhanced <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> Paravirtualized SCSI Support</strong><strong> –</strong> Support for boot disk devices attached to a Paravirtualized SCSI ( PVSCSI) adapter has been added for Windows 2003 and 2008 guest operating systems. Floppy disk images are also available containing the driver for use during the Windows installation by selecting F6 to install additional drivers during setup. Floppy images can be found in the <tt>/vmimages/floppies/</tt> folder.</p>
<p><strong>Improved vNetwork Distributed Switch  Performance</strong> <strong>–</strong> Several performance and usability issues have been resolved resulting in the following:</p>
<ul>
<li>Improved performance when making configuration changes to a vNetwork Distributed Switch (vDS) instance when the ESX/ESXi host is under a heavy load</li>
<li>Improved performance when adding or removing an ESX/ESXi host to or from a vDS instance</li>
</ul>
<p><strong>Increase in vCPU per Core Limit</strong> <strong>–</strong> The limit on vCPUs per core has been increased from 20 to 25. This change raises the supported limit only. It does not include any additional performance optimizations. Raising the limit allows users more flexibility to configure systems based on specific workloads and to get the most advantage from increasingly faster processors. The achievable number of vCPUs per core depends on the workload and specifics of the hardware. For more information see the <em><a href="http://www.vmware.com/pdf/Perf_Best_Practices_vSphere4.0.pdf" target="_blank">Performance Best Practices for VMware vSphere 4.0</a></em> guide.</p>
<p><strong>Enablement of Intel Xeon Processor 3400 Series</strong> – Support for the Xeon processor 3400 series has been added. For a complete list of supported third party hardware and devices, see the <a href="http://www.vmware.com/resources/compatibility/search.php" target="_blank">VMware Compatibility Guide</a>.</p></blockquote>
<p><a href="http://ben.neise.co.uk/index.php/tag/vcenter/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vCenter">vCenter</a> 4.0 has also been updated, and now has full compatibility with Windows 7 x86 and x64 versions. Saving the <a href="http://xtravirt.com/running-vmware-vsphere-client-windows-7">various hacks that were necessary to get it working</a>.</p>
<p>Also, the <a href="http://ben.neise.co.uk/index.php/tag/powercli/" class="st_tag internal_tag" rel="tag" title="Posts tagged with PowerCLI">PowerCLI</a> has been updated, and can be found <a href="http://blogs.vmware.com/vipowershell/2009/11/powercli-40-u1-is-out.html">here</a>. There are 68 new CMDLETS, which <a href="http://www.virtu-al.net/2009/11/20/powercli-bring-on-the-next-version/">Alan Renouf does a great job of explaining</a>. I&#8217;m especially looking forward to trying out Get\Set-CustomAttribute (no more manipulation of the View object), Move-VMTemplate (no more converting templates to machines), and Get\Set-VMQuestion (for those times when the datastores run out of space for the REDO files necessitated by Non-Persistent disks).</p>
<p>I&#8217;m looking forward to investigating the new <a href="http://ben.neise.co.uk/index.php/tag/powercli/" class="st_tag internal_tag" rel="tag" title="Posts tagged with PowerCLI">PowerCLI</a> functionality, and I&#8217;m also looking forward to not needing to  manually customise the dozen or so Windows 7 guests I&#8217;m deploying next week!</p>
]]></content:encoded>
			<wfw:commentRss>http://ben.neise.co.uk/index.php/2009/11/vsphere-4-0-update-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alpha build of Project Onyx</title>
		<link>http://ben.neise.co.uk/index.php/2009/11/alpha-build-of-project-onyx/</link>
		<comments>http://ben.neise.co.uk/index.php/2009/11/alpha-build-of-project-onyx/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 10:39:53 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[Onyx]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://ben.neise.co.uk/?p=294</guid>
		<description><![CDATA[VMware have released an Alpha build of Project Onyx. This is a script recorder for vSphere Client, which is designed to allow scripting of things which are awkward or difficult to achieve using the VMware PowerCLI APIs alone]]></description>
			<content:encoded><![CDATA[<p>Carter Shanklin has announced that <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> have released an <a href="http://blogs.vmware.com/vipowershell/2009/11/project-onyx-is-here.html">Alpha build of the long-anticipated Project Onyx</a>. This is a <a href="http://ben.neise.co.uk/index.php/tag/script/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Script">script</a> recorder for <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> Client, which is designed to allow scripting of things which are awkward or difficult to achieve using the <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> <a href="http://ben.neise.co.uk/index.php/tag/powercli/" class="st_tag internal_tag" rel="tag" title="Posts tagged with PowerCLI">PowerCLI</a> APIs alone.<br />
<P><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/bANfdjuH4wk&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/bANfdjuH4wk&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></embed></object><br />
<P>Downloading this at the moment, although I don&#8217;t suspect I&#8217;ll have time to look at it for a while.</p>
]]></content:encoded>
			<wfw:commentRss>http://ben.neise.co.uk/index.php/2009/11/alpha-build-of-project-onyx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using SDelete to maximise the amount of disk space reclaimed during conversion to thin-provisioned disks</title>
		<link>http://ben.neise.co.uk/index.php/2009/10/using-sdelete-to-maximise-the-amount-of-disk-space-reclaimed-during-conversion-to-thin-provisioned-disks/</link>
		<comments>http://ben.neise.co.uk/index.php/2009/10/using-sdelete-to-maximise-the-amount-of-disk-space-reclaimed-during-conversion-to-thin-provisioned-disks/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 13:48:15 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://ben.neise.co.uk/?p=290</guid>
		<description><![CDATA[Experiment to see how much extra space is reclaimed when using SDelete prior to converting a machine to Thin Provisioned disk format on vSphere.]]></description>
			<content:encoded><![CDATA[<p>We&#8217;<a href="http://ben.neise.co.uk/index.php/tag/re/" class="st_tag internal_tag" rel="tag" title="Posts tagged with re">re</a> currently neck-deep in migration at the moment, but despite the workload, it&#8217;s always worth considering what we can do now, that might save us some time and effort later on.</p>
<p>One of the reasons we were moving to <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> was the ability to thin-provision (TP) our disks, which we&#8217;<a href="http://ben.neise.co.uk/index.php/tag/re/" class="st_tag internal_tag" rel="tag" title="Posts tagged with re">re</a> hoping will allow us to increase the amount of machines that we can provision without needing to allocate more storage (currently 18 TB).  I found an article by <a href="http://www.yellow-bricks.com/2009/07/31/storage-vmotion-and-moving-to-a-thin-provisioned-disk/">Duncan Epping over at Yellow Bricks</a> suggesting the use of <a href="http://technet.microsoft.com/en-ca/sysinternals/bb897443.aspx">Sysinternals SDelete</a> utility before the conversion to TP.</p>
<p>Essentially, as deleted files are not zeroed in Windows, and because <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> looks at the raw disk when “deallocating” space during conversion to think provisioned disks; deleted data are not reclaimed.  Running SDelete in the Windows guest before converting the disk to thin provisioned format zeroes the deleted data and should allow the maximum amount of space to be reclaimed.</p>
<p>While I don&#8217;t doubt that this is all correct, I wasn&#8217;t sure how much extra space it would allow us to reclaim. The majority of our guests are relatively small windows clients, almost all of which have non-persistent hard drives; of course &#8211; once they&#8217;ve been made non-persistent, the drive is effectively frozen, and subsequent use won&#8217;t increase the amount of non-zeroed slack space.</p>
<p>What&#8217;s the best way to see whether this is worthwhile? Run an experiment of course!</p>
<p><strong> </strong></p>
<h1>Method</h1>
<p>I took one of our standard Windows XP guests which had been migrated to the new <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> infrastructure. It had a 10GB hard drive, currently persistent, but which has been &#8211; for the majority of it&#8217;s 9 month existence &#8211; non-persistent. I examined how much disk space it was using, this was the pre-TP “Control”. I then cloned it without customization. One of the clones was converted to TP during a Storage vMotion operation. The other had slack space zeroed using SDelete (this process took around 3 minutes). It was then converted to Thin Provisioned disk format using Storage vMotion in the same way as the first machine.</p>
<h1><strong>Results</strong></h1>
<p>Here&#8217;s what happened<strong><br />
</strong></p>
<h2>Normal (Thick) Disk</h2>
<ul>
<li>Provisioned Storage: 10.50 GB</li>
<li>Not-shared Storage: 10.00 GB</li>
<li>Used Storage: 10.00GB</li>
</ul>
<p><img src="file:///C:/Users/BEN_NE%7E1/AppData/Local/Temp/moz-screenshot.png" alt="" /></p>
<h2>Converted to Thin Provisioned</h2>
<ul>
<li>Provisioned Storage: 10.50 GB</li>
<li>Not-shared Storage: 5.05 GB</li>
<li>Used Storage: 5.05 GB</li>
</ul>
<h2>Converted to Thin Provisioned, <strong>after</strong> running SDelete</h2>
<ul>
<li>Provisioned Storage: 10.50 GB</li>
<li>Not-shared Storage: 4.21 GB</li>
<li>Used Storage: 4.21 GB</li>
</ul>
<h1><strong>Conclusion</strong></h1>
<p>Zeroing slack space on this typical machine saved me 0.84 GB (8.4%). For the minimal effort involved, I think this is worthwhile (I have about 500 more machines almost exactly the same as this).</p>
<p>The percentage of free space reclaimed would likely be higher on persistent machines, or larger machines which see frequent creation and deletion of files.</p>
]]></content:encoded>
			<wfw:commentRss>http://ben.neise.co.uk/index.php/2009/10/using-sdelete-to-maximise-the-amount-of-disk-space-reclaimed-during-conversion-to-thin-provisioned-disks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Curriculum Vitae</title>
		<link>http://ben.neise.co.uk/index.php/about-2/cv/</link>
		<comments>http://ben.neise.co.uk/index.php/about-2/cv/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 19:52:06 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[re]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://ben.neise.co.uk/?page_id=264</guid>
		<description><![CDATA[Curriculum Vitae Ben Neise is a VMware, Microsoft and Citrix certified university graduate. He has worked in desktop support, application virtualisation and packaging and, most recently, managing and supporting Dell’s Global Application Packaging VMware based infrastructure. Ben has a wide range of technical skills combined with an ability to learn quickly, and then use that [...]]]></description>
			<content:encoded><![CDATA[<h1>Curriculum Vitae</h1>
<p>Ben Neise is a <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a>, Microsoft and Citrix certified university graduate. He has worked in desktop support, application virtualisation and packaging and, most recently, managing and supporting Dell’s Global Application Packaging <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> based infrastructure.</p>
<p>Ben has a wide range of technical skills combined with an ability to learn quickly, and then use that knowledge to develop original ideas and solutions. He is used to working in both a small environment with a high level of autonomy and a more traditional corporate environment.</p>
<p>In his spare time, Ben enjoys reading fiction, D-SLR photography, and spending time with his family.</p>
<h1>Personal details</h1>
<h2>Name</h2>
<p>Ben Neise</p>
<h2>Date of Birth</h2>
<p>16th November 1980 (29 years old)</p>
<h2>E-mail</h2>
<p>ben@neise.co.uk</p>
<h2>Web</h2>
<p>http://ben.neise.co.uk</p>
<p>http://www.linkedin.com/in/benneise</p>
<h1>Experience</h1>
<h2>Technical</h2>
<ul>
<li>Configuration and use of <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> products including VI3, <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> 4, Server, Lab Manager, Workstation &amp; Converter.</li>
<li>Configuring, supporting and administering Windows servers (from NT to 2008 R2) running Active Directory using complex Group Policy Objects.</li>
<li>Configuring, supporting and administering Citrix XenApp (application virtulisation) and Citrix XenDesktop (desktop virtualisation)</li>
<li>Configuring, supporting, administering and packaging applications for, Microsoft Application Virtualization (SoftGrid).</li>
<li>Administering and supporting Microsoft Office SharePoint 2007</li>
<li>Installation, configuration and utilisation of Microsoft Hyper-V.</li>
<li>Extensive deep knowledge of the Windows operating system, registry &amp; services.</li>
<li>Installing, configuring, and administering MS SQL, (including writing SQL queries), IIS &amp; SCCM.</li>
<li>Extensive scripting experience using Windows Shell scripting (batch files), <a href="http://ben.neise.co.uk/index.php/tag/powershell/" class="st_tag internal_tag" rel="tag" title="Posts tagged with PowerShell">PowerShell</a>. Good experience with VBScript and Python.</li>
</ul>
<h2>Business</h2>
<ul>
<li>Familiarity with ITIL and CapM best practices.</li>
<li>Statistical data analysis techniques</li>
<li>Excellent communication, documentation &amp; presentation skills</li>
<li>Able to train and develop skills in others</li>
</ul>
<h1>Personal Attributes</h1>
<ul>
<li>Excellent presentation and communication skills</li>
<li>Experienced at dealing with a wide spectrum of customers</li>
<li>Team player</li>
<li>Professional approach</li>
<li>Interested in many aspects of IT/IS outside of work</li>
</ul>
<h1>Training &amp; qualifications</h1>
<h2>Professional</h2>
<h3>May 2003</h3>
<ul>
<li>Microsoft Certified Professional: Administering and Maintaining a Windows Server 2003 Environment (70-290)</li>
</ul>
<h3>August 2006</h3>
<ul>
<li>Microsoft Certified Professional: Installing, Configuring and Administering Windows XP Professional (70-270)</li>
</ul>
<h3>March 2008</h3>
<ul>
<li>Windows Vista: Deployment and Optimisation for Technical Professionals</li>
</ul>
<h3>November 2008</h3>
<ul>
<li><a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> Certified Professional on Virtual Infrastructure 3</li>
<li><a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> Sales Professional</li>
<li><a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> Technical Sales Professional</li>
</ul>
<h3>December 2008</h3>
<ul>
<li>Citrix Certified Administrator: XenServer Enterprise Edition 4.0</li>
</ul>
<h3>July 2009</h3>
<ul>
<li>Microsoft Certified Professional: Implementing, Managing and Maintaining a Windows Server 2003 Network Infrastructure (70-291)</li>
</ul>
<h3>December 2009</h3>
<ul>
<li><a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> Certified Professional on <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> 4</li>
</ul>
<h3>June 2010</h3>
<ul>
<li>Microsoft Certified Technology Specialist: Windows Server 2008 Hyper-V, Configuration (70-652)</li>
</ul>
<h2>Personal</h2>
<h3>July 2002</h3>
<ul>
<li> BSc (Hons) Psychology (2:1) University of Stirling</li>
</ul>
<h1>Positions held</h1>
<h2>Apr 2008 – Present</h2>
<p>Infrastructure Support Team Leader for Dell Solutions UK Global Applications Packaging operation in Glasgow</p>
<h2>Jan 2006 – Mar 2008</h2>
<p>Application Packaging Technician for ACS (UK) Limited  then Dell Solutions UK after ACS was purchased by Dell in Nov 2006 placed at Prudential UK Limited</p>
<h2>Sep 2003 –  Dec 2005</h2>
<p>Technical Support Consultant for ACS (UK) Limited placed at Devro (Scotland) Limited</p>
<h2>Sep 2002 –  Aug 2003</h2>
<p>Prudential / Hays Personnel</p>
<p>Temporary New Business Administrator</p>
<h1>Major duties</h1>
<h2>Dell Global Applications Packaging</h2>
<h3>(Glasgow) April 2008 &#8211; Present</h3>
<p>Responsibility for a large <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> virtual Infrastructure environment running over 900 highly heterogeneous guests in over 40 individual AD domains. Managed infrastructure team to ensure that all calls are handled within OLAs, and ensuring that root-cause analysis is performed to reduce <a href="http://ben.neise.co.uk/index.php/tag/re/" class="st_tag internal_tag" rel="tag" title="Posts tagged with re">re</a>-occurrence.</p>
<p>Required to rapidly create test environments to wide-ranging customer specifications, involving multiple technologies, then secure, administer and support these environments.</p>
<p>Current role involves installation and configuration of numerous applications, features and technologies. I.e., SQL, SCCM, Exchange.</p>
<p>Introduced detailed monitoring of the environment, allowing statistical trend analysis for capacity management. Benefits included increased productive virtual machine density by 30% through a programme of rightsizing machine allocations. Reduced SAN</p>
<p>Managed and delivered a large, complex, datacenter migration project, including upgrading from VI3 to <a href="http://ben.neise.co.uk/index.php/tag/vsphere/" class="st_tag internal_tag" rel="tag" title="Posts tagged with vSphere">vSphere</a> 4. Project managed a <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> Lab Manager feasibility study.</p>
<p>Implemented knowledge sharing practices among the Infrastructure Support team, as well as a large number of other process improvements. These improvements reduced the average time taken to onboard a new customer’s infrastructure from 5 to 2 days.</p>
<h2>Prudential</h2>
<h3>(Stirling) Jan 2006 – Mar 2008</h3>
<p>Packaging applications for deployment via the Prudential’s proprietary systems, and latterly Microsoft Application Virtualisation (formerly SoftGrid) for deployment via Citrix XenApp.</p>
<p>Testing across multiple staged-environments to ensure a high standard of work.</p>
<p>Experience gained with shell scripting, registry editing application testing and deployment and a wide range of troubleshooting, analysis and system management tools.</p>
<p>Unique process where packager owned the application from acquisition to deployment, and was responsible for managing all stages of testing. Work was done to tight deadlines as part of a multi-stakeholder process.</p>
<h2>Devro PLC</h2>
<h3>(Glasgow) Sep 2003 – Dec 2005</h3>
<p>Assisted with the creation of a Microsoft Active Directory infrastructure, and the subsequent migration of over 200 workstations and users from a mixed Windows NT/95 environment to the new infrastructure.</p>
<p>Diagnosed and fixed a wide range of hardware, software &amp; networking problems, both at a first line and second line level.</p>
<p>Deployed 150 Wyse WinTerm thin clients with a Citrix MetaFrame backend.  Included major hardware consolidation; replacing multiple PCs, printers and hardware devices with thin clients and shared workstations, and replacing multiple single-role legacy servers with a <a href="http://ben.neise.co.uk/index.php/tag/vmware/" class="st_tag internal_tag" rel="tag" title="Posts tagged with VMware">VMware</a> ESX Server based virtualisation solution.</p>
<p>Self managed, prioritising user issues and collating information on problems ideally solving the root cause of the issue, with a view to reducing user dependency on Helpdesk.</p>
<h1>Referees</h1>
<p>Available on request</p>
]]></content:encoded>
			<wfw:commentRss>http://ben.neise.co.uk/index.php/about-2/cv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell script to add a hash table full of virtual port groups to vSphere hosts</title>
		<link>http://ben.neise.co.uk/index.php/2009/09/powershell-script-to-add-a-hash-table-full-of-virtual-port-groups-to-vsphere-hosts/</link>
		<comments>http://ben.neise.co.uk/index.php/2009/09/powershell-script-to-add-a-hash-table-full-of-virtual-port-groups-to-vsphere-hosts/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 11:45:27 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Powershell Script]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[hash tables]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://ben.neise.co.uk/?p=259</guid>
		<description><![CDATA[PowerShell script to add a hash table full of virtual port groups to vSphere hosts
]]></description>
			<content:encoded><![CDATA[<p>As part of the migration I&#8217;m working on, we needed to add a whole bunch of Virtual Port Groups with associated VLANs to the servers. The following <a href="http://ben.neise.co.uk/index.php/tag/script/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Script">script</a> could do this in a few minutes (although Host Profiles would accomplish much the same thing, we&#8217;<a href="http://ben.neise.co.uk/index.php/tag/re/" class="st_tag internal_tag" rel="tag" title="Posts tagged with re">re</a> not running Enterprise)</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #008000;"># Sets up virtual port groups on all hosts connected to a specific vCenter Server</span>
&nbsp;
<span style="color: #008000;"># Name of vCenter Server</span>
<span style="color: #800080;">$strVCenterServer</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;your.vCenter.Server&quot;</span>
&nbsp;
<span style="color: #008000;"># VLANs and associated VPGs</span>
<span style="color: #800080;">$ArrVLANs</span> <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#123;</span>
	<span style="color: #800000;">&quot;123&quot;</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Admin&quot;</span>;
	<span style="color: #800000;">&quot;456&quot;</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;GPO&quot;</span>;
	<span style="color: #800000;">&quot;789&quot;</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;NAG&quot;</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #008000;"># Connect to the vCenter Server</span>
Connect<span style="color: pink;">-</span>VIserver <span style="color: #800080;">$strVCenterServer</span>
&nbsp;
<span style="color: #008000;"># Loop through the VLAN/VPG pairs</span>
<span style="color: #0000FF;">ForEach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$objVLAN</span> <span style="color: #0000FF;">in</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$ArrVLANs</span>.Keys <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Sort-Object</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
	<span style="color: #008000;"># Loop through the hosts</span>
	<span style="color: #0000FF;">ForEach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$objHost</span> <span style="color: #0000FF;">in</span> <span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>VMHost <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Sort-Object</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
		<span style="color: #008000;"># Create the VPG with the VLAN as specified in the array above, on the switch called &quot;VMSwitch&quot; on the current host</span>
		<span style="color: #008000;"># Remove the &quot;-WhatIf&quot; tag from the end of the following line to &quot;arm&quot; the script</span>
		New<span style="color: pink;">-</span>VirtualPortGroup <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800080;">$strNewVPG</span> <span style="color: pink;">-</span>VirtualSwitch <span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>Virtualswitch <span style="color: pink;">-</span>VMHost <span style="color: #800080;">$objHost</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Where-Object</span> <span style="color: #000000;">&#123;</span> <span style="color: #000080;">$_</span>.Name <span style="color: #FF0000;">-match</span> <span style="color: #800000;">&quot;VMswitch&quot;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">-</span>VLanId <span style="color: #800080;">$strNewVlanTag</span> <span style="color: #008080; font-style: italic;">-WhatIf</span>
		<span style="color: #008000;"># Write what we've just done to screen</span>
		<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Adding Virtual Port Group&quot;</span> <span style="color: #800080;">$ArrVLANs</span><span style="color: #000000;">&#91;</span><span style="color: #800080;">$objVLAN</span><span style="color: #000000;">&#93;</span> <span style="color: #800000;">&quot;with VLAN Tag&quot;</span> <span style="color: #800080;">$objVLAN</span> <span style="color: #800000;">&quot;to&quot;</span> <span style="color: #800080;">$objHost</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #008000;"># Disconnect the session from the host</span>
Disconnect<span style="color: pink;">-</span>VIServer <span style="color: #008080; font-style: italic;">-Confirm</span>:$False</pre></div></div>

<p>Although this isn&#8217;t a complicated <a href="http://ben.neise.co.uk/index.php/tag/script/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Script">script</a>, it was the first time I&#8217;ve used <a href="http://ben.neise.co.uk/index.php/tag/hash-tables/" class="st_tag internal_tag" rel="tag" title="Posts tagged with hash tables">hash tables</a> (thanks to <a href="http://powershell.com/cs/blogs/ebook/archive/2008/10/22/chapter-4-arrays-and-hashtables.aspx">PowerShell.Com&#8217;s excellent page</a>), so I thought I&#8217;d share.</p>
]]></content:encoded>
			<wfw:commentRss>http://ben.neise.co.uk/index.php/2009/09/powershell-script-to-add-a-hash-table-full-of-virtual-port-groups-to-vsphere-hosts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
