Automation

 View Only
  • 1.  Vm-inventory-with NNA

    Posted Oct 22, 2013 01:46 AM

    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



  • 2.  RE: Vm-inventory-with NNA
    Best Answer

    Posted Oct 22, 2013 06:09 AM

    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}}))}} 


  • 3.  RE: Vm-inventory-with NNA

    Posted Oct 22, 2013 06:54 AM

    Thanks Lucd, That's Grate