PowerCLI: Datastore Block Sizes

Before VMFS5 the block size of the datastore determined the maximum size of a hard disk that could be added to a virtual machine. In our new glorious future it now makes no difference, but VMFS datastores that have been upgraded to version 5 will retain their old block size.

The following PowerCLI will show all the datastores connected to the vCenter and their block size.

1
Get-Datastore | select Name, CapacityGB, @{Label="BlockSize";Expression={$_.ExtensionData.Info.vmfs.BlockSizeMb}}

If we wish to show all datastores that have a block size larger than 1MB then we could do the following:

1
Get-Datastore | ? { $_.ExtensionData.Info.vmfs.BlockSizeMb -gt 1 } | select Name, CapacityGB, @{Label="BlockSize";Expression={$_.ExtensionData.Info.vmfs.BlockSizeMb}}
Built with Hugo
Theme Stack designed by Jimmy