lowlydba.sqlserver.rg_workload_group module – Configures a workload group for use by the Resource Governor

Note

This module is part of the lowlydba.sqlserver collection (version 2.5.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install lowlydba.sqlserver. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: lowlydba.sqlserver.rg_workload_group.

New in lowlydba.sqlserver 0.1.0

Synopsis

  • Creates or modifies a workload group to be used by the Resource Governor. Default values are handled by the Powershell functions themselves.

Requirements

The below requirements are needed on the host that executes this module.

Parameters

Parameter

Comments

group_max_requests

integer

Specifies the maximum number of simultaneous requests that are allowed to execute in the workload group.

importance

string

Specifies the relative importance of a request in the workload group.

Choices:

  • "Low"

  • "Medium"

  • "High"

max_dop

integer

Specifies the maximum degree of parallelism (MAXDOP) for parallel query execution.

request_max_cpu_time

integer

Specifies the maximum amount of CPU time, in seconds, that a request can use.

request_max_mem_grant_perc

integer

Specifies the maximum amount of memory that a single request can take from the pool.

request_mem_grant_timeout_sec

integer

Specifies the maximum time, in seconds, that a query can wait for a memory grant (work buffer memory) to become available.

resource_pool

string / required

Name of the resource pool for the workload group.

resource_pool_type

string

Specify the type of resource pool.

Choices:

  • "Internal" ← (default)

  • "External"

sql_instance

string / required

The SQL Server instance to modify.

sql_password

string

Password for SQL Authentication.

sql_username

string

Username for SQL Authentication.

state

string

Whether or not the object should be present or absent.

Choices:

  • "present" ← (default)

  • "absent"

workload_group

string / required

Name of the target workload group.

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target.

platform

Platforms: all

Target OS/families that can be operated against.

Examples

- name: Enable resource governor
  lowlydba.sqlserver.resource_governor:
    sql_instance: sql-01.myco.io
    enabled: true

- name: Create rg resource pool
  lowlydba.sqlserver.rg_resource_pool:
    sql_instance: sql-01.myco.io
    resource_pool: "rpLittle"
    max_cpu_perc: 5

- name: Create rg workload group
  lowlydba.sqlserver.rg_workload_group:
    sql_instance: sql-01.myco.io
    workload_group: rgMyGroup
    resource_pool: rpLittle
    resource_pool_type: Internal
    max_dop: 2
    state: present

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

data

dictionary

Output from the Set-DbaRgWorkloadGroup, New-DbaRgWorkloadGroup, or Remove-DbaRgWorkloadGroup function.

Returned: success, but not in check_mode.

Authors

  • John McCall (@lowlydba)