VMware Cloud Community
ganapa2000
Hot Shot
Hot Shot

Cluster Name shows blank

I want to know, to which vCenter Cluster that a datastore belongs to.

Cluster Name shows blank, am i missing something

Get-Datastore | Select Name, Datacenter,

@{N="Cluster";E={Get-Cluster $_.Name}},

@{N="CapacityInGB";E={[math]::round($_.CapacityGB)}},

@{N="Provisioned (GB)"; E={[math]::round(($_.ExtensionData.Summary.Capacity - $_.ExtensionData.Summary.FreeSpace + $_.ExtensionData.Summary.Uncommitted)/1GB,2) }},

@{N="FreeSpaceInGB";E={[math]::round($_.FreeSpaceGB)}}

Please help

Reply
0 Kudos
4 Replies
DZ1
Hot Shot
Hot Shot

You're retrieving datastore names.  Your example won't work because Get-Cluster $_.Name in your script is the name of the datastore, which won't work.  Get-Cluster wants the name of of an actual Cluster, and not a datastore name. 

Reply
0 Kudos
ganapa2000
Hot Shot
Hot Shot

I want to know, which vCenter Cluster that Datastore belongs to

Reply
0 Kudos
CRad14
Hot Shot
Hot Shot

Hope this helps

get-datastore "datastorename" | get-vmhost | get-cluster

Conrad www.vnoob.com | @vNoob | If I or anyone else is helpful to you make sure you mark their posts as such! 🙂
Reply
0 Kudos
ganapa2000
Hot Shot
Hot Shot

how do i modify the above script ?

Reply
0 Kudos