VMware Cloud Community
E4F
Contributor
Contributor
Jump to solution

Mapping datastore canonical name to friendly name

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

Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
RvdNieuwendijk
Leadership
Leadership
Jump to solution

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

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition

View solution in original post

Reply
0 Kudos
2 Replies
RvdNieuwendijk
Leadership
Leadership
Jump to solution

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

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
Reply
0 Kudos
E4F
Contributor
Contributor
Jump to solution

Thanks!

Reply
0 Kudos