<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: PowerCLI: Stats One-liner</title>
	<atom:link href="http://www.virtu-al.net/2009/07/01/powercli-stats-one-liner/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.virtu-al.net/2009/07/01/powercli-stats-one-liner/</link>
	<description>Virtually everything is poshable</description>
	<lastBuildDate>Thu, 09 Feb 2012 21:00:13 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: ap</title>
		<link>http://www.virtu-al.net/2009/07/01/powercli-stats-one-liner/#comment-11325</link>
		<dc:creator>ap</dc:creator>
		<pubDate>Wed, 30 Nov 2011 06:00:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=741#comment-11325</guid>
		<description>Can i get the same code for java or code for listing all the VM&#039;s on a ESX host using Java and VI-sdk</description>
		<content:encoded><![CDATA[<p>Can i get the same code for java or code for listing all the VM&#8217;s on a ESX host using Java and VI-sdk</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aureus</title>
		<link>http://www.virtu-al.net/2009/07/01/powercli-stats-one-liner/#comment-6618</link>
		<dc:creator>Aureus</dc:creator>
		<pubDate>Fri, 03 Jun 2011 03:46:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=741#comment-6618</guid>
		<description>I know this is an old script, but I have a question.

Why do you have &quot;-MaxSamples (12) &quot; in the script.  Wouldn&#039;t that limit the script to only 1 hour of data, rather then the entire day?</description>
		<content:encoded><![CDATA[<p>I know this is an old script, but I have a question.</p>
<p>Why do you have &#8220;-MaxSamples (12) &#8221; in the script.  Wouldn&#8217;t that limit the script to only 1 hour of data, rather then the entire day?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kenny</title>
		<link>http://www.virtu-al.net/2009/07/01/powercli-stats-one-liner/#comment-2740</link>
		<dc:creator>kenny</dc:creator>
		<pubDate>Wed, 22 Sep 2010 22:46:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=741#comment-2740</guid>
		<description>Al - how can i have it so i can run the script daily and it not erase the results from the day before?</description>
		<content:encoded><![CDATA[<p>Al &#8211; how can i have it so i can run the script daily and it not erase the results from the day before?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://www.virtu-al.net/2009/07/01/powercli-stats-one-liner/#comment-1171</link>
		<dc:creator>James</dc:creator>
		<pubDate>Thu, 15 Oct 2009 14:17:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=741#comment-1171</guid>
		<description>&lt;a href=&quot;#comment-1168&quot; rel=&quot;nofollow&quot;&gt;@Marc  &lt;/a&gt; 

That would extend the timeframe but wouldn&#039;t you want more samples processed? 
I may be entirely wrong but -MaxSamples (12) over -720 hours wouldnt be very granular to average over.</description>
		<content:encoded><![CDATA[<p><a href="#comment-1168" rel="nofollow">@Marc  </a> </p>
<p>That would extend the timeframe but wouldn&#8217;t you want more samples processed?<br />
I may be entirely wrong but -MaxSamples (12) over -720 hours wouldnt be very granular to average over.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kenneth</title>
		<link>http://www.virtu-al.net/2009/07/01/powercli-stats-one-liner/#comment-1169</link>
		<dc:creator>Kenneth</dc:creator>
		<pubDate>Wed, 14 Oct 2009 20:29:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=741#comment-1169</guid>
		<description>well technically it is possible to calculate 9am to 5pm, run the script at 5pm with addhours(-9) should give you what you are looking for! 
And run it again at 9am with addhours(-16) and you get the offhours load, might be interesting too !
Well this should work, unless ofcause I am wrong about the addhours variable :)</description>
		<content:encoded><![CDATA[<p>well technically it is possible to calculate 9am to 5pm, run the script at 5pm with addhours(-9) should give you what you are looking for!<br />
And run it again at 9am with addhours(-16) and you get the offhours load, might be interesting too !<br />
Well this should work, unless ofcause I am wrong about the addhours variable <img src='http://www.virtu-al.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marc</title>
		<link>http://www.virtu-al.net/2009/07/01/powercli-stats-one-liner/#comment-1168</link>
		<dc:creator>Marc</dc:creator>
		<pubDate>Wed, 14 Oct 2009 19:20:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=741#comment-1168</guid>
		<description>Does this script calculate over 24hours?  If I wanted to calculate over 1 month would I have to use the following?

Get-VM &#124;Where {$_.PowerState -eq &quot;PoweredOn&quot;} &#124; 
Select Name,Host,NumCpu,MemoryMB, @{N=&quot;Cpu.UsageMhz.Average&quot;;E={[Math]::Round((($_ &#124;Get-Stat -Stat cpu.usagemhz.average -Start (Get-Date).AddHours(-720)-IntervalMins 5 -MaxSamples (12) &#124;Measure-Object Value -Average).Average),2)}}, @{N=&quot;Mem.Usage.Average&quot;;E={[Math]::Round((($_ &#124;Get-Stat -Stat mem.usage.average -Start (Get-Date).AddHours(-720)-IntervalMins 5 -MaxSamples (12) &#124;Measure-Object Value -Average).Average),2)}} &#124;Export-Csv c:\Temp\stats.csv</description>
		<content:encoded><![CDATA[<p>Does this script calculate over 24hours?  If I wanted to calculate over 1 month would I have to use the following?</p>
<p>Get-VM |Where {$_.PowerState -eq &#8220;PoweredOn&#8221;} |<br />
Select Name,Host,NumCpu,MemoryMB, @{N=&#8221;Cpu.UsageMhz.Average&#8221;;E={[Math]::Round((($_ |Get-Stat -Stat cpu.usagemhz.average -Start (Get-Date).AddHours(-720)-IntervalMins 5 -MaxSamples (12) |Measure-Object Value -Average).Average),2)}}, @{N=&#8221;Mem.Usage.Average&#8221;;E={[Math]::Round((($_ |Get-Stat -Stat mem.usage.average -Start (Get-Date).AddHours(-720)-IntervalMins 5 -MaxSamples (12) |Measure-Object Value -Average).Average),2)}} |Export-Csv c:\Temp\stats.csv</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Virtu-Al</title>
		<link>http://www.virtu-al.net/2009/07/01/powercli-stats-one-liner/#comment-744</link>
		<dc:creator>Virtu-Al</dc:creator>
		<pubDate>Fri, 31 Jul 2009 10:07:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=741#comment-744</guid>
		<description>&lt;a href=&quot;#comment-743&quot; rel=&quot;nofollow&quot;&gt;@Marc &lt;/a&gt; 
I&#039;m afraid that is not possible with the Get-Stat cmdlet itself, nor with the underlying QueryPerf (http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.PerformanceManager.html#queryStats) method from the SDK.

You could get all your statistical data and then use a Select-Object or an If-Then-Else construct on the Timestamp property to filter out the data you want.

Thanks @LucD - PowerCLI Community answer to a separate post: http://webmail.virtu-al.net/webmail-n/parse.php?redirect=http://communities.vmware.com/message/1325196%231325196</description>
		<content:encoded><![CDATA[<p><a href="#comment-743" rel="nofollow">@Marc </a><br />
I&#8217;m afraid that is not possible with the Get-Stat cmdlet itself, nor with the underlying QueryPerf (<a href="http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.PerformanceManager.html#queryStats" rel="nofollow">http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.PerformanceManager.html#queryStats</a>) method from the SDK.</p>
<p>You could get all your statistical data and then use a Select-Object or an If-Then-Else construct on the Timestamp property to filter out the data you want.</p>
<p>Thanks @LucD &#8211; PowerCLI Community answer to a separate post: <a href="http://webmail.virtu-al.net/webmail-n/parse.php?redirect=http://communities.vmware.com/message/1325196%231325196" rel="nofollow">http://webmail.virtu-al.net/webmail-n/parse.php?redirect=http://communities.vmware.com/message/1325196%231325196</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Virtu-Al</title>
		<link>http://www.virtu-al.net/2009/07/01/powercli-stats-one-liner/#comment-743</link>
		<dc:creator>Virtu-Al</dc:creator>
		<pubDate>Fri, 31 Jul 2009 10:03:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=741#comment-743</guid>
		<description>&lt;a href=&quot;#comment-681&quot; rel=&quot;nofollow&quot;&gt;@Mike &lt;/a&gt; 
Yes this is a percentage, you would obviously need constant monitoring to make that sort of judgement though to ensure you catch trend data.</description>
		<content:encoded><![CDATA[<p><a href="#comment-681" rel="nofollow">@Mike </a><br />
Yes this is a percentage, you would obviously need constant monitoring to make that sort of judgement though to ensure you catch trend data.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marc</title>
		<link>http://www.virtu-al.net/2009/07/01/powercli-stats-one-liner/#comment-733</link>
		<dc:creator>Marc</dc:creator>
		<pubDate>Wed, 29 Jul 2009 17:35:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=741#comment-733</guid>
		<description>Is there a way to calculate average usage during working hours?  Say 9am-5pm?  This is based on a 24 hour period and could potentially skew the numbers.  I would love to see this if it is possible.

Thanks,
Marc</description>
		<content:encoded><![CDATA[<p>Is there a way to calculate average usage during working hours?  Say 9am-5pm?  This is based on a 24 hour period and could potentially skew the numbers.  I would love to see this if it is possible.</p>
<p>Thanks,<br />
Marc</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.virtu-al.net/2009/07/01/powercli-stats-one-liner/#comment-681</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 22 Jul 2009 13:29:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.virtu-al.net/?p=741#comment-681</guid>
		<description>This is great. But I&#039;m not sure if I understand the Mem.Usage.Average, is the Average in percentage format? On your screenshot for an example VM tstFOG01 has 2048 of RAM and on an average is only utilizing 12.79. So if that’s a percentage it’s using under 300MB to round it up. So if that’s the case, the memory is over allocated. So would it be safe to say that 512mb should be enough? I have over 600 VM’s and couple admins that logon and make changes. I’m sure there are a lot of VM’s that are way overallocated when it comes to RAM and I been trying to find an easy way to figure this out.  We don’t really have a good tool to easily get the memory utilization. I been using VMware Consolidation by adding VM’s, it’s been working OK but it only gives me a 24hr view.</description>
		<content:encoded><![CDATA[<p>This is great. But I&#8217;m not sure if I understand the Mem.Usage.Average, is the Average in percentage format? On your screenshot for an example VM tstFOG01 has 2048 of RAM and on an average is only utilizing 12.79. So if that’s a percentage it’s using under 300MB to round it up. So if that’s the case, the memory is over allocated. So would it be safe to say that 512mb should be enough? I have over 600 VM’s and couple admins that logon and make changes. I’m sure there are a lot of VM’s that are way overallocated when it comes to RAM and I been trying to find an easy way to figure this out.  We don’t really have a good tool to easily get the memory utilization. I been using VMware Consolidation by adding VM’s, it’s been working OK but it only gives me a 24hr view.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

