VMware Cloud Community
MarosNZ
Contributor
Contributor
Jump to solution

How to retrieve 'Swap Objects' capacity from vCenter using powerCLI.

How can I retrieve 'Swap Objects' capacity from vCenter using powerCLI.

You can find it in VSAN cluster > Monitor > vSAN > Capacity.

See below picture.

371829_371829.pngpastedImage_1.png

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

In the current PowerCLI release (11.3.0), the Get-VsanSpaceUsage cmdlet doesn't show the Swap Objects yet.

But with Get-VsanView we can get there.

$clusterName = 'cluster'


$cluster = Get-Cluster -Name $clusterName

$vSpace = Get-VsanView -Id 'VsanSpaceReportSystem-vsan-cluster-space-report-system'

$vSpaceUsage = $vSpace.VsanQuerySpaceUsage($cluster.Id)

$vSpaceUsage.SpaceDetail.SpaceUsageByObjectType | where { $_.ObjType -eq 'vmswap' }


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

View solution in original post

1 Reply
LucD
Leadership
Leadership
Jump to solution

In the current PowerCLI release (11.3.0), the Get-VsanSpaceUsage cmdlet doesn't show the Swap Objects yet.

But with Get-VsanView we can get there.

$clusterName = 'cluster'


$cluster = Get-Cluster -Name $clusterName

$vSpace = Get-VsanView -Id 'VsanSpaceReportSystem-vsan-cluster-space-report-system'

$vSpaceUsage = $vSpace.VsanQuerySpaceUsage($cluster.Id)

$vSpaceUsage.SpaceDetail.SpaceUsageByObjectType | where { $_.ObjType -eq 'vmswap' }


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