<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Gathering virtual machine IOPS statistics by datastore in VMware PowerCLI Documents</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/ta-p/2787051</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Our friendly storage admin sometimes calls me up or sends alert my way from the array when the virtual environment is generating too many IOPS on a particular parity group. From his side, this could be happening on any of a number of LUNs that have been presented to our hosts, and he has no way of telling me what virtual machines could be causing the trouble.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Through the PowerCLI, I’ve scripted a way to check performance across the environment for the heavy hitters and report that info back. The script takes in an array of datastores, a vCenter Server FQDN, and a number of statistical samples to grab. It tracks down the physical hosts of the virtual machines that reside on those datastores and reports back the IOPS done (read &amp;amp; write) for each of those VMs over the interval specified.  The credentials it asks for are a local account on the ESX/ESXi hosts, NOT for vCenter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Originally posted on my blog: &lt;A href="http://virtualcurtis.wordpress.com)" target="test_blank"&gt;http://virtualcurtis.wordpress.com)&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Sep 2010 01:41:54 GMT</pubDate>
    <dc:creator>lockenkeyster</dc:creator>
    <dc:date>2010-09-10T01:41:54Z</dc:date>
    <item>
      <title>Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/ta-p/2787051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Our friendly storage admin sometimes calls me up or sends alert my way from the array when the virtual environment is generating too many IOPS on a particular parity group. From his side, this could be happening on any of a number of LUNs that have been presented to our hosts, and he has no way of telling me what virtual machines could be causing the trouble.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Through the PowerCLI, I’ve scripted a way to check performance across the environment for the heavy hitters and report that info back. The script takes in an array of datastores, a vCenter Server FQDN, and a number of statistical samples to grab. It tracks down the physical hosts of the virtual machines that reside on those datastores and reports back the IOPS done (read &amp;amp; write) for each of those VMs over the interval specified.  The credentials it asks for are a local account on the ESX/ESXi hosts, NOT for vCenter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Originally posted on my blog: &lt;A href="http://virtualcurtis.wordpress.com)" target="test_blank"&gt;http://virtualcurtis.wordpress.com)&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Sep 2010 01:41:54 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/ta-p/2787051</guid>
      <dc:creator>lockenkeyster</dc:creator>
      <dc:date>2010-09-10T01:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787052#M191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;____________&lt;/P&gt;&lt;P&gt;Blog: &lt;A href="http://lucd.info"&gt;LucD notes&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Twitter: &lt;A href="http://twitter.com/lucd22"&gt;lucd22&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Sep 2010 11:15:56 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787052#M191</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2010-09-10T11:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787053#M192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Indeed.  Nice script.  One caveat is that stat tracking must be @ level 3 in vCenter for the disk.numberWrite.summation and disk.numberRead.summation statistics to show up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris Nakagaki (Zsoldier)&lt;/P&gt;&lt;P&gt;&lt;A href="http://tech.zsoldier.com" target="test_blank"&gt;http://tech.zsoldier.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Sep 2010 19:22:07 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787053#M192</guid>
      <dc:creator>Zsoldier</dc:creator>
      <dc:date>2010-09-13T19:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787054#M193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Zsoldier: Yeah, that's why I decided to get the stats from the hosts themselves.  Would be a bit more streamlined if stats were up to level 3 across the board and everything happened through vCenter, but one of our environments is still at level 2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Sep 2010 20:14:56 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787054#M193</guid>
      <dc:creator>lockenkeyster</dc:creator>
      <dc:date>2010-09-13T20:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787055#M194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way to specify multiple datastores or multiple hosts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Sep 2010 16:12:15 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787055#M194</guid>
      <dc:creator>burdweiser</dc:creator>
      <dc:date>2010-09-29T16:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787056#M195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The array that you pass to the -datastores parameter can have multiple datastores in it.  For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GatherIOPS.ps1 -server myvcenterserver.mydns.com -datastores @("DS01","DS03","DS25") -numsamples 90&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, the script will only work against one vCenter instance (but gathers data from all ESX hosts managed by that instance).  If there is a need to hit multiple vCenter Servers I can modify it to take this in as an array as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Sep 2010 16:43:02 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787056#M195</guid>
      <dc:creator>lockenkeyster</dc:creator>
      <dc:date>2010-09-29T16:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787057#M196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great script! Thanks for this!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question: is there any way to supress the certificate errors that I'm receiving? (Sample below)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WARNING: There were one or more problems with the server certificate:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The X509 chain could not be built up to the root certificate.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The certificate's CN name does not match the passed value.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 14:43:07 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787057#M196</guid>
      <dc:creator>godbucket</dc:creator>
      <dc:date>2010-10-19T14:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787058#M197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry to be a nuisance, but also is there anyway to output the IOP's in whole numbers (ie. take off everything after the decimals?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 15:13:49 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787058#M197</guid>
      <dc:creator>godbucket</dc:creator>
      <dc:date>2010-10-19T15:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787059#M198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;godbucket -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've uploaded a new version of the script that ignores the cert alerts.  Also, if you want rounded numbers the easiest way would be to replace the last line in the GetAvgStat function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;return $totalIOPS/$samples/20&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;return &lt;A href="https://communities.vmware.com/int"&gt;&lt;/A&gt; ($totalIOPS/$samples/20)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 13:15:57 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787059#M198</guid>
      <dc:creator>lockenkeyster</dc:creator>
      <dc:date>2010-10-21T13:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787060#M199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cool, thanks for supressing the cert alerts! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when I try the GetAvgStat replacement function you mentioned above, I get the following error:&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;The term 'int' is not recognized as the name of a cmdlet, function, script file&lt;/P&gt;&lt;P&gt;, or operable program. Check the spelling of the name, or if a path was include&lt;/P&gt;&lt;P&gt;d, verify that the path is correct and try again.&lt;/P&gt;&lt;P&gt;At C:\Users\Tsmith\Desktop\GatherIOPS.ps1:78 char:12&lt;/P&gt;&lt;P&gt;+     return int &amp;lt;&amp;lt;&amp;lt;&amp;lt;  ($totalIOPS/$samples/20)&lt;/P&gt;&lt;P&gt;    + CategoryInfo          : ObjectNotFound: (int:String) [], CommandNotFound&lt;/P&gt;&lt;P&gt;   Exception&lt;/P&gt;&lt;P&gt;    + FullyQualifiedErrorId : CommandNotFoundException&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;Please advise me on what to do, and thank you so much for your help!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 13:44:01 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787060#M199</guid>
      <dc:creator>godbucket</dc:creator>
      <dc:date>2010-10-21T13:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787061#M200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, looks like I need to learn how to format for these discussion boards... there should be brackets "[ ]" around "int"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 13:51:32 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787061#M200</guid>
      <dc:creator>lockenkeyster</dc:creator>
      <dc:date>2010-10-21T13:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787062#M201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I went ahead and added the rounding to version 3 of the script after I realized that I don't really care that much if a single VM is doing .3 read IOPS.  &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.vmware.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 13:57:44 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787062#M201</guid>
      <dc:creator>lockenkeyster</dc:creator>
      <dc:date>2010-10-21T13:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787063#M202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;lol yeah, 0.2227262738 IOPS is hard to explain in reports to management.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for your script and your help. I appreciate it big time!!!!  &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.vmware.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 15:08:16 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787063#M202</guid>
      <dc:creator>godbucket</dc:creator>
      <dc:date>2010-10-21T15:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787064#M203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi really nice script &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.vmware.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would be cool if you could add " | where {$_.PowerState -eq "PoweredOn"} " after $myVMs = Get-VM -Datastore $myDatastore -server $server&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we dont get errors on powered off vms.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, is there any way to do the same with the datastores ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 12:12:00 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787064#M203</guid>
      <dc:creator>mry</dc:creator>
      <dc:date>2010-11-09T12:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787065#M204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;and if you want to get all the datastores you can use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GatherIOPS.ps1 -server myvcenterserver.mydns.com -datastores @(Get-Datastore) -numsamples 90&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 12:31:31 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787065#M204</guid>
      <dc:creator>mry</dc:creator>
      <dc:date>2010-11-09T12:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787066#M205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE level="1"&gt;&lt;P&gt;Would be cool if you could add " | where {$_.PowerState -eq "PoweredOn"} " &lt;/P&gt;&lt;P&gt;after $myVMs = Get-VM -Datastore $myDatastore -server $server&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we dont get errors on powered off vms.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Added!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE level="1"&gt;&lt;P&gt;By the way, is there any way to do the same with the datastores ?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure I know what you mean here - you just want datastores with no running VMs to be excluded from the results?  If so, yeah, that should be easy enough.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 14:46:53 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787066#M205</guid>
      <dc:creator>lockenkeyster</dc:creator>
      <dc:date>2010-11-17T14:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787067#M206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What i mean is; Is it possible to get a list of IOPS per datastore(over a given time) insted for per vm(as in the script)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Nov 2010 12:10:29 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787067#M206</guid>
      <dc:creator>mry</dc:creator>
      <dc:date>2010-11-22T12:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787068#M207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&amp;nbsp; I am total neebie to running scripts.&amp;nbsp; When I try and run your script I get several errors. I do get prompted for the ESX host account and password but which host is it talking about.&amp;nbsp; Our hosts have several different passwords. Should we be logging in as root?&amp;nbsp; Can I select specific hosts?&amp;nbsp; Here are the errors I receive&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Connect-VIServer : The argument cannot be null or empty.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:44 char:17&lt;BR /&gt;+ Connect-VIServer&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $server -NotDefault -WarningAction SilentlyContinue |&lt;BR /&gt;Out-Null&lt;BR /&gt;Get-Datastore : The argument cannot be null or empty.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:86 char:37&lt;BR /&gt;+&amp;nbsp;&amp;nbsp; $myDatastore = Get-Datastore -Name&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $datastore -server $server&lt;BR /&gt;Get-VM : The argument cannot be null or empty.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:87 char:29&lt;BR /&gt;+&amp;nbsp;&amp;nbsp; $myVMs = Get-VM -Datastore&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $myDatastore -server $server | Where {$_.P&lt;BR /&gt;owerState -eq "PoweredOn"}&lt;BR /&gt;Connect-VIServer : The argument cannot be null or empty.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:58 char:26&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect-viserver -server&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $vmhost -credential $credentials -NotDefau&lt;BR /&gt;lt -WarningAction SilentlyContinue | Out-Null&lt;BR /&gt;Get-Datastore : The argument cannot be null or empty.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:61 char:34&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myDatastoreID = ((Get-Datastore&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $ds -server $vmhost) | Get-View).i&lt;BR /&gt;nfo.vmfs.extent[0].diskname&lt;BR /&gt;Get-VM : The argument cannot be null or empty.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:64 char:40&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rawVMStats = get-stat -entity&amp;nbsp;&amp;nbsp;&amp;nbsp; (get-vm&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $vm -server $vmhost) -sta&lt;BR /&gt;t $stat -maxSamples $samples&lt;BR /&gt;You cannot call a method on a null-valued expression.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:68 char:28&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($stat.instance.Equals( &amp;lt;&amp;lt;&amp;lt;&amp;lt; $myDatastoreID)) {&lt;BR /&gt;Attempted to divide by zero.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:78 char:27&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [int] ($totalIOPS/$ &amp;lt;&amp;lt;&amp;lt;&amp;lt; samples/20)&lt;BR /&gt;Connect-VIServer : The argument cannot be null or empty.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:58 char:26&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect-viserver -server&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $vmhost -credential $credentials -NotDefau&lt;BR /&gt;lt -WarningAction SilentlyContinue | Out-Null&lt;BR /&gt;Get-Datastore : The argument cannot be null or empty.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:61 char:34&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myDatastoreID = ((Get-Datastore&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $ds -server $vmhost) | Get-View).i&lt;BR /&gt;nfo.vmfs.extent[0].diskname&lt;BR /&gt;Get-VM : The argument cannot be null or empty.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:64 char:40&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rawVMStats = get-stat -entity&amp;nbsp;&amp;nbsp;&amp;nbsp; (get-vm&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $vm -server $vmhost) -sta&lt;BR /&gt;t $stat -maxSamples $samples&lt;BR /&gt;You cannot call a method on a null-valued expression.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:68 char:28&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($stat.instance.Equals( &amp;lt;&amp;lt;&amp;lt;&amp;lt; $myDatastoreID)) {&lt;BR /&gt;Attempted to divide by zero.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:78 char:27&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [int] ($totalIOPS/$ &amp;lt;&amp;lt;&amp;lt;&amp;lt; samples/20)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 14:43:40 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787068#M207</guid>
      <dc:creator>gtlscot</dc:creator>
      <dc:date>2011-11-08T14:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787069#M208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't have to be logged in as root (although that works if they share the same password). This should also work with AD credentials if your hosts are configured to accept that. If not, then you will need to create local accounts on each ESX/ESXi host for this purpose. I haven't played around with that setup, but these accounts would likely only need read-only rights on the hosts to get this working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2011 18:43:41 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787069#M208</guid>
      <dc:creator>lockenkeyster</dc:creator>
      <dc:date>2011-11-09T18:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering virtual machine IOPS statistics by datastore</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787070#M209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi, I have now got a bit furtther.&amp;nbsp; I created new accounts on nearly all of our hosts and the script begins to run but still generates errors but the script continues to run. However when the scripts completes it provides the names of the guests located in the LUN specified but does not provide any IOPs output.&amp;nbsp; Errors are below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myDatastoreID = ((Get-Datastore&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $ds -server $vmhost) | Get-View).i&lt;BR /&gt;nfo.vmfs.extent[0].diskname&lt;BR /&gt;Get-Datastore : 10/11/2011 09:50:58&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Datastore&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find any&lt;BR /&gt;of the servers specified by name.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:61 char:34&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myDatastoreID = ((Get-Datastore&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $ds -server $vmhost) | Get-View).i&lt;BR /&gt;nfo.vmfs.extent[0].diskname&lt;BR /&gt;Get-VM : 10/11/2011 09:50:58&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-VM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find VIServer with name&lt;BR /&gt; 'sose0003v.scotland.gov.uk'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:64 char:40&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rawVMStats = get-stat -entity&amp;nbsp;&amp;nbsp;&amp;nbsp; (get-vm&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $vm -server $vmhost) -sta&lt;BR /&gt;t $stat -maxSamples $samples&lt;BR /&gt;Get-VM : 10/11/2011 09:50:58&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-VM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find any of the servers&lt;BR /&gt; specified by name.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:64 char:40&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rawVMStats = get-stat -entity&amp;nbsp;&amp;nbsp;&amp;nbsp; (get-vm&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $vm -server $vmhost) -sta&lt;BR /&gt;t $stat -maxSamples $samples&lt;BR /&gt;You cannot call a method on a null-valued expression.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:68 char:28&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($stat.instance.Equals( &amp;lt;&amp;lt;&amp;lt;&amp;lt; $myDatastoreID)) {&lt;BR /&gt;The operation '[System.Int32] / [System.String]' is not defined.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:78 char:27&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [int] ($totalIOPS/$ &amp;lt;&amp;lt;&amp;lt;&amp;lt; samples/20)&lt;BR /&gt;Method invocation failed because [System.String] doesn't contain a method named&lt;BR /&gt; 'op_Division'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:94 char:50&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $data."Interval (minutes)" = ($numsamples*20)/6 &amp;lt;&amp;lt;&amp;lt;&amp;lt; 0&lt;BR /&gt;Connect-VIServer : A parameter cannot be found that matches parameter name 'War&lt;BR /&gt;ningAction'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:58 char:86&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect-viserver -server $vmhost -credential $credentials -NotDefault -Wa&lt;BR /&gt;rningAction&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; SilentlyContinue | Out-Null&lt;BR /&gt;Get-Datastore : 10/11/2011 09:50:59&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Datastore&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find VISe&lt;BR /&gt;rver with name 'sose0003v.scotland.gov.uk'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:61 char:34&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myDatastoreID = ((Get-Datastore&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $ds -server $vmhost) | Get-View).i&lt;BR /&gt;nfo.vmfs.extent[0].diskname&lt;BR /&gt;Get-Datastore : 10/11/2011 09:50:59&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Datastore&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find any&lt;BR /&gt;of the servers specified by name.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:61 char:34&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myDatastoreID = ((Get-Datastore&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $ds -server $vmhost) | Get-View).i&lt;BR /&gt;nfo.vmfs.extent[0].diskname&lt;BR /&gt;Get-VM : 10/11/2011 09:50:59&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-VM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find VIServer with name&lt;BR /&gt; 'sose0003v.scotland.gov.uk'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:64 char:40&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rawVMStats = get-stat -entity&amp;nbsp;&amp;nbsp;&amp;nbsp; (get-vm&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $vm -server $vmhost) -sta&lt;BR /&gt;t $stat -maxSamples $samples&lt;BR /&gt;Get-VM : 10/11/2011 09:50:59&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-VM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find any of the servers&lt;BR /&gt; specified by name.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:64 char:40&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rawVMStats = get-stat -entity&amp;nbsp;&amp;nbsp;&amp;nbsp; (get-vm&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $vm -server $vmhost) -sta&lt;BR /&gt;t $stat -maxSamples $samples&lt;BR /&gt;You cannot call a method on a null-valued expression.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:68 char:28&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($stat.instance.Equals( &amp;lt;&amp;lt;&amp;lt;&amp;lt; $myDatastoreID)) {&lt;BR /&gt;The operation '[System.Int32] / [System.String]' is not defined.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:78 char:27&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [int] ($totalIOPS/$ &amp;lt;&amp;lt;&amp;lt;&amp;lt; samples/20)&lt;BR /&gt;Connect-VIServer : A parameter cannot be found that matches parameter name 'War&lt;BR /&gt;ningAction'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:58 char:86&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect-viserver -server $vmhost -credential $credentials -NotDefault -Wa&lt;BR /&gt;rningAction&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; SilentlyContinue | Out-Null&lt;BR /&gt;Get-Datastore : 10/11/2011 09:50:59&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Datastore&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find VISe&lt;BR /&gt;rver with name 'sose0003v.scotland.gov.uk'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:61 char:34&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myDatastoreID = ((Get-Datastore&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $ds -server $vmhost) | Get-View).i&lt;BR /&gt;nfo.vmfs.extent[0].diskname&lt;BR /&gt;Get-Datastore : 10/11/2011 09:50:59&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Datastore&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find any&lt;BR /&gt;of the servers specified by name.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:61 char:34&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myDatastoreID = ((Get-Datastore&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $ds -server $vmhost) | Get-View).i&lt;BR /&gt;nfo.vmfs.extent[0].diskname&lt;BR /&gt;Get-VM : 10/11/2011 09:50:59&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-VM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find VIServer with name&lt;BR /&gt; 'sose0003v.scotland.gov.uk'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:64 char:40&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rawVMStats = get-stat -entity&amp;nbsp;&amp;nbsp;&amp;nbsp; (get-vm&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $vm -server $vmhost) -sta&lt;BR /&gt;t $stat -maxSamples $samples&lt;BR /&gt;Get-VM : 10/11/2011 09:50:59&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-VM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find any of the servers&lt;BR /&gt; specified by name.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:64 char:40&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rawVMStats = get-stat -entity&amp;nbsp;&amp;nbsp;&amp;nbsp; (get-vm&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $vm -server $vmhost) -sta&lt;BR /&gt;t $stat -maxSamples $samples&lt;BR /&gt;You cannot call a method on a null-valued expression.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:68 char:28&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($stat.instance.Equals( &amp;lt;&amp;lt;&amp;lt;&amp;lt; $myDatastoreID)) {&lt;BR /&gt;The operation '[System.Int32] / [System.String]' is not defined.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:78 char:27&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [int] ($totalIOPS/$ &amp;lt;&amp;lt;&amp;lt;&amp;lt; samples/20)&lt;BR /&gt;Method invocation failed because [System.String] doesn't contain a method named&lt;BR /&gt; 'op_Division'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:94 char:50&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $data."Interval (minutes)" = ($numsamples*20)/6 &amp;lt;&amp;lt;&amp;lt;&amp;lt; 0&lt;BR /&gt;Connect-VIServer : A parameter cannot be found that matches parameter name 'War&lt;BR /&gt;ningAction'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:58 char:86&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect-viserver -server $vmhost -credential $credentials -NotDefault -Wa&lt;BR /&gt;rningAction&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; SilentlyContinue | Out-Null&lt;BR /&gt;Get-Datastore : 10/11/2011 09:51:00&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Datastore&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find VISe&lt;BR /&gt;rver with name 'sose0003v.scotland.gov.uk'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:61 char:34&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myDatastoreID = ((Get-Datastore&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $ds -server $vmhost) | Get-View).i&lt;BR /&gt;nfo.vmfs.extent[0].diskname&lt;BR /&gt;Get-Datastore : 10/11/2011 09:51:00&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Datastore&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find any&lt;BR /&gt;of the servers specified by name.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:61 char:34&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myDatastoreID = ((Get-Datastore&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $ds -server $vmhost) | Get-View).i&lt;BR /&gt;nfo.vmfs.extent[0].diskname&lt;BR /&gt;Get-VM : 10/11/2011 09:51:00&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-VM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find VIServer with name&lt;BR /&gt; 'sose0003v.scotland.gov.uk'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:64 char:40&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rawVMStats = get-stat -entity&amp;nbsp;&amp;nbsp;&amp;nbsp; (get-vm&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $vm -server $vmhost) -sta&lt;BR /&gt;t $stat -maxSamples $samples&lt;BR /&gt;Get-VM : 10/11/2011 09:51:00&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-VM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find any of the servers&lt;BR /&gt; specified by name.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:64 char:40&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rawVMStats = get-stat -entity&amp;nbsp;&amp;nbsp;&amp;nbsp; (get-vm&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $vm -server $vmhost) -sta&lt;BR /&gt;t $stat -maxSamples $samples&lt;BR /&gt;You cannot call a method on a null-valued expression.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:68 char:28&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($stat.instance.Equals( &amp;lt;&amp;lt;&amp;lt;&amp;lt; $myDatastoreID)) {&lt;BR /&gt;The operation '[System.Int32] / [System.String]' is not defined.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:78 char:27&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [int] ($totalIOPS/$ &amp;lt;&amp;lt;&amp;lt;&amp;lt; samples/20)&lt;BR /&gt;Connect-VIServer : A parameter cannot be found that matches parameter name 'War&lt;BR /&gt;ningAction'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:58 char:86&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect-viserver -server $vmhost -credential $credentials -NotDefault -Wa&lt;BR /&gt;rningAction&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; SilentlyContinue | Out-Null&lt;BR /&gt;Get-Datastore : 10/11/2011 09:51:00&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Datastore&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find VISe&lt;BR /&gt;rver with name 'sose0003v.scotland.gov.uk'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:61 char:34&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myDatastoreID = ((Get-Datastore&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $ds -server $vmhost) | Get-View).i&lt;BR /&gt;nfo.vmfs.extent[0].diskname&lt;BR /&gt;Get-Datastore : 10/11/2011 09:51:00&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Datastore&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find any&lt;BR /&gt;of the servers specified by name.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:61 char:34&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myDatastoreID = ((Get-Datastore&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $ds -server $vmhost) | Get-View).i&lt;BR /&gt;nfo.vmfs.extent[0].diskname&lt;BR /&gt;Get-VM : 10/11/2011 09:51:00&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-VM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find VIServer with name&lt;BR /&gt; 'sose0003v.scotland.gov.uk'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:64 char:40&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rawVMStats = get-stat -entity&amp;nbsp;&amp;nbsp;&amp;nbsp; (get-vm&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $vm -server $vmhost) -sta&lt;BR /&gt;t $stat -maxSamples $samples&lt;BR /&gt;Get-VM : 10/11/2011 09:51:00&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-VM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find any of the servers&lt;BR /&gt; specified by name.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:64 char:40&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rawVMStats = get-stat -entity&amp;nbsp;&amp;nbsp;&amp;nbsp; (get-vm&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $vm -server $vmhost) -sta&lt;BR /&gt;t $stat -maxSamples $samples&lt;BR /&gt;You cannot call a method on a null-valued expression.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:68 char:28&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($stat.instance.Equals( &amp;lt;&amp;lt;&amp;lt;&amp;lt; $myDatastoreID)) {&lt;BR /&gt;The operation '[System.Int32] / [System.String]' is not defined.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:78 char:27&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [int] ($totalIOPS/$ &amp;lt;&amp;lt;&amp;lt;&amp;lt; samples/20)&lt;BR /&gt;Method invocation failed because [System.String] doesn't contain a method named&lt;BR /&gt; 'op_Division'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:94 char:50&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $data."Interval (minutes)" = ($numsamples*20)/6 &amp;lt;&amp;lt;&amp;lt;&amp;lt; 0&lt;BR /&gt;Connect-VIServer : A parameter cannot be found that matches parameter name 'War&lt;BR /&gt;ningAction'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:58 char:86&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect-viserver -server $vmhost -credential $credentials -NotDefault -Wa&lt;BR /&gt;rningAction&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; SilentlyContinue | Out-Null&lt;BR /&gt;Get-Datastore : 10/11/2011 09:51:01&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Datastore&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find VISe&lt;BR /&gt;rver with name 's0011dev.scotland.gov.uk'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:61 char:34&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myDatastoreID = ((Get-Datastore&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $ds -server $vmhost) | Get-View).i&lt;BR /&gt;nfo.vmfs.extent[0].diskname&lt;BR /&gt;Get-Datastore : 10/11/2011 09:51:01&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Datastore&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find any&lt;BR /&gt;of the servers specified by name.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:61 char:34&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myDatastoreID = ((Get-Datastore&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $ds -server $vmhost) | Get-View).i&lt;BR /&gt;nfo.vmfs.extent[0].diskname&lt;BR /&gt;Get-VM : 10/11/2011 09:51:01&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-VM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find VIServer with name&lt;BR /&gt; 's0011dev.scotland.gov.uk'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:64 char:40&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rawVMStats = get-stat -entity&amp;nbsp;&amp;nbsp;&amp;nbsp; (get-vm&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $vm -server $vmhost) -sta&lt;BR /&gt;t $stat -maxSamples $samples&lt;BR /&gt;Get-VM : 10/11/2011 09:51:01&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-VM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find any of the servers&lt;BR /&gt; specified by name.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:64 char:40&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rawVMStats = get-stat -entity&amp;nbsp;&amp;nbsp;&amp;nbsp; (get-vm&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $vm -server $vmhost) -sta&lt;BR /&gt;t $stat -maxSamples $samples&lt;BR /&gt;You cannot call a method on a null-valued expression.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:68 char:28&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($stat.instance.Equals( &amp;lt;&amp;lt;&amp;lt;&amp;lt; $myDatastoreID)) {&lt;BR /&gt;The operation '[System.Int32] / [System.String]' is not defined.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:78 char:27&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [int] ($totalIOPS/$ &amp;lt;&amp;lt;&amp;lt;&amp;lt; samples/20)&lt;BR /&gt;Connect-VIServer : A parameter cannot be found that matches parameter name 'War&lt;BR /&gt;ningAction'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:58 char:86&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect-viserver -server $vmhost -credential $credentials -NotDefault -Wa&lt;BR /&gt;rningAction&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; SilentlyContinue | Out-Null&lt;BR /&gt;Get-Datastore : 10/11/2011 09:51:01&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Datastore&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find VISe&lt;BR /&gt;rver with name 's0011dev.scotland.gov.uk'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:61 char:34&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myDatastoreID = ((Get-Datastore&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $ds -server $vmhost) | Get-View).i&lt;BR /&gt;nfo.vmfs.extent[0].diskname&lt;BR /&gt;Get-Datastore : 10/11/2011 09:51:01&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Datastore&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find any&lt;BR /&gt;of the servers specified by name.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:61 char:34&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myDatastoreID = ((Get-Datastore&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $ds -server $vmhost) | Get-View).i&lt;BR /&gt;nfo.vmfs.extent[0].diskname&lt;BR /&gt;Get-VM : 10/11/2011 09:51:01&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-VM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find VIServer with name&lt;BR /&gt; 's0011dev.scotland.gov.uk'.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:64 char:40&lt;BR /&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $rawVMStats = get-stat -entity&amp;nbsp;&amp;nbsp;&amp;nbsp; (get-vm&amp;nbsp; &amp;lt;&amp;lt;&amp;lt;&amp;lt; $vm -server $vmhost) -sta&lt;BR /&gt;t $stat -maxSamples $samples&lt;BR /&gt;Get-VM : 10/11/2011 09:51:01&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-VM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Could not find any of the servers&lt;BR /&gt; specified by name.&lt;BR /&gt;At C:\scripts\GatherIOPS.ps1:64 char:40&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2011 10:22:36 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Gathering-virtual-machine-IOPS-statistics-by-datastore/tac-p/2787070#M209</guid>
      <dc:creator>gtlscot</dc:creator>
      <dc:date>2011-11-10T10:22:36Z</dc:date>
    </item>
  </channel>
</rss>

