Hi ,
We required a inventory in complete data center like VMName,vmhost,Datastore,DatastoreNNA,clusterName.
Output like
VMName: Name of VM
VMhost: HostIP
Datastore: Name of datastores
NNA: Datastore identifier
Cluster : cluster Name
Try something like this
Get-VM |
Select Name,@{N="VMHost";E={$_.Host.Name}},
@{N="Cluster";E={Get-Cluster -VM $_ | Select -ExpandProperty Name}},
@{N="Datastore";E={[string]::Join(',',(Get-View $_.ExtensionData.Datastore | Select -ExpandProperty Name))}},
@{N="NAA";E={[string]::Join(',',(Get-View $_.ExtensionData.Datastore | %{$_.Info.Vmfs.Extent | %{$_.DiskName}}))}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try something like this
Get-VM |
Select Name,@{N="VMHost";E={$_.Host.Name}},
@{N="Cluster";E={Get-Cluster -VM $_ | Select -ExpandProperty Name}},
@{N="Datastore";E={[string]::Join(',',(Get-View $_.ExtensionData.Datastore | Select -ExpandProperty Name))}},
@{N="NAA";E={[string]::Join(',',(Get-View $_.ExtensionData.Datastore | %{$_.Info.Vmfs.Extent | %{$_.DiskName}}))}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks Lucd, That's Grate