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.7.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.
- dbatools PowerShell module 
Parameters
| Parameter | Comments | 
|---|---|
| Specifies the maximum number of simultaneous requests that are allowed to execute in the workload group. | |
| Specifies the relative importance of a request in the workload group. Choices: 
 | |
| Specifies the maximum degree of parallelism (MAXDOP) for parallel query execution. | |
| Specifies the maximum amount of CPU time, in seconds, that a request can use. | |
| Specifies the maximum amount of memory that a single request can take from the pool. | |
| Specifies the maximum time, in seconds, that a query can wait for a memory grant (work buffer memory) to become available. | |
| Name of the resource pool for the workload group. | |
| Specify the type of resource pool. Choices: 
 | |
| The SQL Server instance to modify. | |
| Password for SQL Authentication. | |
| Username for SQL Authentication. | |
| Whether or not the object should be  Choices: 
 | |
| Name of the target workload group. | 
Attributes
| Attribute | Support | Description | 
|---|---|---|
| Support: full | Can run in check_mode and return changed status prediction without modifying target. | |
| 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 | 
|---|---|
| Output from the  Returned: success, but not in check_mode. | 
