VMware Cloud Community
jvm2016
Hot Shot
Hot Shot
Jump to solution

multiple extents of datastore_powercli

Hi All/luc,

How to check if a datastore has multiple extents added to it .

pastedImage_0.png

if i run above command it is giving only one naa id for lunwhich was originally formated with vmfs.

if we add more extents to datastore will it give naa id for additional luns added as extents or is there any other way in powercli.

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try like this

Get-Data | Where{$_.ExtensionData.Info.Vmfs.Extent.Count -gt 1}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
7 Replies
vijayrana968
Virtuoso
Virtuoso
Jump to solution

Right, this is showing one disk as there's single extent on datastore. This command should return with number of extents with naa id's once you add more.

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

i run the folowing to check .

$e|Get-Datastore|?{$_.extensiondata.info.vmfs.extent.diskname -gt 1}       

to get all datastores where disks count more than 1 .but it still  giving the same output of 1 disk.   does above command make any sense to find multiple extents.

Reply
0 Kudos
vijayrana968
Virtuoso
Virtuoso
Jump to solution

What if you run only $e? I’m not sure what values are stored in $e. Open a fresh powercli session connected to vCenter and try with this

Get-Datastore |

Where-Object {$_.ExtensionData.Info.GetType().Name -eq "VmfsDatastoreInfo"} |

ForEach-Object {

  if ($_)

  {

    $Datastore = $_

    $Datastore.ExtensionData.Info.Vmfs.Extent |

    Select-Object -Property @{Name="Name";Expression={$Datastore.Name}},

      DiskName

  }

}

jvm2016
Hot Shot
Hot Shot
Jump to solution

$e  has value of esxi host .iam checking the one yu suggested .Thnaks.

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

i checked it worked fine but its not specifically giving me info as what datastores have multiple extents only.

i though of using where clause but that does not work.

iam not sure why following does not work.

Get-Datastore|?{$_.extensiondata.info.vmfs.extent -gt 1}

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Try like this

Get-Data | Where{$_.ExtensionData.Info.Vmfs.Extent.Count -gt 1}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

Thanks Luc .it worked .

Reply
0 Kudos