如何查看 DataStore 是否支持通过 PowerCli(VMware) 进行精简配置

How to see if DataStore supports Thin Provisioning via PowerCli(VMware)

在创建VM时选择存储时,我们可以看到这个存储是否支持Thin Provisioning(Supported/Not支持)。如何通过 PowerCli 以脚本视角显示它?

到目前为止我的命令,只缺少这一列:

Get-Datastore -server xxx -name xxx | Select Name, Datacenter,CapacityGB,FreeSpaceGB,Type,
@{N="Provisioned (GB)"; E={[math]::round(($_.ExtensionData.Summary.Capacity - $_.ExtensionData.Summary.FreeSpace + $_.ExtensionData.Summary.Uncommitted)/1GB,2) }}

输出:

Name             : xxx
Datacenter       : xxx
CapacityGB       : 4654.75
FreeSpaceGB      : 3253.978515625
Provisioned (GB) : 2279.13
Type             : VMFS

额外问题:如何更改水平视图(table 列)的当前输出?

您正在寻找 'PerFileThinProvisioningSupported' 属性,它位于:$ds.ExtensionData.Capability.PerFileThinProvisioningSupported

奖金问题,管你有什么:Format-Table

感谢 Kyle Ruddy,最终回答:

Get-Datastore -server xxx -name xxx | Select Name, Datacenter,CapacityGB,FreeSpaceGB,Type,
>> @{N="Provisioned (GB)"; E={[math]::round(($_.ExtensionData.Summary.Capacity - $_.ExtensionData.Summary.FreeSpace + $_.ExtensionData.Summary.Uncommitted)/1GB,2) }},
>> @{N="Thin Provisioning"; E={($_.ExtensionData.Capability.PerFileThinProvisioningSupported)}} | format-table