Thor Logo dbatools

Get-DbaRgResourcePool

View Source
Chrissy LeMaire (@cl), netnerds.net
Windows, Linux, macOS

Synopsis

Retrieves SQL Server Resource Governor resource pools with their CPU, memory, and IOPS configuration settings

Description

Retrieves detailed information about SQL Server Resource Governor resource pools, including both internal (CPU/memory) and external (R/Python) pools. Shows current configuration settings for minimum and maximum CPU percentages, memory percentages, and IOPS limits per volume. Essential for monitoring resource allocation, troubleshooting performance bottlenecks, and auditing resource governance policies across your SQL Server instances.

Syntax

Get-DbaRgResourcePool
    [[-SqlInstance] <DbaInstanceParameter[]>]
    [[-SqlCredential] <PSCredential>]
    [[-Type] <String>]
    [[-InputObject] <ResourceGovernor[]>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbaRgResourcePool -SqlInstance sql2016

Gets the internal resource pools on sql2016

Example: 2
PS C:\> 'Sql1','Sql2/sqlexpress' | Get-DbaResourceGovernor | Get-DbaRgResourcePool

Gets the internal resource pools on Sql1 and Sql2/sqlexpress instances

Example: 3
PS C:\> 'Sql1','Sql2/sqlexpress' | Get-DbaResourceGovernor | Get-DbaRgResourcePool -Type External

Gets the external resource pools on Sql1 and Sql2/sqlexpress instances

Optional Parameters

-SqlInstance

The target SQL Server instance or instances

PropertyValue
Alias
RequiredFalse
Pipelinetrue (ByValue)
Default Value
-SqlCredential

Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).
Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported.
For MFA support, please use Connect-DbaInstance.

PropertyValue
Alias
RequiredFalse
Pipelinefalse
Default Value
-Type

Specifies whether to retrieve Internal resource pools (CPU/memory) or External resource pools (R/Python services).
Internal pools control SQL Server workloads, while External pools govern Machine Learning Services resource consumption.

PropertyValue
Alias
RequiredFalse
Pipelinefalse
Default ValueInternal
Accepted ValuesInternal,External
-InputObject

Accepts Resource Governor objects from Get-DbaResourceGovernor for pipeline processing.
Use this when you need to filter or process resource pools from multiple instances collected earlier in your script.

PropertyValue
Alias
RequiredFalse
Pipelinetrue (ByValue)
Default Value
-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with “sea of red” exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this “nice by default” feature off and enables you to catch exceptions with your own try/catch.

PropertyValue
Alias
RequiredFalse
Pipelinefalse
Default ValueFalse

Outputs

Microsoft.SqlServer.Management.Smo.ResourcePool (Internal pools) or Microsoft.SqlServer.Management.Smo.ExternalResourcePool (External pools)

Returns one ResourcePool or ExternalResourcePool object per resource pool found on the instance. The object type depends on the -Type parameter:

  • Type “Internal” (default): Returns Microsoft.SqlServer.Management.Smo.ResourcePool objects
  • Type “External”: Returns Microsoft.SqlServer.Management.Smo.ExternalResourcePool objects

Default display properties (via Select-DefaultView):

  • ComputerName: The computer name of the SQL Server instance
  • InstanceName: The SQL Server instance name
  • SqlInstance: The full SQL Server instance name (computer\instance)
  • Id: Unique identifier for the resource pool
  • Name: Name of the resource pool
  • CapCpuPercentage: CPU cap percentage (0-100 for External pools, always 0 for Internal pools)
  • IsSystemObject: Boolean indicating if this is a system-defined resource pool
  • MaximumCpuPercentage: Maximum CPU percentage allocated to this pool (0-100)
  • MaximumIopsPerVolume: Maximum I/O operations per second per volume (External pools only)
  • MaximumMemoryPercentage: Maximum memory percentage allocated to this pool (0-100)
  • MinimumCpuPercentage: Minimum CPU percentage reserved for this pool (0-100)
  • MinimumIopsPerVolume: Minimum I/O operations per second per volume (External pools only)
  • MinimumMemoryPercentage: Minimum memory percentage reserved for this pool (0-100)
  • WorkloadGroups: Collection of workload groups associated with this resource pool

Additional properties available (from SMO ResourcePool or ExternalResourcePool objects):

  • CreateDate: DateTime when the resource pool was created
  • ModifyDate: DateTime when the resource pool was last modified
  • Parent: Reference to the parent ResourceGovernor object
  • State: Current state of the resource pool object (Existing, Creating, Pending, etc.) All properties from the base SMO object are accessible using Select-Object *.