Get-SCPerformanceData

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

Syntax

Get-SCPerformanceData
   [-VM] <VM>
   [-VMMServer <ServerConnection>]
   -TimeFrame <String>
   -PerformanceCounter <String>
   [<CommonParameters>]
Get-SCPerformanceData
   [-VMHost] <Host>
   [-VMMServer <ServerConnection>]
   -TimeFrame <String>
   -PerformanceCounter <String>
   [<CommonParameters>]
Get-SCPerformanceData
   [-VMHostCluster] <HostCluster>
   [-VMMServer <ServerConnection>]
   -TimeFrame <String>
   -PerformanceCounter <String>
   [<CommonParameters>]
Get-SCPerformanceData
   [-VMHostGroup] <HostGroup>
   [-VMMServer <ServerConnection>]
   -TimeFrame <String>
   -PerformanceCounter <String>
   [<CommonParameters>]
Get-SCPerformanceData
   [-VMMServer <ServerConnection>]
   -PerformanceCounter <String>
   [-AllVNIC]
   [<CommonParameters>]
Get-SCPerformanceData
   [-VMMServer <ServerConnection>]
   -PerformanceCounter <String>
   [-AllVM]
   [<CommonParameters>]
Get-SCPerformanceData
   [-VMMServer <ServerConnection>]
   -PerformanceCounter <String>
   [-AllVMNetworkGateway]
   [<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
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-AllVMNetworkGateway

Indicates that data for all network gateways is returned.

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

-AllVNIC

Indicates that data for all virtual network adapters is returned.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
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
Accepted values:CPUUsage, MemoryUsage, StorageIOPSUsage, NetworkIOUsage, NetworkIOSent, NetworkIOReceived, PowerSavings
Position:Named
Default value:None
Required:True
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
Accepted values:Hour, Day, Month
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-VM

Specifies a virtual machine object.

Type:VM
Position:0
Default value:None
Required:True
Accept pipeline input:True
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
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VMHostCluster

Specifies a VMM host cluster object.

Type:HostCluster
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VMHostGroup

Specifies a virtual machine host group object.

Type:HostGroup
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VMMServer

Specifies a VMM server object.

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

Outputs

double[]

This cmdlet returns an array of double values.