Get-SCPerformanceData

Gets performance data for host groups, clusters, hosts, and virtual machines.

Syntax

Get-SCPerformanceData [-AllVM] -PerformanceCounter <String> [-VMMServer <ServerConnection>]
 [<CommonParameters>]
Get-SCPerformanceData [-AllVMNetworkGateway] -PerformanceCounter <String> [-VMMServer <ServerConnection>]
 [<CommonParameters>]
Get-SCPerformanceData [-AllVNIC] -PerformanceCounter <String> [-VMMServer <ServerConnection>]
 [<CommonParameters>]
Get-SCPerformanceData [-VM] <VM> -PerformanceCounter <String> -TimeFrame <String>
 [-VMMServer <ServerConnection>] [<CommonParameters>]
Get-SCPerformanceData [-VMHost] <Host> -PerformanceCounter <String> -TimeFrame <String>
 [-VMMServer <ServerConnection>] [<CommonParameters>]
Get-SCPerformanceData [-VMHostCluster] <HostCluster> -PerformanceCounter <String> -TimeFrame <String>
 [-VMMServer <ServerConnection>] [<CommonParameters>]
Get-SCPerformanceData [-VMHostGroup] <HostGroup> -PerformanceCounter <String> -TimeFrame <String>
 [-VMMServer <ServerConnection>] [<CommonParameters>]

Description

The Get-SCPerformanceData cmdlet gets performance data for host groups, clusters, hosts, and virtual machines. You can request data for the following performance counters:



- CPU usage

- Memory usage

- Storage IOPS usage

- Network IO usage

- Power savings

Examples

Example 1: Get performance data for a host group

PS C:\> $HostGroup = Get-SCVMHostGroup -Name "HostGroup01"
PS C:\> Get-SCPerformanceData -VMHostGroup $HostGroup -PerformanceCounter "MemoryUsage" -Timeframe "Hour"

The first command gets the host group object named HostGroup01 and stores the object in the $HostGroup variable.

The second command gets the memory usage data over the last three hours for HostGroup01.

Example 2: Get performance data for a cluster

PS C:\> $Cluster = Get-SCVMHostCluster -Name "Cluster01.Contoso.com"
PS C:\> Get-SCPerformanceData -VMHostCluster $Cluster -PerformanceCounter "MemoryUsage" -Timeframe "Day"

The first command gets the cluster object named Cluster01 and stores the object in the $Cluster variable.

The second command gets the memory usage data for the last day (24 hours) for Cluster01.

Example 3: Get performance data for a specified host

PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com"
PS C:\> Get-SCPerformanceData -VMHost $VMHost -PerformanceCounter "MemoryUsage" -Timeframe "Month"

The first command gets the host object named VMHost01 and stores the object in the $VMHost variable.

The second command gerts the memory usage data for the last month (30 days) for VMHost01.

Example 4: Get performance data for a specified virtual machine

PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> Get-SCPerformanceData -VM $VM -PerformanceCounter "MemoryUsage" -Timeframe "Day"

The first command gets the virtual machine object named VM01 and stores the object in the $VM variable.

The second command gerts the memory usage data for the last day (24 hours) for VM01.

Example 5: Get performance data for all virtual machines

PS C:\> Get-SCPerformanceData -AllVM -PerformanceCounter "CPUUsage"

This command gets the CPU usage data for all virtual machines.

Parameters

-AllVM

Indicates that data for all virtual machines is returned.

Type:SwitchParameter
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AllVMNetworkGateway

Indicates that data for all network gateways is returned.

Type:SwitchParameter
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AllVNIC

Indicates that data for all virtual network adapters is returned.

Type:SwitchParameter
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PerformanceCounter

Specifies the performance counter to use. The acceptable values for this parameter are:

- CPUUsage

  • MemoryUsage
  • StorageIOPSUsage
  • NetworkIOUsage
  • PowerSavings

Type:String
Parameter Sets:CPUUsage, MemoryUsage, StorageIOPSUsage, NetworkIOUsage, NetworkIOSent, NetworkIOReceived, PowerSavings
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TimeFrame

Specifies the timeframe in which to gather performance data. The acceptable values for this parameter are:

- Hour

  • Day
  • Month

Type:String
Parameter Sets:Hour, Day, Month
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VM

Specifies a virtual machine object.

Type:VM
Required:True
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VMHost

Specifies a virtual machine host object. Virtual Machine Manager (VMM) supports Hyper-V hosts, VMware ESX hosts, and Citrix XenServer hosts.

For more information about each type of host, see the Add-SCVMHost cmdlet.

Type:Host
Required:True
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VMHostCluster

Specifies a VMM host cluster object.

Type:HostCluster
Required:True
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VMHostGroup

Specifies a virtual machine host group object.

Type:HostGroup
Required:True
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Outputs

double[]

This cmdlet returns an array of double values.