<?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>VMtoday &#187; sizing</title> <atom:link href="http://vmtoday.com/tag/sizing/feed/" rel="self" type="application/rss+xml" /><link>http://vmtoday.com</link> <description>VMware News, Views, &#38; How-To&#039;s from vExpert Josh Townsend</description> <lastBuildDate>Sat, 14 Jan 2012 03:00:43 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Right-sizing Your Power and Cooling</title><link>http://vmtoday.com/2010/01/right-sizing-your-power-and-cooling/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=right-sizing-your-power-and-cooling</link> <comments>http://vmtoday.com/2010/01/right-sizing-your-power-and-cooling/#comments</comments> <pubDate>Thu, 21 Jan 2010 23:30:01 +0000</pubDate> <dc:creator>Joshua Townsend</dc:creator> <category><![CDATA[General IT]]></category> <category><![CDATA[Storage]]></category> <category><![CDATA[VMware]]></category> <category><![CDATA[calculator]]></category> <category><![CDATA[clariion]]></category> <category><![CDATA[consumption]]></category> <category><![CDATA[cooling]]></category> <category><![CDATA[EMC]]></category> <category><![CDATA[green]]></category> <category><![CDATA[planning]]></category> <category><![CDATA[power]]></category> <category><![CDATA[sizing]]></category> <category><![CDATA[virtualization]]></category><guid
isPermaLink="false">http://vmtoday.com/?p=353</guid> <description><![CDATA[We all know that virtualization allows us to do more with less.  Fewer servers and space-saving storage (talk about an oxymoron) help us put some green in the datacenter and back in the budget.  But with tight budgets demanding greater efficiency, virtualization pushing per-U-space utilization higher, and increasingly rack-dense equipment, proper planning of your physical [...]]]></description> <content:encoded><![CDATA[<p></p><p>We all know that virtualization allows us to do more with less.  Fewer servers and space-saving storage (talk about an oxymoron) help us put some green in the datacenter and back in the budget.  But with tight budgets demanding greater efficiency, virtualization pushing per-U-space utilization higher, and increasingly rack-dense equipment, proper planning of your physical plant remains an essential part of IT.  I argue that right-sizing your power, cooling, and floor-space is more critical now than it has ever been, and is a knowing how to do it is a darn good skill for a virtualization engineer to possess.</p><p>So along those lines&#8230; I was just doing some site-prep work for a new Clariion installation and noticed that the EMC Power Calculator has been updated.  It is now a pretty slick little web app that can be found on the PowerLink site (login required) here: <a
href="https://powerlink.emc.com/nsepn/webapps/powercalculator/Main.aspx">https://powerlink.emc.com/nsepn/webapps/powercalculator/Main.aspx</a>.</p><p>While I am at it, here are some links to other power consumption calculators.  Let me know if you have others and I will update this post:</p><ul><li>Dell: <a
href="http://www.dell.com/calc" target="_blank">http://www.dell.com/calc</a></li><li>IBM: <a
href="http://www-03.ibm.com/systems/bladecenter/resources/powerconfig/index.html">http://www-03.ibm.com/systems/bladecenter/resources/powerconfig/index.html</a></li><li>NetApp: Storage Efficiency Calculator here - <a
href="http://www.secalc.com/">http://www.secalc.com</a> &#8211; it doesn&#8217;t calculate your consumption, just what you might save over a competitor&#8217;s offering.</li><li>HP: <a
href="javascript:openExternal('http://h30099.www3.hp.com/configurator/powercalcs.asp')">http://h30099.www3.hp.com/configurator/powercalcs.asp</a></li><li>Sun: <a
href="http://www.sun.com/solutions/eco_innovation/powercalculators.jsp">http://www.sun.com/solutions/eco_innovation/powercalculators.jsp</a></li><li>Hitachi/HDS: <a
href="http://www.byhitachi.com/se/go/weight-and-power-calculator/">http://www.byhitachi.com/se/go/weight-and-power-calculator/</a></li><li>APC: <a
href="http://www.apc.com/prod_docs/results.cfm?DocType=Trade-Off%20Tool&amp;Query_Type=10" target="_blank">http://www.apc.com/prod_docs/results.cfm?DocType=Trade-Off%20Tool&amp;Query_Type=10</a> and <a
href="http://www.apcc.com/products/runtime_for_extendedruntime.cfm?upsfamily=165">http://www.apcc.com/products/runtime_for_extendedruntime.cfm?upsfamily=165</a></li><li>Emerson: Efficiency Calculator: <a
href="http://www.emerson.com/edc/Calculator/default.aspx">http://www.emerson.com/edc/Calculator/default.aspx</a></li><li>VMware ROI Calculator: <a
href="http://vmware.com/go/calculator" target="_blank">http://vmware.com/go/calculator</a></li><li>This site has a bunch of links to other calculators and resources: <a
href="http://thegreenandvirtualdatacenter.com/calculator.html">http://thegreenandvirtualdatacenter.com/calculator.html</a></li></ul><p>There&#8217;s some fun and timely chatter happening right now on Twitter around power consumption and sizing &#8211; join in by following me at <a
href="http://twitter.com/joshuatownsend/" target="_blank">http://twitter.com/joshuatownsend/</a>!</p><div
class="shr-publisher-353"></div><div
style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div
class='shareaholic-like-buttonset' style='float:none;height:30px;'><a
class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fvmtoday.com%2F2010%2F01%2Fright-sizing-your-power-and-cooling%2F' data-shr_title='Right-sizing+Your+Power+and+Cooling'></a><a
class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fvmtoday.com%2F2010%2F01%2Fright-sizing-your-power-and-cooling%2F'></a><a
class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fvmtoday.com%2F2010%2F01%2Fright-sizing-your-power-and-cooling%2F' data-shr_title='Right-sizing+Your+Power+and+Cooling'></a></div><div
style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div>]]></content:encoded> <wfw:commentRss>http://vmtoday.com/2010/01/right-sizing-your-power-and-cooling/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Storage Basics &#8211; Part III: RAID</title><link>http://vmtoday.com/2010/01/storage-basics-part-iii-raid/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=storage-basics-part-iii-raid</link> <comments>http://vmtoday.com/2010/01/storage-basics-part-iii-raid/#comments</comments> <pubDate>Wed, 06 Jan 2010 23:24:26 +0000</pubDate> <dc:creator>Joshua Townsend</dc:creator> <category><![CDATA[Storage]]></category> <category><![CDATA[Storage Basics]]></category> <category><![CDATA[VMware]]></category> <category><![CDATA[calculate]]></category> <category><![CDATA[calculations]]></category> <category><![CDATA[disk]]></category> <category><![CDATA[IOPS]]></category> <category><![CDATA[perfmon]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[raid]]></category> <category><![CDATA[SAN]]></category> <category><![CDATA[sizing]]></category> <category><![CDATA[virtualization]]></category><guid
isPermaLink="false">http://vmtoday.com/?p=311</guid> <description><![CDATA[This is the third in a multi-part series on storage basics.  I&#8217;ve had some good feedback from folks in the SMB space saying that the first couple posts in this series have been beneficial, so we&#8217;ll be sticking with some basic concepts for another post or two before we dive into some nitty-gritty details and practical [...]]]></description> <content:encoded><![CDATA[<p></p><p>This is the third in a multi-part series on storage basics.  I&#8217;ve had some good feedback from folks in the SMB space saying that the <a
title="Storage Basics: Part I - Introduction" href="http://vmtoday.com/2009/12/storage-basics-part-i-intro/">first</a> couple posts in this series have been beneficial, so we&#8217;ll be sticking with some basic concepts for another post or two before we dive into some nitty-gritty details and practical applications of these concepts in a VMware environment.  In the <a
title="Storage Basics: Part II: IOPS" href="http://vmtoday.com/2009/12/storage-basics-part-ii-iops/">second post</a> of this series I introduced the concept of IOPS and explained how the physical characteristics of a hard disk drive determine the theoretical IOPS capability of a disk.  I then noted that you can aggregate disks to achieve a greater number of IOPS for a particular storage environment.  Today, we will look at just how you combine multiple disks and the performance impact of doing so.  Remember that we are keeping this simple; the concepts I present here may not apply to that fancy new SAN you just purchased with your end-of-year money or the cheap little SATA controller on your desktop&#8217;s motherboard (not that there&#8217;s anything wrong with it) &#8211; we&#8217;re more in the middle ground of direct attached storage (DAS) as we firm up concepts.</p><p>Enterprise servers and storage systems have the ability to combine multiple disks into a group using Redundant Array of Independent Disks (RAID) technology.  We&#8217;ll assume a hardware RAID controller is responsible for configuring and driving storage IO to the connected disks.  RAID controllers typically have battery-backed cache (we&#8217;ll talk cache in a future post), an interconnect where the drives plug in, such as SCSI or SAS (we&#8217;ll talk about these too in a future post), and hold the configuration of the RAID set including stripe size and RAID level.  The controller also does the basic work of reading and writing on RAID set &#8211; mirroring, striping, and parity calculations.  There are several different types of RAID level &#8211; rather than rehash the details of them, <a
title="Wikipedia RAID" href="http://en.wikipedia.org/wiki/RAID" target="_blank">read the Wikipedia entry on RAID</a> and then come back here&#8230;.</p><p>Ok, great.  So you now know that RAID is implemented to increase performance through the aggregation of multiple disks, and to increase reliability though mirroring and parity.  Now let&#8217;s consider the performance implications of some basic RAID levels.  As with many things in the IT industry, there are trade-offs: security vs. usability, brains vs. brawn, and now performance vs. reliability.  As we increase reliability in a RAID array through mirroring and parity, performance can be impacted.  This is where the <strong>more disks = more IOPS</strong> bit starts to fall apart.  The exact impact depends on the RAID type.  Here are some examples of how RAID impact the maximum theoretical IOPS using the most common RAID levels, where:</p><p
style="padding-left: 30px;">I = Total IOPS for Array (note that I show Read and Write separately)</p><p
style="padding-left: 30px;">i = IOPS per disk in array (based on spindle speed averages from <a
title="Storage Basics - Part II: IOPS" href="http://vmtoday.com/2009/12/storage-basics-part-ii-iops/" target="_blank">Part II: IOPS</a>)</p><p
style="padding-left: 30px;">n = Number of disks in array</p><p
style="padding-left: 30px;">r = Percentage of read IOPS (calculated from the Average Disk Reads/Sec divided by total Average Disk Transfers/Sec in your Windows Perfmon)</p><p
style="padding-left: 30px;">w = Percentage of write IOPS (calculated from the Average Disk Writes/Sec divided by total Average Disk Transfers/Sec in your Windows Perfmon)</p><p><strong>RAID0 (striping, no redundancy)</strong></p><p>This is basic aggregation with no redundancy.  A single drive error/failure could render your data useless and as such it is not recommended for production use.  It does allow for some simple math:</p><blockquote><p
style="padding-left: 30px;">I =n*i</p></blockquote><p
style="padding-left: 30px;">Because there is no mirroring or parity overhead, theoretical maximum Read and Write IOPS are the same.</p><p><strong>RAID 1 &amp; RAID10 (mirroring technologies):</strong></p><p>Because data is mirrored to multiple disks</p><blockquote><p
style="padding-left: 30px;">Read I = n*i</p></blockquote><p
style="padding-left: 30px;">For example, if we have six 15k disks in a RAID10 config, we should expect a theoretical maximum number of IOPS for our array to be 6*180 = 1080 IOPS</p><blockquote><p
style="padding-left: 30px;">Write I = (n*i)/2</p></blockquote><p><strong>RAID5 (striping with a single parity disk)</strong></p><blockquote><p
style="padding-left: 30px;">Read I = (n-1)*i</p></blockquote><p
style="padding-left: 30px;">Example: Five 15k disks in a RAID 5 (4 + 1) will yield a maximum IOPS of (5-1)*180 = 720 READ IOPS.  We subtract 1 because one of the disks holds parity bits, not data.</p><blockquote><p
style="padding-left: 30px;">Write I = (n*i)/4</p></blockquote><p
style="padding-left: 30px;">Example: Five disks in a RAID 5 (4 + 1) will yield a maximum IOPS of (5*180)/4 = 225 WRITE IOPS</p><p>Again, these formulas are very basic and have little practical value.  Furthermore, it is seldom that you will find a system that is doing only reads or only writes.  More often, as is the case with typical VMware environments, reads and writes are mixed.  An understanding of your workload is key to accurately sizing your storage environment for performance.  One of the workload characteristics (we&#8217;ll explore some more in the future) that you should consider in your sizing is the percentage of read IOPS vs. the percentage of write IOPS.  A formula like this gets you close if you want to do the math for a mixed read/write environment in a RAID5 set:</p><blockquote><p
style="padding-left: 30px;">I = (n*i)/(r+4 *w)</p></blockquote><p
style="padding-left: 30px;">Example: a 60% read/40% write workload with five 15k disks in a RAID5 would provide (5*180)/(.6+4*.4) = 409 IOPS.</p><p>The previous examples have all been from the perspective of the storage system.  If we take a look at this from the server/OS/application side, something interesting shows up.  Let&#8217;s say you fired up Windows perfmon and collected Physical Disk Transfers/sec counters every 15 seconds for 24 hours and analyzed the data in Excel to find the 95th Percentile for total average IOPS (this is a pretty standard exercise if you are buying enterprise storage array or SAN).  Let&#8217;s say that you find that the server in question was asking for 1000 IOPS at the 95th Percentile (let&#8217;s stick with our 60% read/40% write workload).  And finally, let&#8217;s say we put this workload on a RAID5 array.  That&#8217;s saying a lot of stuff, but what does it all mean?  Because RAID5 has a write penalty factor of 4 (again, Duncan Epping&#8217;s posted <a
href="http://www.yellow-bricks.com/2009/12/23/iops/" target="_blank">a great article here</a> which I referenced in Part II that describes this in a slightly different way) we can tweak the previous formula to show the IO&#8217;s to the backend array given a specific workload.</p><p
style="padding-left: 30px;">I = Target workload IOPS</p><p
style="padding-left: 30px;">f = IO penalty</p><p
style="padding-left: 30px;">r = % Read</p><p
style="padding-left: 30px;">w = % Write</p><blockquote><p
style="padding-left: 30px;">IO = (I * r) + (I * w) * f</p></blockquote><p>Our example then looks like this (remember work inside parenthesis first, and then My Dear Aunt Sally):</p><blockquote><p>(1000 * .6) + ((1000 * .4) * 4) = 2200</p></blockquote><p>Simply stated, this means that for every 1000 IOPS that our workload requests from our storage system, the backing array perform 2200 IO&#8217;s, and it better do it quickly or you will start to see latency and queuing (we call this performance degradation, boys and girls!).  Again, this is a very simplistic approach neglecting factors like cache, randomness of the workload, stripe size, IO size, and partition alignment which can all impact requirements on the backend.  I&#8217;ll cover some of those later.</p><p>As you can hopefully see, the laws of physics combined with some simple math can provide some pretty useful numbers.  A basic understanding of your array configuration against your workload requirements can go a long way in preventing storage bottlenecks.  You may also find that as you consider the cost per disk against various spindle speeds, capacities and RAID levels that you are better off buying smaller, faster, fewer, more, slower&#8230;. disks depending on your requirements.  The geekier amongst us could even take these formulas and some costs per disk and hit up Excel Goal Seek to find the optimal level, but that&#8217;s more than this little blog can do for you today.</p><p>Before I wrap up this post, I want to leave you with a few more links that I have bookmarked around the topics of IOPS and RAID over the past several years:</p><ul><li>DB sizing for Microsoft Operations Manger, includes a nice chart with formulas similar to the ones I provided in this article: <a
href="http://blogs.technet.com/jonathanalmquist/archive/2009/04/06/how-can-i-gauge-operations-manager-database-performance.aspx">http://blogs.technet.com/jonathanalmquist/archive/2009/04/06/how-can-i-gauge-operations-manager-database-performance.aspx</a></li><li>An Experts Exchange post with some good info in the last entry on the page (subscription required) <a
href="http://www.experts-exchange.com/Storage/Storage_Technology/Q_22669077.html">http://www.experts-exchange.com/Storage/Storage_Technology/Q_22669077.html</a></li><li>A Microsoft TechNet article with storage sizing for Exchange &#8211; a bit dated but still applicable: <a
href="http://technet.microsoft.com/en-us/library/aa997052(EXCHG.65).aspx">http://technet.microsoft.com/en-us/library/aa997052(EXCHG.65).aspx</a></li><li>A simple whitepaper from Dell on their MD1000 DAS array &#8211; easy language to help the less technical along: <a
href="http://support.dell.com/support/edocs/systems/md1120/multlang/whitepaper/SAS%20MD1xxx.pdf">http://support.dell.com/support/edocs/systems/md1120/multlang/whitepaper/SAS%20MD1xxx.pdf</a></li><li>A great post that uses some math to show performance and cost trade-offs of RAID level, disk type, and spindle speed.  <a
title="http://www.yonahruss.com/architecture/raid-10-vs-raid-5-performance-cost-space-and-ha.html" href="http://www.yonahruss.com/architecture/raid-10-vs-raid-5-performance-cost-space-and-ha.html" target="_blank">http://www.yonahruss.com/architecture/raid-10-vs-raid-5-performance-cost-space-and-ha.html</a></li><li>Another nifty post that looks at cost vs. performance vs capacities of various disks speeds in an array <a
href="http://blogs.zdnet.com/Ou/?p=322">http://blogs.zdnet.com/Ou/?p=322</a></li></ul><p
style="padding-left: 30px;">&nbsp;</p><p
style="padding-left: 30px;">&nbsp;</p><div
class="shr-publisher-311"></div><div
style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div
class='shareaholic-like-buttonset' style='float:none;height:30px;'><a
class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fvmtoday.com%2F2010%2F01%2Fstorage-basics-part-iii-raid%2F' data-shr_title='Storage+Basics+-+Part+III%3A+RAID'></a><a
class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fvmtoday.com%2F2010%2F01%2Fstorage-basics-part-iii-raid%2F'></a><a
class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fvmtoday.com%2F2010%2F01%2Fstorage-basics-part-iii-raid%2F' data-shr_title='Storage+Basics+-+Part+III%3A+RAID'></a></div><div
style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div>]]></content:encoded> <wfw:commentRss>http://vmtoday.com/2010/01/storage-basics-part-iii-raid/feed/</wfw:commentRss> <slash:comments>15</slash:comments> </item> <item><title>ESXTOP Batch Mode &amp; Windows Perfmon</title><link>http://vmtoday.com/2009/09/esxtop-batch-mode-windows-perfmon/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=esxtop-batch-mode-windows-perfmon</link> <comments>http://vmtoday.com/2009/09/esxtop-batch-mode-windows-perfmon/#comments</comments> <pubDate>Thu, 10 Sep 2009 14:24:22 +0000</pubDate> <dc:creator>Joshua Townsend</dc:creator> <category><![CDATA[Issues & Troubleshooting]]></category> <category><![CDATA[VMware]]></category> <category><![CDATA[VMware How To]]></category> <category><![CDATA[ESX]]></category> <category><![CDATA[esxtop]]></category> <category><![CDATA[I/O]]></category> <category><![CDATA[perfmon]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[sizing]]></category> <category><![CDATA[statistics]]></category> <category><![CDATA[Storage]]></category><guid
isPermaLink="false">http://vmtoday.com/?p=192</guid> <description><![CDATA[I needed to grab some stats from my ESX hosts for off-line analysis so I fired up my trusty ESXTOP intent on using batch mode to capture a .csv formatted output.  I started to manually select the counters I was interested in while working in ESXTOP interactive mode (you can save your selected counters to [...]]]></description> <content:encoded><![CDATA[<p></p><p>I needed to grab some stats from my ESX hosts for off-line analysis so I fired up my trusty ESXTOP intent on using batch mode to capture a .csv formatted output.  I started to manually select the counters I was interested in while working in ESXTOP interactive mode (you can save your selected counters to the esxtop configuration file with the &#8216;w&#8217; command) and thought that there must be a better way.  I found that better way in the VMware Performance Community: <a
title="http://communities.vmware.com/docs/DOC-3930" href="http://communities.vmware.com/docs/DOC-3930">http://communities.vmware.com/docs/DOC-3930</a>.  There is now a -a switch that can be used to include ALL performance counters.  I&#8217;m sold.</p><p>I wanted detailed information, so I decided on a 15 second capture interval to run for a 2 hour window.  Here&#8217;s the command I used:</p><blockquote><p>esxtop -a -b -d 15 -n 480 &gt; /tmp/esxtopout.csv</p></blockquote><p>where -a is for ALL, -b is for batch mode, -d is for delay, and -n is for the number of iterations ((60/15)*60*2).  I wrote out the results to a .csv in /tmp.  The resulting CSV weighed in at a whopping 100MB after 2 hours.</p><p>The CSV can be analyzed in Excel (pivot tables work well for this) or in Windows Perfmon.  I opened the log in Perfmon as I was after basic Min/Average/Max counters and Perfmon makes those easy to see.  When adding the CSV log to Perfmon, you are prompted to select counters.  I added all instances of Commands/sec, Reads/sec, and Writes/sec from Physical Disk (I was gathering some IOPS counts for a new storage proposal). I got a bit more than I bargained for: a mostly unresponsive Perfmon window and the ugliest darn graph I&#8217;ve ever seen.</p><p><a
href="http://cloudfront.vmtoday.com/wp-content/uploads/2009/09/image.png" rel="lightbox[192]"><img
style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://cloudfront.vmtoday.com/wp-content/uploads/2009/09/image_thumb.png" border="0" alt="image" width="420" height="313" /></a></p><p>Switching from a graph view to the report view allows you to easily view and remove specific counters that you are not interested in, or open the Properties of the data set, switch to the data tab and bulk select counters that you want to remove.  I was not interested in vmhba1:x, specific VM&#8217;s or worlds, so I killed all of those, leaving just the base iSCSI device (vmhba32 in my case).</p><p>After some cleanup the graph looked a bit better and more importantly, I was able to easily read my Min/Average/Max stats:</p><p><a
href="http://cloudfront.vmtoday.com/wp-content/uploads/2009/09/image1.png" rel="lightbox[192]"><img
style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://cloudfront.vmtoday.com/wp-content/uploads/2009/09/image_thumb1.png" border="0" alt="image" width="416" height="327" /></a></p><p>Here are the takeaways -</p><ul><li><span
style="color: #35383d;">ESXTOP is a powerful utility for performance monitoring</span></li><li><span
style="color: #35383d;">All stats (-a) can result in a huge file &#8211; use it wisely in batch mode; else use interactive mode to select your counters and write them to the user-defined configuration file.  Invoke the config file with the -c option when running in batch mode.</span></li><li><span
style="color: #35383d;">Consider using vscsiStats for more granular reporting.</span></li><li><span
style="color: #35383d;">ESXTOP physical disk stats do not include NFS volumes.</span></li></ul><p>Do you use other tools or methods to collect basic disk IO counters for storage sizing purposes?  If so, leave a comment describing your approach!</p><div
class="shr-publisher-192"></div><div
style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div
class='shareaholic-like-buttonset' style='float:none;height:30px;'><a
class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fvmtoday.com%2F2009%2F09%2Fesxtop-batch-mode-windows-perfmon%2F' data-shr_title='ESXTOP+Batch+Mode+%26amp%3B+Windows+Perfmon'></a><a
class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fvmtoday.com%2F2009%2F09%2Fesxtop-batch-mode-windows-perfmon%2F'></a><a
class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fvmtoday.com%2F2009%2F09%2Fesxtop-batch-mode-windows-perfmon%2F' data-shr_title='ESXTOP+Batch+Mode+%26amp%3B+Windows+Perfmon'></a></div><div
style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div>]]></content:encoded> <wfw:commentRss>http://vmtoday.com/2009/09/esxtop-batch-mode-windows-perfmon/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Balloon Driver Problems with SQL</title><link>http://vmtoday.com/2009/09/balloon-driver-problems-with-sql/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=balloon-driver-problems-with-sql</link> <comments>http://vmtoday.com/2009/09/balloon-driver-problems-with-sql/#comments</comments> <pubDate>Thu, 10 Sep 2009 01:47:47 +0000</pubDate> <dc:creator>Joshua Townsend</dc:creator> <category><![CDATA[Issues & Troubleshooting]]></category> <category><![CDATA[VMware]]></category> <category><![CDATA[VMware How To]]></category> <category><![CDATA[VMworld]]></category> <category><![CDATA[3.5]]></category> <category><![CDATA[AWE]]></category> <category><![CDATA[balloon]]></category> <category><![CDATA[balloon driver]]></category> <category><![CDATA[driver]]></category> <category><![CDATA[ESX]]></category> <category><![CDATA[I/O]]></category> <category><![CDATA[kernel]]></category> <category><![CDATA[memory]]></category> <category><![CDATA[memory contention]]></category> <category><![CDATA[optimization]]></category> <category><![CDATA[PAE]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[sizing]]></category> <category><![CDATA[sql]]></category> <category><![CDATA[troubleshooting]]></category> <category><![CDATA[tuning]]></category> <category><![CDATA[vCPU]]></category> <category><![CDATA[VM]]></category> <category><![CDATA[vmworld]]></category><guid
isPermaLink="false">http://vmtoday.com/?p=175</guid> <description><![CDATA[I have been meaning to write this up for a while; Scott Drummonds&#8217; &#8216;Love Your Balloon Driver&#8217; post today at his Virtual Performance blog gave me a nice reminder.  I actually caught a sneak peak at the graphs with an explanation from Scott at his instructor-led lab at VMworld 2009.  Scott calls out that the [...]]]></description> <content:encoded><![CDATA[<p></p><p>I have been meaning to write this up for a while; Scott Drummonds&#8217; <a
title="Love Your Balloon Driver" href="http://communities.vmware.com/blogs/drummonds/2009/09/09/love-your-balloon-driver">&#8216;Love Your Balloon Driver&#8217; post</a> today at his Virtual Performance blog gave me a nice reminder.  I actually caught a sneak peak at the graphs with an explanation from Scott at his instructor-led lab at VMworld 2009.  Scott calls out that the only workload they discovered suffers from balloon driver activity is Java.  The reason for Java&#8217;s problems with balloon driver activity is that Java itself runs in a VM and so the guest OS cannot properly determine which pages should be swapped out when the balloon driver calls for it.</p><p>My experiences causes me to agree with Scott and the whitepaper he cites &#8211; in a properly designed and equipped environment the balloon driver is not detrimental for most every workload to a point.   However, I recently discovered in a client site that the balloon driver can cause significant issues when the environment is poorly designed and under-sized.  Here the background:</p><p>I was called into an already established environment where the client was running on an older blade with VMware ESX 3.5.  The blade maxed out at 16GB RAM and had dual dual-core CPU&#8217;s with no hope for an upgrade.  On the blade was a single guest VM running Windows 2003 with SQL 2005, in it&#8217;s full 32-bit glory.  The VM was configured with 4 vCPU&#8217;s and 16GB of memory.  Some of you can probably already guess where this is going&#8230;.</p><p>The x86 Windows guest had <a
href="http://technet.microsoft.com/en-us/library/cc784574(WS.10).aspx">PAE </a>configured, and SQL took advantage of <a
href="http://technet.microsoft.com/en-us/library/ms190673.aspx" target="_blank">AWE </a>to use the additional memory beyond the 4GB limit of a 32-bit system.  Additionally, the Windows guest had the /3GB switch enabled in boot.ini.  Finally, as per SQL best practices, the &#8216;<a
href="http://technet.microsoft.com/en-us/library/ms190730.aspx" target="_blank">Lock Pages in Memory</a>&#8216; permission was granted to the SQL Server service account.  What the guest was left with was 1GB of kernel mode memory and 15GB of User Mode/Extended addressable memory.</p><p>And here&#8217;s the problem.  The client was using ESX, not ESX 3.5, so the Service Console required memory.  In this case, the service console had approximately 512MB allocated to it.  Futhermore, VM&#8217;s require some overhead on ESX to run.  The memory overhead consumed by a Windows guest on ESX 3.5 with 4 vCPU and 16GB of memory is a bit more than 512MB.  On a properly sized ESX server with multiple similar guests/workloads, you could probably gain much of the overhead back through transparent page sharing; but in this case I had a 1:1 P2V ratio.  If you are any good at math you see that the environment is running about 1GB short of memory.  A quick check of the balloon driver stat in vCenter show that the balloon driver was constantly active and demanding about 1GB back from the guest&#8230; constantly.</p><p>Under normal circumstances this might not be an issue, but in this case the Windows guest was being absolutely punished.  The guest CPU&#8217;s were pegged at 100% with an excessive amount of kernel time, often indicating IO issues.  And indeed I did experience terrible disk and network performance on the guest.  At the root of the problem is this &#8211; the Lock Pages in Memory permission allows SQL to get a firm grasp on the user mode memory available to it (15GB) and lock it up.  This left the already starved (because of the 3GB switch in the boot.ini) guest kernel with it&#8217;s 1GB the only thing the balloon driver could really swap out.</p><p>The client suggested a reservation of 16GB on the VM, knowing that memory reservations prevent balloon driver activity.  I calmly asked them to back away from the keyboard as I explained how if a starved guest was bad, how much worse a starved Service Console would be.  In the end the fix was quiet easy &#8211; I convinced the customer that they should reduce the amount of memory allocated to the guest by about 1GB, enough to let the 512MB SC and the 512MB of overhead run without contention.  I was able to show them the difference between allocated and active memory in vCenter &#8211; the 1GB being surrendered was not really being actively used, SQL just had it locked up.  In fact, surrendering the 1GB of memory back to ESX breathed new life into the guest VM, bringing its performance back in line with expectations.</p><p>Ideally, I would have brought in a bigger ESX server that could serve additional VM&#8217;s, driving greater levels of efficiency across the environment.  It just wasn&#8217;t an option for the client in this case.  In the end, the problem was fixed and I was reminded just how fun it can be to explain some of these backwards sounding virtualization concepts to customers &#8211; fewer vCPU&#8217;s can lead to better performance of guests, less guest memory can fix performance issues, and increasing the quantity of similar guests on a host can drive better performance to a point because of transparent page sharing.</p><p>Stay tuned over the next few weeks as I digest and write on my VMworld experience &#8211; from VMUG activities to Paul Maritz&#8217;s press conference announcing the vCloud Express, and plenty of great sessions in between.  Like many of you, I returned from VMworld with quite a backlog of work but I&#8217;ll do my best to squeeze in some posts and tweets.</p><div
class="shr-publisher-175"></div><div
style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div
class='shareaholic-like-buttonset' style='float:none;height:30px;'><a
class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fvmtoday.com%2F2009%2F09%2Fballoon-driver-problems-with-sql%2F' data-shr_title='Balloon+Driver+Problems+with+SQL'></a><a
class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fvmtoday.com%2F2009%2F09%2Fballoon-driver-problems-with-sql%2F'></a><a
class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fvmtoday.com%2F2009%2F09%2Fballoon-driver-problems-with-sql%2F' data-shr_title='Balloon+Driver+Problems+with+SQL'></a></div><div
style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div>]]></content:encoded> <wfw:commentRss>http://vmtoday.com/2009/09/balloon-driver-problems-with-sql/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Obtaining VMware Guest Disk Free Space for NFS Sizing</title><link>http://vmtoday.com/2008/12/obtaining-vmware-guest-disk-free-space-for-nfs-sizing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=obtaining-vmware-guest-disk-free-space-for-nfs-sizing</link> <comments>http://vmtoday.com/2008/12/obtaining-vmware-guest-disk-free-space-for-nfs-sizing/#comments</comments> <pubDate>Fri, 05 Dec 2008 21:31:22 +0000</pubDate> <dc:creator>Joshua Townsend</dc:creator> <category><![CDATA[VMware]]></category> <category><![CDATA[VMware How To]]></category> <category><![CDATA[NetApp]]></category> <category><![CDATA[NFS]]></category> <category><![CDATA[sizing]]></category><guid
isPermaLink="false">http://vmtoday.com/?p=11</guid> <description><![CDATA[I am often asked about sizing storage vis-à-vis how much free space within a guest VMDK eats into the overall size of the volume.  The answer can be drastically whether we are dealing with thick-provisioned VMDK&#8217;s on FC or iSCSI LUN&#8217;s, or thin provisioned VMDK&#8217;s on NFS volumes.  The amount of free space present in [...]]]></description> <content:encoded><![CDATA[<p></p><p>I am often asked about sizing storage vis-à-vis how much free space within a guest VMDK eats into the overall size of the volume.  The answer can be drastically whether we are dealing with thick-provisioned VMDK&#8217;s on FC or iSCSI LUN&#8217;s, or thin provisioned VMDK&#8217;s on NFS volumes.  The amount of free space present in guest VMDK&#8217;s also comes into effect when calculating the impact of dedupe on the volume.  Add in some flexible volumes on NetApp storage and the amount of provisioned storage in the design changes significantly.</p><p>There are several methods of obtaining the amount of free space in a guest OS, from third party systems management tools (some are vendor or OS specific) to custom scripting (some VB for your Windows hosts, etc.).  VirtualCenter also knows how much free space is within each guest VMDK, but the information is not readily displayed.</p><p>The first method of getting guest free space is using the VMware VI Toolkit for Windows.  A simple statement like what I show below will pull the info for you (<a
title="storage report listing capacity and freespace for each drive on each vm" href="http://communities.vmware.com/message/1046360" target="_blank">see Hal Rottenberg&#8217;s post on the VMware Communities Forum</a>):</p><blockquote><p><span
style="color: #808080;">PS &gt; $hdCapacity = @{ N = &#8220;Capacity (bytes)&#8221;; E = { $_.Guest.Disks | % { $_.Capacity } } }<br
/> PS &gt; $hdFreeSpace = @{ N = &#8220;FreeSpace (bytes)&#8221;; E = { $_.Guest.Disks | % { $_.FreeSpace } } }<br
/> PS &gt; Get-VM | select Name, $hdCapacity, $hdFreeSpace</span></p></blockquote><p>You can re-write the command into a single line and change the output to show Percentage Free space, for example.  The following came from <a
title="http://communities.vmware.com/message/1046360" href="http://communities.vmware.com/message/1046360" target="_blank">http://communities.vmware.com/message/1046360</a>.</p><blockquote><p><span
style="color: #808080;">Get-VM | Where { $_.PowerState -eq &#8220;PoweredOn&#8221; } | Get-VMGuest | Select VmName -ExpandProperty Disks | Select VmName, Path, @{ N=&#8221;PercFree&#8221;; E={ [math]::Round( (100 * ( $_.FreeSpace / $_.Capacity ) ),0 ) } } | Sort PercFree</span></p></blockquote><p>These examples are well and good, but there are a couple of catches &#8211; The guest must be powered up and VMware Tools must be installed and running inside each VM you want to pull statistics from.<br
/> Many people do not know that the guest disk capacity and free space statistics are also captured in the VirtualCenter database and is available for VM&#8217;s in any power state (On, Off, or Suspended), so long as VMware Tools has been installed and run at least once in the VM.  A SQL simple query will return the data too you (this could be more simple &#8211; I was pulling some additional statistics for a project I am working on):</p><blockquote><p><span
style="color: #808080;"><br
/> SELECT VPX_GUEST_DISK.VM_ID, VPX_GUEST_DISK.PATH, VPX_GUEST_DISK.CAPACITY, CONVERT(bigint, VPX_GUEST_DISK.CAPACITY) / 1048576 AS &#8216;Capacity MB&#8217;, VPX_GUEST_DISK.FREE_SPACE, CONVERT(bigint, VPX_GUEST_DISK.FREE_SPACE) / 1048576 AS &#8216;Free Space MB&#8217;,VPX_HOST.ID, VPX_HOST.DATACENTER_ID, VPX_HOST.DNS_NAME, VPX_VM.ID, VPX_VM.DATACENTER_ID, VPX_VM.FILE_NAME, VPX_VM.LOCAL_FILE_NAME, VPX_VM.POWER_STATE, VPX_VM.GUEST_OS, VPX_VM.GUEST_STATE, VPX_VM.MEM_SIZE_MB, VPX_VM.NUM_DISK, VPX_VM.DNS_NAME, VPX_VM.IS_TEMPLATE, VPX_VM.HOST_ID<br
/> FROM VPX_GUEST_DISK VPX_GUEST_DISK, VPX_HOST VPX_HOST, VPX_VM VPX_VM<br
/> WHERE VPX_VM.ID = VPX_GUEST_DISK.VM_ID AND VPX_HOST.ID = VPX_VM.HOST_ID</span></p></blockquote><p>Of course, you can always combine the power of PowerShell and the raw SQL data to create formatted output.  <a
title="Frank Hagen's Blog" href="http://FWHagen.wordpress.com" target="_blank">Frank Hagen</a> displays a method of obtaining SQL data through a PowerShell script and dumping the data to Excel for further manipulation on his blog.  I modified a few lines of Frank&#8217;s code for my purposes:</p><blockquote><p><span
style="color: #808080;">################################################<br
/> #   QuerySQL.ps1                                   # Frank W Hagen &#8211; 2008/07/15<br
/> #                                                  #   FWHagen.wordpress.com<br
/> #     Powershell script to query a SQL database    #   fwhagen.blog@gmail.com<br
/> #      and write the output to an Excel file<br
/> #<br
/> #     Usage:<br
/> #     * Create a SQL query file by putting a valid SQL query in a text file in<br
/> #       the subdirectory specified in $SQLQueryPath named &lt;$TaskName&gt;.sql<br
/> #     * Set configuration variables in config section below<br
/> #     * Run at command line:  powershell -nologo .\QuerySQL.ps1<br
/> #         OR right-click this script and Open With -&gt; Powershell.EXE<br
/> #<br
/> #     If you get a security warning running the script, see the following post:<br
/> #     http://fwhagen.wordpress.com/2007/10/29/running-local-powershell-scripts/<br
/> ########################################################</span></p><p><span
style="color: #808080;"># Function used for binding to Excel<br
/> function Invoke([object]$m, [string]$method, $parameters)<br
/> {  $m.PSBase.GetType().InvokeMember($method, [Reflection.BindingFlags]::InvokeMethod, $null, $m, $parameters, [System.Globalization.CultureInfo]&#8220;en-US&#8221;)  } </span></p><p><span
style="color: #808080;">############################################<br
/> ### Configuration information for specific query #####<br
/> $TaskName = &#8220;VIGuestDiskFree&#8221;     # Title and name of query file</span></p><p><span
style="color: #808080;">#######################################################<br
/> ### UPDATE THE FOLLOWING LINES FOR YOUR ENVIRONMENT ###<br
/> $SqlServer = &#8220;&#8221;;	# SQL Server hosting VirtualCenter Database (include \instance name if not using Default)<br
/> $SqlCatalog = &#8220;&#8221;;	# Virtual Center Database name<br
/> $SQLUserID = &#8220;&#8221;;	# SQL Server User ID if not using Integrated Security see lines 69 and 70<br
/> $SQLPassword = &#8220;&#8221;;	# SQL Server User Password if not using Integrated Security see lines 69 and 70<br
/> ### END OF CUSTOMER UPDATABLE FIELDS ###<br
/> #######################################################<br
/> $WriteOutXML = $False<br
/> $WriteOutCSV = $False<br
/> $WriteOutXLS = $True<br
/> #<br
/> # Environment Configuration<br
/> $TaskPath = &#8220;C:\Scripts\&#8221;          # Root Directory for creating reports<br
/> $SQLQueryPath = &#8220;SQLQueries\&#8221;               # Subdirectory for finding the queryfile<br
/> ######################################################</span></p><p><span
style="color: #808080;"># Timestamp the output folder and files using ISOdate<br
/> $OutPath = ($TaskPath + (Get-Date -Format yyyyMMdd) + &#8220;-&#8221; + $TaskName + &#8220;\&#8221;)<br
/> $OutFileName = ( (Get-Date -Format yyyyMMdd) + &#8220;-&#8221; + $TaskName )</span></p><p><span
style="color: #808080;"># Create the output folder                                      #TODO: Fix Call to eliminate verbose results from system<br
/> if (!$(test-path ($OutPath)))<br
/> {<br
/> New-Item -itemType directory -Name ((Get-Date -Format yyyyMMdd) + &#8220;-&#8221; + $TaskName) &gt; $null</span></p><p><span
style="color: #808080;"> if ($(test-path ($OutPath)))<br
/> {<br
/> Write-Host ($OutPath + &#8221; Created&#8221;) -ForegroundColor &#8220;darkgreen&#8221;<br
/> }<br
/> else<br
/> {<br
/> Write-Host ($OutPath + &#8221; FAILED&#8221;) -ForegroundColor &#8220;red&#8221;<br
/> }<br
/> }</span></p><p><span
style="color: #808080;"># Get the T-SQL Query from .SQL file<br
/> $SqlQuery = Get-Content ($TaskPath + $SQLQueryPath + $TaskName + &#8220;.sql&#8221;)<br
/> Write-Host (&#8220;Executing Queryfile: &#8221; + ($TaskName + &#8220;.sql&#8221;) + &#8221; &#8220;) -ForegroundColor &#8220;darkgreen&#8221;<br
/> #Write-Host ($SqlQuery) -ForegroundColor &#8220;gray&#8221;</span></p><p><span
style="color: #808080;"># Setup SQL Connection (using Integrated Security (your workstation login).  Use standard connection string format for other)<br
/> $SqlConnection = New-Object System.Data.SqlClient.SqlConnection<br
/> #$SqlConnection.ConnectionString = &#8220;Server = $SqlServer; Database = $SqlCatalog; Integrated Security = True&#8221;<br
/> $SqlConnection.ConnectionString = &#8220;Server = $SqlServer; Database = $SqlCatalog; Integrated Security = False; User ID = $SQLUserID; Password = $SQLPassword;&#8221;</span></p><p><span
style="color: #808080;"># Setup SQL Command<br
/> $SqlCmd = New-Object System.Data.SqlClient.SqlCommand<br
/> $SqlCmd.CommandText = $SqlQuery<br
/> $SqlCmd.Connection = $SqlConnection</span></p><p><span
style="color: #808080;"># Setup .NET SQLAdapter to execute and fill .NET Dataset<br
/> $SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter<br
/> $SqlAdapter.SelectCommand = $SqlCmd<br
/> $DataSet = New-Object System.Data.DataSet<br
/> $DataTable = New-Object System.Data.DataTable</span></p><p><span
style="color: #808080;"># Execute and Get Row Count<br
/> $nRecs = $SqlAdapter.Fill($DataSet)</span></p><p><span
style="color: #808080;">Write-Host ($nRecs.ToString() + &#8221; Records retrieved.&#8221;) -ForegroundColor &#8220;Blue&#8221;<br
/> $SqlConnection.Close();</span></p><p><span
style="color: #808080;">if ($nRecs -gt 0)<br
/> {<br
/> # Make copy of successful query in output directory for traceability<br
/> if ($(test-path ($OutPath + $OutFileName + &#8220;.sql&#8221;)))<br
/> {<br
/> del ($OutPath + $OutFileName + &#8220;.sql&#8221;)<br
/> }<br
/> Copy-Item ($TaskPath + $SQLQueryPath + $TaskName + &#8220;.sql&#8221;) -destination ($OutPath + $OutFileName + &#8220;.sql&#8221;)</span></p><p><span
style="color: #808080;"> # Very simple to export XML<br
/> if($WriteOutXML)<br
/> {<br
/> Write-Host &#8220;Creating XML File&#8230;&#8221; -ForegroundColor &#8220;darkgreen&#8221;<br
/> if ($(test-path ($OutPath + $OutFileName + &#8220;.xml&#8221;)))<br
/> {<br
/> del ($OutPath + $OutFileName + &#8220;.xml&#8221;)<br
/> }</span></p><p><span
style="color: #808080;"> $DataSet.Tables[0].WriteXML($OutPath + $OutFileName + &#8220;.xml&#8221;);<br
/> }</span></p><p><span
style="color: #808080;"> # Very simple to export CSV<br
/> if($WriteOutCSV)<br
/> {<br
/> Write-Host &#8220;Creating CSV File&#8230;&#8221; -ForegroundColor &#8220;darkgreen&#8221;<br
/> if ($(test-path ($OutPath + $OutFileName + &#8220;.csv&#8221;)))<br
/> {<br
/> del ($OutPath + $OutFileName + &#8220;.csv&#8221;)<br
/> }</span></p><p><span
style="color: #808080;"> $DataSet.Tables[0] | Export-Csv ($OutPath + $OutFileName + &#8220;.csv&#8221;)<br
/> }</span></p><p><span
style="color: #808080;"> # Very hard to export XSL &#8211; This method writes the data to an object array and pastes the array directly into Excel  (Thanks go to a few sources on the Internet for this method)<br
/> if($WriteOutXLS)<br
/> {<br
/> Write-Host &#8220;Creating Excel File&#8230;&#8221; -ForegroundColor &#8220;darkgreen&#8221;<br
/> if ($(test-path ($OutPath + $OutFileName + &#8220;.xls&#8221;)))<br
/> {<br
/> del ($OutPath + $OutFileName + &#8220;.xls&#8221;)<br
/> }</span></p><p><span
style="color: #808080;"> $sheetIndex = 0;<br
/> $oExcel = New-Object -COM Excel.Application<br
/> $oExcel.Visible = $false<br
/> $oBooks = $oExcel.Workbooks<br
/> $oCulture= [System.Globalization.CultureInfo]&#8220;en-US&#8221;<br
/> $oBook=$oBooks.psbase.gettype().InvokeMember(&#8220;Add&#8221;,[Reflection.BindingFlags]::InvokeMethod,$null,$oBooks,$null,$oCulture)<br
/> #$oSheet = $oBook.Worksheets.Item(1)</span></p><p><span
style="color: #808080;"> $DataTable = $DataSet.Tables[0];<br
/> $nDr = $DataTable.Rows.Count + 1<br
/> $nDc = $DataTable.Columns.Count + 1</span></p><p><span
style="color: #808080;"> # Create the object array<br
/> $rawData = new-object &#8216;object[,]&#8216; $nDr,$nDc </span></p><p><span
style="color: #808080;"> # Write the field names in the first row<br
/> for ($col = 0; $col -lt $DataTable.Columns.Count; $col++)<br
/> {<br
/> $rawData[0, $col] = $DataTable.Columns[$col].ColumnName;<br
/> }</span></p><p><span
style="color: #808080;"> # Copy the dataset to the object array<br
/> for ($col = 0; $col -lt $DataTable.Columns.Count; $col++)<br
/> {<br
/> for ($row = 0; $row -lt $DataTable.Rows.Count; $row++)<br
/> {<br
/> $rawData[($row + 1), $col] = $DataTable.Rows[$row][$col];<br
/> }<br
/> }</span></p><p><span
style="color: #808080;"> # Calculate the final column letter<br
/> $finalColLetter = &#8220;&#8221;;<br
/> $colCharset = &#8220;ABCDEFGHIJKLMNOPQRSTUVWXYZ&#8221;;<br
/> $colCharsetLen = $colCharset.Length;<br
/> if ($DataTable.Columns.Count -gt $colCharsetLen)<br
/> {<br
/> $finalColLetter = $colCharset.Substring((($DataTable.Columns.Count &#8211; 1) / ($colCharsetLen &#8211; 1)), 1);<br
/> }<br
/> $finalColLetter += $colCharset.Substring(($DataTable.Columns.Count &#8211; 1) % $colCharsetLen, 1);</span></p><p><span
style="color: #808080;"> ### Export it all to Excel #####<br
/> Write-Host &#8220;Writing to Excel&#8230;&#8221; -ForegroundColor &#8220;darkgreen&#8221;</span></p><p><span
style="color: #808080;"> # Create a new Sheet<br
/> $excelSheet = $oBook.Worksheets.Item(1)</span></p><p><span
style="color: #808080;"> #$excelSheet.name = $DataTable.TableName;               #TODO: Be nice to figure out how to make this work (not critical)</span></p><p><span
style="color: #808080;"> # Create the entire range on the worksheet and dump the data into it<br
/> $excelRange = &#8220;A1:&#8221; + $finalColLetter + &#8220;&#8221; + ($DataTable.Rows.Count + 1)<br
/> $excelSheet.Range($excelRange).FormulaLocal = $rawData;</span></p><p><span
style="color: #808080;"> # Mark the first row as BOLD                            #TODO: Be nice to figure out how to make this work (not critical)<br
/> #$excelSheet.Rows[1].Font.Bold = $True;<br
/> #$excelSheet.Cells.Item(1,1).Font.Bold = $True;</span></p><p><span
style="color: #808080;"> # Save the Excel file and we&#8217;re done<br
/> Invoke $oBook SaveAs ($OutPath + $OutFileName + &#8220;.xls&#8221;) &gt; $null<br
/> Invoke $oBook Close 0 &gt;$null<br
/> $oExcel.Quit()<br
/> }<br
/> }</span></p><p><span
style="color: #808080;">Write-Host (&#8220;Complete&#8221;)</span></p></blockquote><p>I dropped the PowerShell code into a file named VIGuestDiskFree.ps1 in C:\Scripts on my Vista laptop, and the SQL query from earlier in this post to c:\scripts\sqlqueries\VIGuestDiskFree.sql.  Simply run the PowerShell script from a PowerShell command line.  The Excel output file  will be created in a date-stamped folder in C:\Scripts.  Once you have this data you can go about the business of formatting the data as an Excel Table and summing the Free Space column to find out your storage savings with thin provisioning and other storage efficiency technologies.  I have attached a .zip (<a
href="http://cloudfront.vmtoday.com/wp-content/uploads/2008/12/scripts.zip">VIGuestFreeScripts</a>) containing the scripts in this post (formatting is a bit off in WordPress).</p><p>How do you report on your storage utilization and storage efficiency efforts?  Post a comment to share your methods!</p><div
class="shr-publisher-11"></div><div
style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div
class='shareaholic-like-buttonset' style='float:none;height:30px;'><a
class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fvmtoday.com%2F2008%2F12%2Fobtaining-vmware-guest-disk-free-space-for-nfs-sizing%2F' data-shr_title='Obtaining+VMware+Guest+Disk+Free+Space+for+NFS+Sizing'></a><a
class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fvmtoday.com%2F2008%2F12%2Fobtaining-vmware-guest-disk-free-space-for-nfs-sizing%2F'></a><a
class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fvmtoday.com%2F2008%2F12%2Fobtaining-vmware-guest-disk-free-space-for-nfs-sizing%2F' data-shr_title='Obtaining+VMware+Guest+Disk+Free+Space+for+NFS+Sizing'></a></div><div
style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div>]]></content:encoded> <wfw:commentRss>http://vmtoday.com/2008/12/obtaining-vmware-guest-disk-free-space-for-nfs-sizing/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 22/58 queries in 0.420 seconds using disk: basic
Object Caching 1319/1374 objects using disk: basic
Content Delivery Network via Amazon Web Services: CloudFront: cloudfront.vmtoday.com

Served from: vmtoday.com @ 2012-02-05 06:15:57 -->
