Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 175326

Get cluster and ID per data store

$
0
0

Hi,

I am trying to write a script that lists the data store name, the cluster it belong to and the ID in a format that looks about like this:

CLUSTERNAME     DATASTORE_NAME    naa.xyz123xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

I poked around and found 2 scripts that do each of the parts, but I cannot figure out how to merge them, so so speak.

 

Data store and cluster name:

 

Get-Cluster -PipelineVariable cluster |

Get-Datastore |

select @{N='Cluster';E={$cluster.Name}}Name, Type, FilesystemVersion, State, Accessible | Out-GridView

 

Get data store name and ID:

 

Get-Datastore | where{$_.Type -eq 'VMFS'} |

Select Name,

    @{N='LUN';E={$_.ExtensionData.Info.Vmfs.Extent.DiskName -join ' | '}}

 

Now, can anyone explain how I merge these, getting the

 

@{N='LUN';E={$_.ExtensionData.Info.Vmfs.Extent.DiskName -join ' | '}}

 

to be part of the first script?


Viewing all articles
Browse latest Browse all 175326

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>