PowerCLI Reference

Get-VsanStat

Synopsis

This cmdlet retrieves vSAN performance statistics for the specified server entity.

Syntax

Get-VsanStat [[-Name] <String[]>] [-Entity <VIObjectCore[]>] [-StartTime <DateTime>] [-EndTime <DateTime>] [-Server <VIServer[]>] [<CommonParameters>]

Get-VsanStat [[-Name] <String[]>] [-Entity <VIObjectCore[]>] [-Server <VIServer[]>] -PredefinedTimeRange <VsanPredefinedTimeRange> [<CommonParameters>]

Related Commands

Online Version

Detailed Description

This cmdlet retrieves vSAN performance statistics for the specified server entity.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
NameString[]Specifies the performance metrics you want to retrieve. If not specified, all the metrics are returned. The value is in the format 'ViewName.MetricName'.


ViewName is applicable to different entity types: Cluster: Backend, VMConsumption VMHost: Backend, VMConsumption, HostNetwork, HostIscsi VirtualMachine: Performance HardDisk: VirtualDisk, Vscsi VsanDisk: Performance VsanDiskGroup: Performance VsanIscsiTarget: Performance VsanIscsiLun: Performance
falseFalse
EndTimeDateTimeSpecifies the client local time up to which you want to retrieve statistics. If the specified value is later than current server time, the value is replaced by the current server time. The returned samples include the sample at EndTime.falseFalse
EntityVIObjectCore[]Specifies the entity for which you want to retrieve vSAN performance metrics. OBN is supported for the Cluster, VMHost, VirtualMachine, and VsanIscsiTarget entity types.falseTrue (ByValue)
PredefinedTimeRangeVsanPredefinedTimeRangeA list of predefined time ranges (Last5Minutes, Last15Minutes, Last30Minutes, LastHour, Last24Hours, LastWeek) provides a more efficient way to specify time range in querying vSAN performance metric than using the StartTime and EndTime parameters.trueFalse
ServerVIServer[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet.falseFalse
StartTimeDateTimeSpecifies the client local time from which you want to retrieve statistics. The returned samples do not include the sample at StartTime.falseFalse

Return Type

Zero or more VsanStatSample objects

Notes

Examples

-------------------------- Example 1 --------------------------

$diskGroups = Get-VsanDiskGroup -Cluster "vsan-cluster"
Get-VsanStat -Entity $diskGroups

Retrieves all vSAN performance samples for vSAN disk groups of the "vsan-cluster" cluster.

-------------------------- Example 2 --------------------------

Get-VsanStat -Entity "vsan-cluster" -Name "Backend.ReadThroughput"

Retrieves vSAN performance samples for backend read throughput of the "vsan-cluster" cluster.

-------------------------- Example 3 --------------------------

$cluster = Get-Cluster -Name "vsan-cluster"
Get-VsanStat -Entity $cluster -Name VMConsumption.ReadIops -StartTime $startTime -EndTime $endTime

Retrieves the read IOPS stats relevant to the VM consumption view of the "vsan-cluster" cluster in the $startTime to $endTime local time range.

-------------------------- Example 4 --------------------------

$cluster = Get-Cluster -Name "vsan-cluster"
Get-VsanStat -Entity $cluster -Name Backend.ReadIops -StartTime $startTime -EndTime $endTime

Retrieves the read IOPS stats relevant to the backend view of the "vsan-cluster" cluster in the $startTime to $endTime local time range.

-------------------------- Example 5 --------------------------

Get-VsanStat -Entity $iscsiTarget -Name Performance.ReadIops -StartTime $startTime -EndTime $endTime

Retrieves the read IOPS stats of the $iscsiTarget target in the $startTime to $endTime local time range.

-------------------------- Example 6 --------------------------

Get-VsanStat -Entity $iscsiLUN -Name Performance.ReadIops -StartTime $startTime -EndTime $endTime

Retrieves the read IOPS stats of the $iscsiLUN iSCSI LUN in the $startTime to $endTime local time range.

-------------------------- Example 7 --------------------------

Get-VsanStat -Entity $vmhost -Name VMConsumption.ReadIops -StartTime $startTime -EndTime $endTime

Retrieves the read IOPS stats relevant to the VM consumption view of the $vmHost host in the $startTime to $endTime local time range.

-------------------------- Example 8 --------------------------

Get-VsanStat -Entity $vmhost -Name Backend.ReadIops -StartTime $startTime -EndTime $endTime

Retrieves the read IOPS stats relevant to the backend view of $vmHost host in the $startTime to $endTime local time range.

-------------------------- Example 9 --------------------------

Get-VsanStat -Entity $diskGroup -Name Performance.ReadCacheWriteIops -StartTime $startTime -EndTime $endTime

Retrieves the read cache write IOPS stats of the $diskGroup vSAN disk group in the $startTime to $endTime local time range.

-------------------------- Example 10 --------------------------

Get-VsanStat -Entity $disk -Name Performance.DeviceReadIops -StartTime $startTime -EndTime $endTime

Retrieves the device read IOPS stats of the $disk vSAN disk in the $startTime to $endTime local time range.

-------------------------- Example 11 --------------------------

Get-VsanStat -Entity $vmhost -Name HostNetwork.NetworkInboundThroughput -StartTime $startTime -EndTime $endTime

Retrieves the network inbound throughput stats relevant to the VMKernel adapter aggregation of $vmHost host in the $startTime to $endTime local time range.

-------------------------- Example 12 --------------------------

Get-VsanStat -Entity "MyVM" -Name Performance.ReadIops -StartTime $startTime -EndTime $endTime

Retrieves the read IOPS stats of "MyVM" virtual machine in the $startTime to $endTime local time range.

-------------------------- Example 13 --------------------------

Get-VsanStat -Entity $hardDisk -Name VirtualDisk.IopsLimit -StartTime $startTime -EndTime $endTime

Retrieves the IOPS limit stats of the $hardDisk virtual hard disk in the $startTime to $endTime local time range.

-------------------------- Example 14 --------------------------

Get-VsanStat -Entity $cluster -Name Backend.ReadIops -TimeRange LastHour

Queries the vSAN Performance metric Backend.ReadIops in the last hour.


Copyright © VMware, Inc. All rights reserved.