<?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>topic Re: PowerCLI Script that List all Clusters and their own Datastore details, Storage Baie in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-Script-that-List-all-Clusters-and-their-own-Datastore/m-p/2991215#M113512</link>
    <description>&lt;P&gt;Afaik, these metrics only return Realtime values when the Entity is a VM.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Oct 2023 11:08:24 GMT</pubDate>
    <dc:creator>LucD</dc:creator>
    <dc:date>2023-10-16T11:08:24Z</dc:date>
    <item>
      <title>PowerCLI Script that List all Clusters and their own Datastore details, Storage Baie</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-Script-that-List-all-Clusters-and-their-own-Datastore/m-p/2990595#M113464</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im looking to create a Power CLI script that list all clusters into a Vcenter and theirs own datastores and storage baies details ( Name of the baie, Name of the datastore, Size of the datastore, Free space …). Could you please help me and let me know what can i add to this exemple ? i'm Open to any suggestion&amp;nbsp;&lt;/P&gt;&lt;P&gt;$clusters = get-cluster&lt;BR /&gt;Foreach ($cluster in $clusters)&lt;BR /&gt;{&lt;BR /&gt;$cluster | get-datastore | % {&lt;BR /&gt;[pscustomobject] @{&lt;BR /&gt;'cluster' = $cluster.name&lt;BR /&gt;'datastore' = $_.name&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 15:03:03 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-Script-that-List-all-Clusters-and-their-own-Datastore/m-p/2990595#M113464</guid>
      <dc:creator>Jocker-H</dc:creator>
      <dc:date>2023-10-11T15:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: PowerCLI Script that List all Clusters and their own Datastore details, Storage Baie</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-Script-that-List-all-Clusters-and-their-own-Datastore/m-p/2990598#M113465</link>
      <description>&lt;P&gt;You could start by doing a search in this community, there are ample samples availables.&lt;BR /&gt;Those should give you some ideas on what to collect.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 15:12:49 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-Script-that-List-all-Clusters-and-their-own-Datastore/m-p/2990598#M113465</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2023-10-11T15:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: PowerCLI Script that List all Clusters and their own Datastore details, Storage Baie</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-Script-that-List-all-Clusters-and-their-own-Datastore/m-p/2991206#M113510</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Is there any possibility to add a line into the below script in order to&amp;nbsp; show datastore&amp;nbsp; I/O value in real time ?&lt;/P&gt;&lt;P&gt;$esxiHosts = Get-VMHost&lt;BR /&gt;$esxiClusters = Get-Cluster&lt;BR /&gt;$data = @()&lt;BR /&gt;foreach ($esxiHost in $esxiHosts) {&lt;BR /&gt;$esxiHostName = $esxiHost.Name&lt;BR /&gt;$datastores = Get-Datastore -VMHost $esxiHost&lt;BR /&gt;$esxiCluster = ($esxiHost | Get-Cluster).Name&lt;/P&gt;&lt;P&gt;foreach ($datastore in $datastores) {&lt;BR /&gt;$data += [PSCustomObject]@{&lt;BR /&gt;"ESXi Host" = $esxiHostName&lt;BR /&gt;"Datastore" = $datastore.Name&lt;BR /&gt;"Cluster" = $esxiCluster&lt;BR /&gt;"Size (GB)" = $datastore.CapacityGB&lt;BR /&gt;"Free Space (GB)" = $datastore.FreeSpaceGB&lt;BR /&gt;"Storage Array" = $datastore.ExtensionData.Info.Url&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;$data | Format-Table -AutoSize&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Hamdi&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 09:32:40 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-Script-that-List-all-Clusters-and-their-own-Datastore/m-p/2991206#M113510</guid>
      <dc:creator>Jocker-H</dc:creator>
      <dc:date>2023-10-16T09:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: PowerCLI Script that List all Clusters and their own Datastore details, Storage Baie</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-Script-that-List-all-Clusters-and-their-own-Datastore/m-p/2991209#M113511</link>
      <description>&lt;P&gt;Please note that i did try this script and there was no output related to I/O&amp;nbsp; any idea why ?&lt;/P&gt;&lt;P&gt;# Get a list of ESXi hosts&lt;BR /&gt;$esxiHosts = Get-VMHost&lt;/P&gt;&lt;P&gt;# Get a list of ESXi clusters&lt;BR /&gt;$esxiClusters = Get-Cluster&lt;/P&gt;&lt;P&gt;# Create an array to store the data&lt;BR /&gt;$data = @()&lt;/P&gt;&lt;P&gt;# Loop through each ESXi host and add the associated datastores, size, free space, storage array, and I/O details to the data array&lt;BR /&gt;foreach ($esxiHost in $esxiHosts) {&lt;BR /&gt;$esxiHostName = $esxiHost.Name&lt;BR /&gt;$datastores = Get-Datastore -VMHost $esxiHost&lt;BR /&gt;$esxiCluster = ($esxiHost | Get-Cluster).Name&lt;/P&gt;&lt;P&gt;foreach ($datastore in $datastores) {&lt;BR /&gt;$datastoreName = $datastore.Name&lt;BR /&gt;$datastoreSize = $datastore.CapacityGB&lt;BR /&gt;$freeSpace = $datastore.FreeSpaceGB&lt;/P&gt;&lt;P&gt;# Get I/O details for the datastore (adjust the time period as needed)&lt;BR /&gt;$ioStats = Get-Stat -Entity $datastore -Stat "datastore.numberReadAveraged.average", "datastore.numberWriteAveraged.average" -MaxSamples 1 -Realtime&lt;/P&gt;&lt;P&gt;$data += [PSCustomObject]@{&lt;BR /&gt;"ESXi Host" = $esxiHostName&lt;BR /&gt;"Datastore" = $datastoreName&lt;BR /&gt;"Cluster" = $esxiCluster&lt;BR /&gt;"Size (GB)" = $datastoreSize&lt;BR /&gt;"Free Space (GB)" = $freeSpace&lt;BR /&gt;&lt;BR /&gt;"Reads per second" = $ioStats | Where-Object { $_.MetricId -eq "datastore.numberReadAveraged.average" } | Select-Object -ExpandProperty Value&lt;BR /&gt;"Writes per second" = $ioStats | Where-Object { $_.MetricId -eq "datastore.numberWriteAveraged.average" } | Select-Object -ExpandProperty Value&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 09:43:12 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-Script-that-List-all-Clusters-and-their-own-Datastore/m-p/2991209#M113511</guid>
      <dc:creator>Jocker-H</dc:creator>
      <dc:date>2023-10-16T09:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: PowerCLI Script that List all Clusters and their own Datastore details, Storage Baie</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-Script-that-List-all-Clusters-and-their-own-Datastore/m-p/2991215#M113512</link>
      <description>&lt;P&gt;Afaik, these metrics only return Realtime values when the Entity is a VM.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 11:08:24 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-Script-that-List-all-Clusters-and-their-own-Datastore/m-p/2991215#M113512</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2023-10-16T11:08:24Z</dc:date>
    </item>
  </channel>
</rss>

