<?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>Kent's Blog</title>
	<atom:link href="http://blog.tpv.dk/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.tpv.dk</link>
	<description>Just another day in the life of a System Engineer</description>
	<lastBuildDate>Mon, 15 Jun 2009 10:39:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to switch the VMware SCSI controller from parallel to SAS</title>
		<link>http://blog.tpv.dk/?p=53</link>
		<comments>http://blog.tpv.dk/?p=53#comments</comments>
		<pubDate>Mon, 15 Jun 2009 10:34:48 +0000</pubDate>
		<dc:creator>kbh4</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[SCSI]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://blog.tpv.dk/?p=53</guid>
		<description><![CDATA[Having upgraded to vSphere 4 (which seems to perform quite well, by the way) I discovered that VMware has added a new hard disk controller &#8220;LSI Logic SAS&#8221; &#8211; this controller is now the default controller for Windows 2008 systems. I&#8217;m not sure if there&#8217;s any performance boost in switching to this new virtual hardware? [...]]]></description>
			<content:encoded><![CDATA[<p>Having upgraded to vSphere 4 (which seems to perform quite well, by the way) I discovered that VMware has added a new hard disk controller &#8220;LSI Logic SAS&#8221; &#8211; this controller is now the default controller for Windows 2008 systems.</p>
<p>I&#8217;m not sure if there&#8217;s any performance boost in switching to this new virtual hardware? &#8211; VMware only lists added Windows Cluster support as a new feature. But I&#8217;m the type of guy who is bugged by having Windows 2008 templates which doesn&#8217;t match the default hardware, so I set out on the quest to upgrade the SCSI controller of my 2008-templates&#8230;</p>
<p>It&#8217;s not quite as simple as it might sound &#8211; you can&#8217;t just switch the controller as Windows lacks the driver to use the new controller, so this operation renders the OS unbootable. (until you switch the controller back)</p>
<p>Before you try to use the described procedure, be sure to have the VMware Tools in the VM up-to-date and upgrade the virtual hardware to version 7!</p>
<p>The idea behind this procedure is:</p>
<ol>
<li>Add a temporary IDE hard disk (VMware allows you to have SCSI and IDE drives simultanious, but not two SCSI drives with different controllers).</li>
<li>Let Windows install the IDE-drivers.</li>
<li>Remove the temporary hard disk.</li>
<li>Switch the active hard disk controller to an IDE controller.</li>
<li>Add a temporary SCSI hard disk with the new controller type.</li>
<li>Let Windows install the new SCSI-drivers.</li>
<li>Remove the temporary hard disk.</li>
<li>Switch the active hard disk controller back to a SCSI-controller.</li>
<li>Clean up unused drivers.</li>
</ol>
<p>If you want the detailed instructions on how to perform the operation, read on below.</p>
<p>I&#8217;m sure there&#8217;s an easier way to install the new drivers before switching the SCSI-controller, but I&#8217;m no Windows wizard, so I prefer to let Windows discover the new hardware by itself. <img src='http://blog.tpv.dk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>This procedure should work on other Windows versions as well, but I&#8217;ve not tried it on anything besides Windows Server 2008.</p>
<p>Needless to say: make sure you have a backup of your VM before something is screwed up! <img src='http://blog.tpv.dk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><strong>Detailed instructions.</strong></p>
<p>Power down the VM or convert it to a virtual machine if it is a template.</p>
<p>Add an IDE hard disk:</p>
<p><img class="alignnone size-full wp-image-37" title="parallel_to_sas_01" src="http://blog.tpv.dk/wp-content/uploads/blog.tpv.dk/2009/06/parallel_to_sas_01.png" alt="parallel_to_sas_01" width="420" height="372" /></p>
<p><img class="alignnone size-full wp-image-38" title="parallel_to_sas_02" src="http://blog.tpv.dk/wp-content/uploads/blog.tpv.dk/2009/06/parallel_to_sas_02.png" alt="parallel_to_sas_02" width="515" height="406" /></p>
<p>Boot the server and let Windows install the IDE drivers (answer &#8220;I moved it&#8221; if asked). If you wan&#8217;t you can see the two disk drives in the Device manager:</p>
<p><img class="alignnone size-full wp-image-39" title="parallel_to_sas_03" src="http://blog.tpv.dk/wp-content/uploads/blog.tpv.dk/2009/06/parallel_to_sas_03.png" alt="parallel_to_sas_03" width="358" height="399" /></p>
<p>Shut down the server.</p>
<p>Delete the IDE drive again (remove the files from disk):</p>
<p><img class="alignnone size-full wp-image-40" title="parallel_to_sas_04" src="http://blog.tpv.dk/wp-content/uploads/blog.tpv.dk/2009/06/parallel_to_sas_04.png" alt="parallel_to_sas_04" width="560" height="496" /></p>
<p>Also remove the SCSI hard drive (make sure NOT to delete the files from disk!).</p>
<p>Log into the Service Console and find the .vmdk file defining the hard disk. Edit this file with your favorite Linux text editor (&#8220;vi&#8221; for instance).</p>
<p>Change the adapter type in the line:</p>
<blockquote><p>ddb.adapterType = &#8220;lsilogic&#8221;</p></blockquote>
<p>to</p>
<blockquote><p>ddb.adapterType = &#8220;ide&#8221;</p></blockquote>
<p>Add a new hard disk, choose to use an existing virtual disk:</p>
<p><img class="alignnone size-full wp-image-41" title="parallel_to_sas_05" src="http://blog.tpv.dk/wp-content/uploads/blog.tpv.dk/2009/06/parallel_to_sas_05.png" alt="parallel_to_sas_05" width="515" height="406" /></p>
<p>Browse to the harddisk file, and make sure it is recognized as an IDE disk:</p>
<p><img class="alignnone size-full wp-image-42" title="parallel_to_sas_06" src="http://blog.tpv.dk/wp-content/uploads/blog.tpv.dk/2009/06/parallel_to_sas_06.png" alt="parallel_to_sas_06" width="515" height="406" /></p>
<p>Add another new hard disk, this time create a new virtual disk:</p>
<p><img class="alignnone size-full wp-image-43" title="parallel_to_sas_07" src="http://blog.tpv.dk/wp-content/uploads/blog.tpv.dk/2009/06/parallel_to_sas_07.png" alt="parallel_to_sas_07" width="515" height="406" /></p>
<p>Make the new drive a SCSI disk:</p>
<p><img class="alignnone size-full wp-image-44" title="parallel_to_sas_08" src="http://blog.tpv.dk/wp-content/uploads/blog.tpv.dk/2009/06/parallel_to_sas_08.png" alt="parallel_to_sas_08" width="515" height="406" /></p>
<p>This will get assigned a &#8220;LSI Logic SAS&#8221; controller if it&#8217;s Windows 2008:</p>
<p><img class="alignnone size-full wp-image-45" title="parallel_to_sas_09" src="http://blog.tpv.dk/wp-content/uploads/blog.tpv.dk/2009/06/parallel_to_sas_09.png" alt="parallel_to_sas_09" width="560" height="496" /></p>
<p>Boot the server, log in and let Windows install the new SCSI driver.</p>
<p>Shut down the server and delete the new SCSI-drive again and remove the &#8220;old&#8221; IDE disk retaining the file:</p>
<p><img class="alignnone size-full wp-image-46" title="parallel_to_sas_10" src="http://blog.tpv.dk/wp-content/uploads/blog.tpv.dk/2009/06/parallel_to_sas_10.png" alt="parallel_to_sas_10" width="560" height="496" /></p>
<p>Edit the .vmdk file in the service console, and the adapter type back to &#8220;lsilogic&#8221;:</p>
<blockquote><p>ddb.adapterType = &#8220;lsilogic&#8221;</p></blockquote>
<p>Add a new hard disk, choose to use an existing virtual disk. Browse to the harddisk file.</p>
<p>It will now recognise it as a SCSI drive:</p>
<p><img class="alignnone size-full wp-image-47" title="parallel_to_sas_11" src="http://blog.tpv.dk/wp-content/uploads/blog.tpv.dk/2009/06/parallel_to_sas_11.png" alt="parallel_to_sas_11" width="515" height="406" /></p>
<p>And it will use the new SAS controller (if it&#8217;s Windows 2008):</p>
<p><img class="alignnone size-full wp-image-48" title="parallel_to_sas_12" src="http://blog.tpv.dk/wp-content/uploads/blog.tpv.dk/2009/06/parallel_to_sas_12.png" alt="parallel_to_sas_12" width="560" height="496" /></p>
<p>Boot the server and check that everything work as expected.</p>
<p>If you want to clean up the now unused drivers, start a command prompt with admin rights (Run as administrator):</p>
<p><img class="alignnone size-full wp-image-49" title="parallel_to_sas_13" src="http://blog.tpv.dk/wp-content/uploads/blog.tpv.dk/2009/06/parallel_to_sas_13.png" alt="parallel_to_sas_13" width="358" height="465" /></p>
<p>Type &#8220;set devmgr_show_nonpresent_devices=1&#8243; at the prompt.</p>
<p>Launch the Device Manager from the prompt with the &#8220;devmgmt.msc&#8221; command:</p>
<p><img class="alignnone size-full wp-image-50" title="parallel_to_sas_14" src="http://blog.tpv.dk/wp-content/uploads/blog.tpv.dk/2009/06/parallel_to_sas_14.png" alt="parallel_to_sas_14" width="534" height="265" /></p>
<p>Select &#8220;Show hidden devices&#8221;:</p>
<p><img class="alignnone size-full wp-image-51" title="parallel_to_sas_15" src="http://blog.tpv.dk/wp-content/uploads/blog.tpv.dk/2009/06/parallel_to_sas_15.png" alt="parallel_to_sas_15" width="250" height="340" /></p>
<p>Find the non present devices that are grayed out, and delete them (the old &#8220;VMware Virtual disk SCSI Disk Device&#8221;, the &#8220;IDE Hard Drive ATA Device&#8221; and the old &#8220;LSI Adapter, Ultra 320 SCSI 2000 series&#8221;):</p>
<p><img class="alignnone size-full wp-image-52" title="parallel_to_sas_16" src="http://blog.tpv.dk/wp-content/uploads/blog.tpv.dk/2009/06/parallel_to_sas_16.png" alt="parallel_to_sas_16" width="298" height="412" /></p>
<p>Now everything looks neat and clean:</p>
<p><img class="alignnone size-full wp-image-36" title="parallel_to_sas_17" src="http://blog.tpv.dk/wp-content/uploads/blog.tpv.dk/2009/06/parallel_to_sas_17.png" alt="parallel_to_sas_17" width="298" height="378" /></p>
<p>If it original was a template, shut the server down and convert it back to a template.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tpv.dk/?feed=rss2&amp;p=53</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Exit: SnapManager, Enter: VIBE</title>
		<link>http://blog.tpv.dk/?p=32</link>
		<comments>http://blog.tpv.dk/?p=32#comments</comments>
		<pubDate>Mon, 20 Oct 2008 07:34:20 +0000</pubDate>
		<dc:creator>kbh4</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[netapp]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[VIBE]]></category>

		<guid isPermaLink="false">http://blog.tpv.dk/?p=32</guid>
		<description><![CDATA[As commented earlier, I&#8217;ve had some problem running SnapManager on our Virtual Infrastructure and NetApp Filers. SnapMananager insists on snapshotting all VM on a datastore at the same time, which leads to timeout problems in the VSS system. As an alternative I&#8217;ve been exploring NetApp&#8217;s VIBE (Virtual Infrastructure Backup Engine) script, and it actually seems [...]]]></description>
			<content:encoded><![CDATA[<p>As <a title="SnapManager problems" href="http://blog.tpv.dk/?p=29" target="_self">commented earlier</a>, I&#8217;ve had some problem running SnapManager on our Virtual Infrastructure and NetApp Filers. SnapMananager insists on snapshotting all VM on a datastore at the same time, which leads to timeout problems in the VSS system.</p>
<p>As an alternative I&#8217;ve been exploring NetApp&#8217;s VIBE (Virtual Infrastructure Backup Engine) script, and it actually seems to be doing the job just right!</p>
<p>VIBE makes VMware snapshots of all the VM&#8217;s on the datastore, just like SnapManager, but it does so one VM at the time &#8211; it take quite a bit longer to generate (and remove) all the snapshots, but gone are all the timeout problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tpv.dk/?feed=rss2&amp;p=32</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SnapManager problems</title>
		<link>http://blog.tpv.dk/?p=29</link>
		<comments>http://blog.tpv.dk/?p=29#comments</comments>
		<pubDate>Wed, 15 Oct 2008 08:00:46 +0000</pubDate>
		<dc:creator>kbh4</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[netapp]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://blog.tpv.dk/?p=29</guid>
		<description><![CDATA[As you might know, we are using NetApp Filers for shared NFS-storage for our ESX servers. Today I&#8217;ve been trying to setup NetApp &#8220;SnapManager for Virtual Infrastructure&#8220;. The idea is that SnapManager makes VMware snapshots of the running machines, then does a NetApp Snapshot of the storage volume and finally deletes the VMware snapshots &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>As you might know, we are using NetApp Filers for shared NFS-storage for our ESX servers. Today I&#8217;ve been trying to setup NetApp &#8220;<a title="SnapManager for Virtual Infrastructure" href="http://www.netapp.com/us/products/management-software/snapmanager-virtual.html" target="_blank">SnapManager for Virtual Infrastructure</a>&#8220;.</p>
<p>The idea is that SnapManager makes VMware snapshots of the running machines, then does a NetApp Snapshot of the storage volume and finally deletes the VMware snapshots &#8211; this is done to be sure that the virtual harddrives are in a consistent state when the NetApp Snapshot is made. If the applications running in the virtual machines supports VSS (<a title="Volume Shadow Copy" href="http://en.wikipedia.org/wiki/Volume_Shadow_Copy_Service" target="_blank">Volume Shadow Copy</a>) it&#8217;ll even be application consistent!</p>
<p>The after NetApp Snapshot are created it is SnapMirrored (copied) to a Filer in another physical location for disaster recovery purposes.</p>
<p>It sounds great, and it even works great then I do a backup of a single VM. But, yes as the title suggests there is a &#8220;but&#8221;, when I try to backup my entire datastore, SnapManager tells Virtual Center to make snapshots of the all the running virtual machines at once. It might be that our NetApp Filer is too slow, or due to some other bottlenecks in our setup, but when VC tries to take 26 simultaneous snapshots a few (between 2 to 7) of them randomly suffers a &#8220;timeout&#8221;.</p>
<p>The failed snapshots makes SnapManager abort the backup.</p>
<p>I&#8217;ve looked high and low for a setting to either:</p>
<ul>
<li>Make SnapManager only do a few snapshots at a time,</li>
<li>Extend the snapshot timeout value in VC (it seems to be 20 seconds) or</li>
<li>Make VC queue the snapshot commands so that only a few are executed in parallel.</li>
</ul>
<p>But I havent been able to do either so far&#8230;</p>
<p>I also experienced two cases where the .vmx file of powered-off VMs mysteriously got deleted somewhere in the process&#8230; Bad karma!</p>
<p>So, until I got things sorted out, we&#8217;re back to plain ol&#8217; NetApp Snapshots for the backup of our virtual machines. (of cause combined with client based backup of important data inside the VMs).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tpv.dk/?feed=rss2&amp;p=29</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to shrink a VMware virtual disk</title>
		<link>http://blog.tpv.dk/?p=3</link>
		<comments>http://blog.tpv.dk/?p=3#comments</comments>
		<pubDate>Wed, 08 Oct 2008 08:23:36 +0000</pubDate>
		<dc:creator>kbh4</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://blog.tpv.dk/?p=3</guid>
		<description><![CDATA[In my company we are using VMware ESX servers (version 3.5.0 update 2) for our virtual environment. We have a couple of elderly Netapp filers which we use for shared NFS storage to host the virtual machines. All in all we are quite happy with this solution, but as our storage capacity is running a [...]]]></description>
			<content:encoded><![CDATA[<p>In my company we are using VMware ESX servers (version 3.5.0 update 2) for our virtual environment. We have a couple of elderly Netapp filers which we use for shared NFS storage to host the virtual machines.</p>
<p>All in all we are quite happy with this solution, but as our storage capacity is running a bit low, I was extremely dissatisfied to find that moving virtual machines from storage to storage, would convert our thin provisioned disks to thick disks (a 30 gig harddrive with 10 gig data would fill 30 gig on the storage and not 10 gig).</p>
<p>As our Netapp filers are too old and slow to run deduplication I tried to use the &#8220;Shrink&#8221; function from the VMware Toolbox inside the virtual machines, hoping that this would convert the disks back to thin disks. But no luck there; this action actually expands the virtual disk to fill the maximum possible if it wasn&#8217;t already doing so!</p>
<p>I&#8217;m sure this behavior is not intended from VMware, and it will probably be fixed sometime in the future. But until then, I discovered a way to convert the disks back to thin disks while the virtual machines are running.</p>
<p><em>I take no responsibility for this procedure, and if you lose your virtual disks, don&#8217;t come blaming me, but roll back to your backup.</em></p>
<p>Here we go:</p>
<p>First of all, to get the most out of shrinking your disk, you should do the following inside the virtual machines.</p>
<h3>1. Defragment your virtual disk</h3>
<p>Use the build-in defrag-tool in Windows or a third part tool of your choice.</p>
<h3>2. Shrink the disk using VMware tools inside the virtual machine</h3>
<p>Go ahead and open the VMware toolbox and find the &#8220;Shrink&#8221; function</p>
<p><a href="http://blog.tpv.dk/wp-content/uploads/2008/10/vmware-tools-shrink-tab.png"><img class="alignnone size-medium wp-image-6" title="VMware Tools Shrink Tab" src="http://blog.tpv.dk/wp-content/uploads/2008/10/vmware-tools-shrink-tab-300x261.png" alt="" width="300" height="261" /></a></p>
<p>When you click the &#8220;Prepare to shrink&#8221; you start a two stage process; first the application fills all vacant space on the harddrive with large empty files</p>
<p><a href="http://blog.tpv.dk/wp-content/uploads/2008/10/vmware-tools-running-shrink.png"><img class="alignnone size-medium wp-image-11" title="VMware Tools running Shrink" src="http://blog.tpv.dk/wp-content/uploads/2008/10/vmware-tools-running-shrink.png" alt="" width="285" height="127" /></a></p>
<p>This process will take quite some time if you have a lot of unused space on your disk. If you look at the root of the harddrive, you&#8217;ll find that it simply generates a number of 2 gig files named &#8220;wiper0&#8243;, &#8220;wiper1&#8243; etc..</p>
<p><a href="http://blog.tpv.dk/wp-content/uploads/2008/10/vmware-tools-wiper-files.png"><img class="alignnone size-medium wp-image-12" title="VMware Tools &quot;wiper&quot; files" src="http://blog.tpv.dk/wp-content/uploads/2008/10/vmware-tools-wiper-files-300x138.png" alt="" width="300" height="138" /></a></p>
<p>These files are simply used to overwrite any &#8220;deleted&#8221; files on the disk; when Windows deletes a file, it doesn&#8217;t actually remove the data, it just removes any reference to it &#8211; therefore it still takes up space on your disk. The &#8220;wiper&#8221;-files allow ESX to identify truly unused blocks on your disk.</p>
<p>The next step the Toolbox is to supposed to do, is to tell the ESX host to do the Shrink</p>
<p><a href="http://blog.tpv.dk/wp-content/uploads/2008/10/wmvare-tools-step-2.png"><img class="alignnone size-medium wp-image-14" title="VMvare Tools step 2" src="http://blog.tpv.dk/wp-content/uploads/2008/10/wmvare-tools-step-2.png" alt="" width="267" height="119" /></a></p>
<p>But unfortunately this is never done. Hence we need to do some additional work:</p>
<h3>3. Take a snapshot of the virtual disk<strong><br />
</strong></h3>
<p>This is done to have a static non-changing disk file to work on. When a snapshot is active, every change to the harddrive is written into a separate delta-file.</p>
<h3>4. Open a session to an ESX host with access to the storage</h3>
<p>Either use a SSH client or access the service console directly &#8211; make sure to be &#8220;root&#8221; before you try to proceed.</p>
<p>Change directory to where the virtual machines stores its files:</p>
<pre style="padding-left: 30px;">cd /vmfs/volumes/netapp10/Win2003helper/</pre>
<p>In this example my storage is named &#8220;netapp10&#8243; and the virtual machine is called &#8220;Win2003helper&#8221;.</p>
<p>A simple &#8220;ls -l&#8221; command reveals which files exists, the interesting ones are:</p>
<pre style="padding-left: 30px;">-rw-------    1 root     root     16795648 Oct  7 13:15 Win2003helper-000001-delta.vmdk
-rw-------    1 root     root          235 Oct  7 13:14 Win2003helper-000001.vmdk
-rw-------    1 root     root     8589934592 Oct  7 13:14 Win2003helper-flat.vmdk
-rw-------    1 root     root        19395 Oct  7 13:14 Win2003helper-Snapshot1.vmsn
-rw-------    1 root     root          406 Oct  7 12:59 Win2003helper.vmdk</pre>
<p>The file &#8220;Win2003helper.vmdk&#8221; contains metadata about the actual harddisk file, which is named &#8220;Win2003helper-flat.vmdk&#8221;. As you can see we also have a snapshot in place; the .vmsn file contains metadata about the snapshot, and the aforementioned delta disk file is named &#8220;Win2003helper-000001-delta.vmdk&#8221; (with a matching metafile).</p>
<p>If you&#8217;re the curios type, you can do a &#8220;cat &lt;filename&gt;&#8221; to check out the content of meta files.</p>
<h3>5. Make a &#8220;thin&#8221; clone of the snapshot</h3>
<p>Now it&#8217;s time to do the magic! Use the &#8220;vmkfstool&#8221; command to make a clone of the virtual harddrive:</p>
<pre style="padding-left: 30px;">vmkfstools -i Win2003helper.vmdk -d thin Win2003helper_thin.vmdk</pre>
<p>The &#8220;-d&#8221; option tells vmkfstools to make it a thin provisioned disk. The clone will be made from the non-changing snapshot (remember that changes are written to the delta-disk), so we don&#8217;t get into trouble with inconsistent drives.</p>
<pre style="padding-left: 30px;">Destination disk format: VMFS thin-provisioned
Cloning disk 'Win2003helper.vmdk'...
Clone: 100% done.</pre>
<p>Wait for the cloning to finish. When it&#8217;s done, a &#8220;ls -l&#8221; will reveal the new disk:</p>
<pre style="padding-left: 30px;">-rw-------    1 root     root     8589934592 Oct  7 13:24 Win2003helper_thin-flat.vmdk
-rw-------    1 root     root          437 Oct  7 13:24 Win2003helper_thin.vmdk</pre>
<p>You might be surprised to see that the file size is exactly the same at the bloated disk, you were hoping to shrink &#8211; but don&#8217;t panic, this is only due to the fact that the service console sees the size of the drive, and not how much space it occupies on the storage. Go ahead and browse the storage from the VMware Infrastructure Client, and you should see the true picture</p>
<p><a href="http://blog.tpv.dk/wp-content/uploads/2008/10/vmware-datastore-browser.png"><img class="alignnone size-medium wp-image-18" title="VMware Datastore Browser" src="http://blog.tpv.dk/wp-content/uploads/2008/10/vmware-datastore-browser-300x160.png" alt="" width="300" height="160" /></a></p>
<h3>6. Replace the thick disk with the thin clone</h3>
<p>Go ahead and overwrite the thick disk with the clone just created:</p>
<pre style="padding-left: 30px;">mv -f Win2003helper_thin-flat.vmdk Win2003helper-flat.vmdk</pre>
<p>And then remove the obsolete meta file &#8220;Win2003helper_thin.vmdk&#8221; either with the Datastore Browser or from the command line:</p>
<pre style="padding-left: 30px;">rm -f Win2003helper_thin.vmdk</pre>
<h3>7. Delete the snapshot</h3>
<p>Finally you can delete the snapshot you created in the Snapshot Manager</p>
<p><a href="http://blog.tpv.dk/wp-content/uploads/2008/10/vmware-snapshot-manager.png"><img class="alignnone size-medium wp-image-19" title="VMware Snapshot Manager" src="http://blog.tpv.dk/wp-content/uploads/2008/10/vmware-snapshot-manager-300x244.png" alt="" width="300" height="244" /></a></p>
<p>Just press &#8220;Delete All&#8221;, and it will apply all changes that might have happened to the harddrive while we were cloning the disk.</p>
<p><a href="http://blog.tpv.dk/wp-content/uploads/2008/10/vmware-deleting-snapshot.png"><img class="alignnone size-medium wp-image-20" title="VMware deleting snapshot" src="http://blog.tpv.dk/wp-content/uploads/2008/10/vmware-deleting-snapshot-300x47.png" alt="" width="300" height="47" /></a></p>
<h3>8. Enjoy</h3>
<p>If you take a look at the Datastore Browser, you will now find everything cleaned up, and the virtual disk shrunk to fit the actual usage in the virtual machine.</p>
<p><a href="http://blog.tpv.dk/wp-content/uploads/2008/10/vmware-datastore-browser-2.png"><img class="alignnone size-medium wp-image-22" title="VMware Datastore Browser" src="http://blog.tpv.dk/wp-content/uploads/2008/10/vmware-datastore-browser-2-300x137.png" alt="" width="300" height="137" /></a></p>
<p>Of cause the file will grow as you add data to your virtual disk, and if you delete a lot of data, you might consider going thru the procedure again, to reclaim that space.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tpv.dk/?feed=rss2&amp;p=3</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>
