NIM Update IOS Overview
NIM Update IOS Overview
NIM Update IOS refers to the process of using the Network Installation Management (NIM) to perform updates and customization on Virtual I/O
VIOSes
VIOSes
Update Process
The update process involves checking the status of previous operations, stopping the cluster before updating, performing the update, and then restarting the cluster. The module supports actions such as installing new filesets, committing uncommitted updates, cleaning up incomplete installations, and removing specified filesets.
Features
The module includes features like previewing the update operation without making changes, managing clusters during updates, and specifying a time limit for the update operation.
Usage Example
The nim_updateios
VIOSes
-
name
:
Preview
updateios
on
a
pair
of
VIOSes
nim_updateios
:
targets
: 'nimvios01,
nimvios02'
action
:
install
lpp_source
:
723lpp_res
preview
: true
.
This code snippet shows how to use the nim_updateios
VIOSes
VIOSes
'''
EXAMPLES = r'''
- name: Preview updateios on a pair of VIOSes
nim_updateios:
targets: 'nimvios01, nimvios02'
action: install
lpp_source: 723lpp_res
preview: true
- name: Update VIOSes as a pair and a VIOS alone discarding cluster
nim_updateios:
targets:
- nimvios01,nimvios02
- nimvios03
action: install
lpp_source: 723lpp_res
time_limit: '07/21/2020 17:02'
manage_cluster: false
preview: false
- name: Remove a fileset of a VIOS
nim_updateios:
Main Functions
There are several main functions in this folder. Some of them are nim_exec
check_vios_targets
nim_updateios
nim_exec
nim_updateios
nim_exec
nim_exec
The nim_exec
c_rsh
The nim_exec
def nim_exec(module, node, command):
"""
Execute the specified command on the specified nim client using c_rsh.
arguments:
module (dict): The Ansible module
node (dict): nim client to execute the command on to
command (list): command to execute
return:
rc (int) return code of the command
stdout (str) stdout of the command
stderr (str) stderr of the command
"""
cmd = ' '.join(command)
rcmd = f'( LC_ALL=C {cmd} ); echo rc=$?'
cmd = ['/usr/lpp/bos.sysmgt/nim/methods/c_rsh', node, rcmd]
rc, stdout, stderr = module.run_command(cmd)
if rc != 0:
return (rc, stdout, stderr)
check_vios_targets
check_vios_targets
The check_vios_targets
The check_vios_targets
def check_vios_targets(module, targets):
"""
Check the list of VIOS targets.
Check that each target can be reached.
A target name can be of the following form:
vios1,vios2 or vios3
arguments:
module (dict): the Ansible module
targets (list): list of tuple of NIM name of vios machine
return:
res_list (list): The list of the existing vios tuple matching the target list
"""
vios_list = []
res_list = []
# Build targets list
for elems in targets:
module.debug(f'Checking elems: {elems}')
nim_updateios
nim_updateios
The nim_updateios
The nim_updateios
def nim_updateios(module, targets_list, vios_status, time_limit):
"""
Execute the updateios command
For each VIOS tuple,
- retrieve the previous status if any (looking for SUCCESS-HC and SUCCESS-UPDT)
- for each VIOS of the tuple, check the cluster name and node status
- stop the cluster if necessary
- perform the updateios operation
- wait for the copy to finish
- start the cluster if necessary
arguments:
module (dict): The Ansible module
targets_list (list): Target tuple list of VIOS
vios_status (dict): provided previous status for each tuple
time_limit (str): Date and time to perform tuple update
note:
Set the update status in results['status'][vios_key].
return:
none
"""
This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human