Skip to main content

Tunables Overview

Tunables Overview

Tunables refer to parameters that can be modified, reset, or displayed for various components on AIX systems. The module allows users to specify actions such as showing, modifying, or resetting the values of these tunables. Components like 'vmo', 'ioo', 'schedo', 'no', 'raso', 'nfso', and 'asoo' have their own set of tunables that can be managed.

Requirements

The module requires root user access and supports AIX versions 7.1 TL3 and above. Users can specify whether the changes should apply to the current values, reboot values, or both. The module also supports handling restricted tunables, which require special permissions to modify.

Main Functions

There are several main functions in this module. Some of them are create_tunables_dict, get_valid_tunables, show, reset, and modify. We will dive a little into create_tunables_dict and get_valid_tunables.


create_tunables_dict

The create_tunables_dict function is used to create a dictionary of tunables and their values for validation purposes. It runs a command to fetch the current tunables and converts the output into a dictionary.

def create_tunables_dict(module):
'''
Utility function to create tunables dictionary with values

arguments:
module (dict): The Ansible module
note:
Exits with fail_json in case of error
return:
creates a dictionary with all tunables and their values
'''

component = module.params['component']
global tunables_dict
cmd = component + ' -F -x'

rc, std_out, std_err = module.run_command(cmd, use_unsafe_shell=True)

if rc != 0:
# In case command returns non zero return code, fail case
results['msg'] = "Failed to get tunables existing values for validation."

Actions

The module supports three main actions: show, modify, and reset. Each action is handled by its respective function.


show

The show function handles the action of displaying tunable parameters. It forms a command based on the specified component and tunable parameters, executes it, and updates the global results dictionary with the output.

def show(module):
'''
Handles the show action

arguments:
module (dict): The Ansible module
note:
Exits with fail_json in case of error
return:
updated global results dictionary.
'''
tunable_params = module.params['tunable_params']
restricted_tunables = module.params['restricted_tunables']
component = module.params['component']
tunables_to_show = ''
cmd = ''

# according to the component form the initial command
cmd += component + ' '

# Force display of the restricted tunable parameters


modify

The modify function handles the action of modifying tunable parameters. It validates the new values, forms a command based on the specified component and tunable parameters, executes it, and updates the global results dictionary with the output.

def modify(module):
'''
Handles the modify action

arguments:
module (dict): The Ansible module
note:
Exits with fail_json in case of error
return:
Message for successful command along with display standard output
'''

component = module.params['component']
bosboot_tunables = module.params['bosboot_tunables']
change_type = module.params['change_type']
restricted_tunables = module.params['restricted_tunables']
tunable_params_with_value = module.params['tunable_params_with_value']
parameters = ''
changed_tunables = ''
cmd = ''


reset

The reset function handles the action of resetting tunable parameters to their default values. It forms a command based on the specified component and tunable parameters, executes it, and updates the global results dictionary with the output.

def reset(module):
'''
Handles the reset action

arguments:
module (dict): The Ansible module
note:
Exits with fail_json in case of error
return:
Updated global results dictionary
'''

component = module.params['component']
tunable_params = module.params['tunable_params']
bosboot_tunables = module.params['bosboot_tunables']
change_type = module.params['change_type']
restricted_tunables = module.params['restricted_tunables']
changed_tunables = ''
cmd = ''

# use of -r and -p together is prohibited. Reason explained in the message.

Examples

Here are some examples demonstrating how to use the tunables module for different actions.


Modify Tunables

This example demonstrates how to modify vmo tunable parameters using the tunables module.

- name: "Modify vmo tunable parameters"
ibm.power_aix.tunables:
action: modify
component: vmo
tunable_params_with_value:
lgpg_regions: 10


Show Tunables

This example demonstrates how to display information of all dynamic tunable parameters using the tunables module.

  ibm.power_aix.tunables:
action: show
component: vmo


Reset Tunables

This example demonstrates how to reset bosboot tunables using the tunables module.

- name: "Reset bosboot tunables/ restricted bosboot tunables"
# this will only change the REBOOT VALUE and needs bosboot and reboot.
# example of one restricted and one non restricted bosboot tunable
ibm.power_aix.tunables:
action: reset
component: vmo
restricted_tunables: true # because of restricted tunables otherwise default is false
bosboot_tunables: true # because of bosboot tunables otherwise default is false
tunable_params: ['kernel_heap_psize', 'batch_tlb']

 

This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human