Skip to main content

NIM SUMA Overview

NIM SUMA Overview

NIM SUMA refers to the use of the Service Update Management Assistant (SUMA) to download fixes, service packs (SP), or technology levels (TL) from the IBM Fix Central website. The fixes are downloaded to update specified target systems to a specific technology level or service pack level. The downloaded fixes are then used to create a related NIM resource on the NIM master. This allows users to run another task to install the systems with the new resource. Updates are downloaded based on the lowest technical level of all target systems.

How to Use NIM SUMA

To use NIM SUMA, you need to specify the action (either 'download' or 'preview'), the target systems, the desired OS level, and optionally the download directory and other parameters. The suma_download function handles the process of building the NIM lpp_source list, getting the NIM clients, expanding the target list, and computing the necessary parameters for the SUMA command.

Where NIM SUMA is Used

The NIM SUMA functionality is primarily used in the suma_download function within the plugins/modules/nim_suma.py module.

Example Usage of NIM SUMA

An example usage of NIM SUMA is to check, download, and create the NIM resource to install the latest updates on a target system. This can be done using the nim_suma module with the action set to 'download', specifying the target system and the desired OS level.


This code snippet shows an example of how to use the nim_suma module to check, download, and create the NIM resource to install the latest updates on a target system.

'''

EXAMPLES = r'''
- name: Check, download and create the NIM resource to install latest updates
nim_suma:
action: download
targets: nimclient01
oslevel: Latest
download_dir: /usr/sys/inst.images
'''

Main Functions

There are several main functions in this folder. Some of them are min_oslevel, max_oslevel, nim_exec, run_oslevel_cmd, expand_targets, get_nim_clients, get_oslevels, get_nim_lpp_source, compute_rq_type, find_sp_version, compute_rq_name, compute_filter_ml, compute_lpp_source_name, compute_dl_target, suma_command, and suma_download. We will dive a little into suma_download and suma_command.

suma_download

The suma_download function handles the download or preview action for SUMA. It validates the input parameters, builds the necessary lists of NIM clients and targets, and retrieves the OS levels of the specified targets. It then computes various parameters required for the SUMA command and finally calls the suma_command function to execute the SUMA command.


This code snippet shows the suma_download function which handles the download or preview action for SUMA.

def suma_download(module, suma_params):
"""
Dowload (or preview) action

suma_params['action'] should be set to either 'preview' or 'download'.

arguments:
module (dict): The Ansible module
suma_params (dict): parameters to build the suma command
note:
Exits with fail_json in case of error
"""

targets_list = suma_params['targets']
req_oslevel = suma_params['req_oslevel']

if not targets_list:
if req_oslevel == 'Latest':
msg = 'Oslevel target could not be empty or equal "Latest" when' \
' target machine list is empty'
module.log(msg)

suma_command

The suma_command function constructs and runs the SUMA command based on the provided parameters. It handles the execution of the SUMA command, captures the output, and handles any errors that occur during the execution.


This code snippet shows the suma_command function which constructs and runs the SUMA command based on the provided parameters.

def suma_command(module, action, suma_params):
"""
Run a suma command.

arguments:
module (dict): The Ansible module
action (str): preview or download
suma_params (dict): parameters to build the suma command
note:
Exits with fail_json in case of error
return:
stdout suma command output
"""

rq_type = suma_params['RqType']
if rq_type == 'Latest':
rq_type = 'SP'

cmd_FilterML = suma_params['FilterMl']
cmd_DLTarget = suma_params['DLTarget']
cmd_RqName = suma_params['RqName']

 

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