<?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: Datastore usage statistics	</title>
	<atom:link href="https://www.lucd.info/2011/06/19/datastore-usage-statistics/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.lucd.info/2011/06/19/datastore-usage-statistics/</link>
	<description>My PowerShell ramblings</description>
	<lastBuildDate>Fri, 23 Feb 2018 21:28:14 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.9</generator>
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/><atom:link rel="hub" href="https://websubhub.com/hub"/>	<item>
		<title>
		By: Acekeeper		</title>
		<link>https://www.lucd.info/2011/06/19/datastore-usage-statistics/#comment-4413</link>

		<dc:creator><![CDATA[Acekeeper]]></dc:creator>
		<pubDate>Fri, 23 Feb 2018 21:28:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=3306#comment-4413</guid>

					<description><![CDATA[Great script LucD. I was wondering how can I get VMs datastore usage statistics. For example I have VM1 and  VM2, so can I get output like that?: 
VM1        DataStore01           Capacity 200GB     Free space 50GB
VM2        DataStore02           Capacity 100GB     Free space 20GB

Thank you]]></description>
			<content:encoded><![CDATA[<p>Great script LucD. I was wondering how can I get VMs datastore usage statistics. For example I have VM1 and  VM2, so can I get output like that?:<br />
VM1        DataStore01           Capacity 200GB     Free space 50GB<br />
VM2        DataStore02           Capacity 100GB     Free space 20GB</p>
<p>Thank you</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: LucD		</title>
		<link>https://www.lucd.info/2011/06/19/datastore-usage-statistics/#comment-3824</link>

		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Fri, 04 Mar 2016 21:51:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=3306#comment-3824</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2011/06/19/datastore-usage-statistics/#comment-3822&quot;&gt;Thefluffyadmin&lt;/a&gt;.

I&#039;ll check if I can reproduce the error.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll check if I can reproduce the error.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Thefluffyadmin		</title>
		<link>https://www.lucd.info/2011/06/19/datastore-usage-statistics/#comment-3822</link>

		<dc:creator><![CDATA[Thefluffyadmin]]></dc:creator>
		<pubDate>Wed, 02 Mar 2016 15:45:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=3306#comment-3822</guid>

					<description><![CDATA[Tried to run this on powercli 6.0R3 against vCenter 5.5 and unfortunately running up against this: 

Exception calling &quot;QueryAvailablePerfMetric&quot; with &quot;4&quot; argument(s): &quot;A specified parameter was not correct.
entity&quot;
At D:\scripts_robert\get-datastoreusagestats.ps1:107 char:5
+     $metrics = $perfMgr.QueryAvailablePerfMetric($Entity.MoRef,$null, ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : VimException]]></description>
			<content:encoded><![CDATA[<p>Tried to run this on powercli 6.0R3 against vCenter 5.5 and unfortunately running up against this: </p>
<p>Exception calling &#8220;QueryAvailablePerfMetric&#8221; with &#8220;4&#8221; argument(s): &#8220;A specified parameter was not correct.<br />
entity&#8221;<br />
At D:\scripts_robert\get-datastoreusagestats.ps1:107 char:5<br />
+     $metrics = $perfMgr.QueryAvailablePerfMetric($Entity.MoRef,$null, &#8230;<br />
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException<br />
    + FullyQualifiedErrorId : VimException</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kids_Kol		</title>
		<link>https://www.lucd.info/2011/06/19/datastore-usage-statistics/#comment-3424</link>

		<dc:creator><![CDATA[Kids_Kol]]></dc:creator>
		<pubDate>Wed, 28 Jan 2015 06:01:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=3306#comment-3424</guid>

					<description><![CDATA[Hi Luc,

We often found free space in a datastore has dramatically reduced. Is there any way we can get the VM name and the amount it contributes to this free space utilization?

- Kids]]></description>
			<content:encoded><![CDATA[<p>Hi Luc,</p>
<p>We often found free space in a datastore has dramatically reduced. Is there any way we can get the VM name and the amount it contributes to this free space utilization?</p>
<p>&#8211; Kids</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: AdrianH		</title>
		<link>https://www.lucd.info/2011/06/19/datastore-usage-statistics/#comment-3371</link>

		<dc:creator><![CDATA[AdrianH]]></dc:creator>
		<pubDate>Thu, 13 Nov 2014 10:31:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=3306#comment-3371</guid>

					<description><![CDATA[Hi LucD
I&#039;m new in Script and Little bit lost.. :-)

Try to find a Script that gives me Cluster Performance values for a &quot;custom Time-Schedule&quot; (CPU MHz usage max/average and Memory consumed max/average) for all Clusters

-Adrian]]></description>
			<content:encoded><![CDATA[<p>Hi LucD<br />
I&#8217;m new in Script and Little bit lost.. 🙂</p>
<p>Try to find a Script that gives me Cluster Performance values for a &#8220;custom Time-Schedule&#8221; (CPU MHz usage max/average and Memory consumed max/average) for all Clusters</p>
<p>-Adrian</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ravi		</title>
		<link>https://www.lucd.info/2011/06/19/datastore-usage-statistics/#comment-2873</link>

		<dc:creator><![CDATA[Ravi]]></dc:creator>
		<pubDate>Wed, 06 Nov 2013 19:19:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=3306#comment-2873</guid>

					<description><![CDATA[For example someone forget reclaim the data store , how we can identify unused  lun details through powercli]]></description>
			<content:encoded><![CDATA[<p>For example someone forget reclaim the data store , how we can identify unused  lun details through powercli</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jesse		</title>
		<link>https://www.lucd.info/2011/06/19/datastore-usage-statistics/#comment-2871</link>

		<dc:creator><![CDATA[Jesse]]></dc:creator>
		<pubDate>Tue, 05 Nov 2013 16:56:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=3306#comment-2871</guid>

					<description><![CDATA[I added &quot;StoragePod&quot; to the list of acceptable entities to be able to get Datastore Cluster stats (just used and provisioned), and it worked just fine!

Great function.]]></description>
			<content:encoded><![CDATA[<p>I added &#8220;StoragePod&#8221; to the list of acceptable entities to be able to get Datastore Cluster stats (just used and provisioned), and it worked just fine!</p>
<p>Great function.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: tequesta		</title>
		<link>https://www.lucd.info/2011/06/19/datastore-usage-statistics/#comment-2452</link>

		<dc:creator><![CDATA[tequesta]]></dc:creator>
		<pubDate>Thu, 11 Jul 2013 18:08:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=3306#comment-2452</guid>

					<description><![CDATA[&lt;a href=&quot;#comment-2442&quot; rel=&quot;nofollow&quot;&gt;@LucD &lt;/a&gt; 

Hi Luc, you´re right, some datastores don´t have HI4 statistics. When I change to HI3 or HI2, all works fine.
But, after a few runs of the script, I see that some VMs don´t show on the list.
And after a time looking, I found that the VMs with disks bigger than 2Tb was the trouble.
I cut the script to look like this (for diagnose purposes):

*-*-*-*

$metrics = &quot;disk.used.latest&quot;
$report = @()
foreach($vm in Get-VM ){
	$report += Get-Stat -entity $vm.ExtensionData -stat $metrics -interval &quot;HI2&quot; &#124;
	Sort-Object -Property Timestamp &#124;
	Group-Object -Property Timestamp &#124; %{
New-Object PSObject -Property @{
&quot;VM Name&quot; = $vm.Name
Timestamp = $_.Name
&quot;Used (GB)&quot; = [Math]::Round(($_.Group &#124;
where {$_.CounterName -eq &quot;disk.used.latest&quot;}).Value/1GB,2)

}
}
}
$report &#124; Export-Csv &quot;z:\DS-stats_sata.csv&quot; -NoTypeInformation -UseCulture

*-*-*-*-*

I think the problem is to handle the numbers, because a VM got a disk of 3Tb and the &quot;disk.used.latest&quot; is under 2Tb. If i cut the &quot;disk.provisioned.latest&quot; line on the original script, the VM is showed on the list.

What do you think about this?

I hope you can understand my idea because my english is too poor.

Thanks in advance.

tequesta]]></description>
			<content:encoded><![CDATA[<p><a href="#comment-2442" rel="nofollow">@LucD </a> </p>
<p>Hi Luc, you´re right, some datastores don´t have HI4 statistics. When I change to HI3 or HI2, all works fine.<br />
But, after a few runs of the script, I see that some VMs don´t show on the list.<br />
And after a time looking, I found that the VMs with disks bigger than 2Tb was the trouble.<br />
I cut the script to look like this (for diagnose purposes):</p>
<p>*-*-*-*</p>
<p>$metrics = &#8220;disk.used.latest&#8221;<br />
$report = @()<br />
foreach($vm in Get-VM ){<br />
	$report += Get-Stat -entity $vm.ExtensionData -stat $metrics -interval &#8220;HI2&#8221; |<br />
	Sort-Object -Property Timestamp |<br />
	Group-Object -Property Timestamp | %{<br />
New-Object PSObject -Property @{<br />
&#8220;VM Name&#8221; = $vm.Name<br />
Timestamp = $_.Name<br />
&#8220;Used (GB)&#8221; = [Math]::Round(($_.Group |<br />
where {$_.CounterName -eq &#8220;disk.used.latest&#8221;}).Value/1GB,2)</p>
<p>}<br />
}<br />
}<br />
$report | Export-Csv &#8220;z:\DS-stats_sata.csv&#8221; -NoTypeInformation -UseCulture</p>
<p>*-*-*-*-*</p>
<p>I think the problem is to handle the numbers, because a VM got a disk of 3Tb and the &#8220;disk.used.latest&#8221; is under 2Tb. If i cut the &#8220;disk.provisioned.latest&#8221; line on the original script, the VM is showed on the list.</p>
<p>What do you think about this?</p>
<p>I hope you can understand my idea because my english is too poor.</p>
<p>Thanks in advance.</p>
<p>tequesta</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: tequesta		</title>
		<link>https://www.lucd.info/2011/06/19/datastore-usage-statistics/#comment-2443</link>

		<dc:creator><![CDATA[tequesta]]></dc:creator>
		<pubDate>Fri, 05 Jul 2013 12:19:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=3306#comment-2443</guid>

					<description><![CDATA[&lt;blockquote cite=&quot;#commentbody-2442&quot;&gt;
&lt;strong&gt;&lt;a href=&quot;#comment-2442&quot; rel=&quot;nofollow&quot;&gt;LucD&lt;/a&gt; :&lt;/strong&gt;
@tequesta,in the code you specify Historical Interval 4 (HI4). That means data from more than 1 month ago with an interval of 1 day.
If the Get-Stat cmdlet doesn’t find any data that corresponds, it will not return anything at all.
Like I said in the other reply, are you sure that there is data for HI4 available for these specific datastores ? You can check by looking under the Performance tab in the vSphere client.
You could also try to get the report for a more recent intervals (HI3, HI2….).
Let me know if that brings something ?
&lt;/blockquote&gt;

Thanks LucD.

Thats the problem, I have less than 1 month of data of some datastores.

Thank you very much!]]></description>
			<content:encoded><![CDATA[<blockquote cite="#commentbody-2442"><p>
<strong><a href="#comment-2442" rel="nofollow">LucD</a> :</strong><br />
@tequesta,in the code you specify Historical Interval 4 (HI4). That means data from more than 1 month ago with an interval of 1 day.<br />
If the Get-Stat cmdlet doesn’t find any data that corresponds, it will not return anything at all.<br />
Like I said in the other reply, are you sure that there is data for HI4 available for these specific datastores ? You can check by looking under the Performance tab in the vSphere client.<br />
You could also try to get the report for a more recent intervals (HI3, HI2….).<br />
Let me know if that brings something ?
</p></blockquote>
<p>Thanks LucD.</p>
<p>Thats the problem, I have less than 1 month of data of some datastores.</p>
<p>Thank you very much!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: LucD		</title>
		<link>https://www.lucd.info/2011/06/19/datastore-usage-statistics/#comment-2442</link>

		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Thu, 04 Jul 2013 17:30:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=3306#comment-2442</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2011/06/19/datastore-usage-statistics/#comment-2438&quot;&gt;tequesta&lt;/a&gt;.

@tequesta,in the code you specify Historical Interval 4 (HI4). That means data from more than 1 month ago with an interval of 1 day.
If the Get-Stat cmdlet doesn&#039;t find any data that corresponds, it will not return anything at all.
Like I said in the other reply, are you sure that there is data for HI4 available for these specific datastores ? You can check by looking under the Performance tab in the vSphere client.
You could also try to get the report for a more recent intervals (HI3, HI2....).
Let me know if that brings something ?]]></description>
			<content:encoded><![CDATA[<p>@tequesta,in the code you specify Historical Interval 4 (HI4). That means data from more than 1 month ago with an interval of 1 day.<br />
If the Get-Stat cmdlet doesn&#8217;t find any data that corresponds, it will not return anything at all.<br />
Like I said in the other reply, are you sure that there is data for HI4 available for these specific datastores ? You can check by looking under the Performance tab in the vSphere client.<br />
You could also try to get the report for a more recent intervals (HI3, HI2&#8230;.).<br />
Let me know if that brings something ?</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
