Automation

 View Only
  • 1.  Mapping datastore canonical name to friendly name

    Posted Nov 23, 2011 06:27 PM

    Is there a way to map the datastore canonical name to friendly name?  I can't seem to find a way to do this and can't find anything on the web to show me how either.  Any ideas?

    E4F



  • 2.  RE: Mapping datastore canonical name to friendly name
    Best Answer

    Posted Nov 23, 2011 07:09 PM

    Hi E4F,

    the next PowerCLI script will map the canonical name to the datastore name:

    Get-View -Viewtype Datastore -Property Name,Info | Foreach-Object {
      $Datastore = $_
      if ($Datastore.Info.GetType().Name -eq "VmfsDatastoreInfo") {
        $Datastore.Info.Vmfs.Extent | `
          Select-Object -Property @{N="CanonicalName";E={$_.DiskName}},
            @{N="Datastore";E={$Datastore.name}}
      }
    }
    
    

    Regards, Robert



  • 3.  RE: Mapping datastore canonical name to friendly name

    Posted Nov 23, 2011 07:14 PM

    Thanks!