nim_resource – show/define/delete NIM resource object(s).
Synopsis
This module facilitates the display, creation or deletion of NIM resource objects.
Requirements
The below requirements are needed on the host that executes this module.
AIX >= 7.1 TL3
Python >= 3.6
User with root authority to run the nim command.
NIM master software bos.sysmgt.nim.master.
Privileged user with authorization: aix.system.install,aix.system.nim.config.server,aix.system.nim.stat
Parameters
- action (True, str, None)
Specifies the action to be performed.
show
shows all NIM resource objects. Can be used with options name or object_type to filter objects.
create
creates a NIM resource object. It requires options name, object_type and attributes.
delete
deletes a NIM resource object. It requires option name.- name (False, str, None)
Specifies the NIM object name.
- object_type (False, str, None)
NIM resource object’s type.
Required for action action=create.
Optional for action=show.
Some of the choices are provided as examples. For details of all possible NIM resources objects, refer to the IBM documentation at https://www.ibm.com/docs/en/aix/7.2?topic=management-using-nim-resources
The following are examples of the most common choices “pp_source, spot, bosinst_data, mksysb, fb_script and res_group”
- attributes (False, dict, None)
Specifies the attribute-value pairs required for action=create or action=show
- showres (False, dict, None)
show the contents of a resource.
supports spot and lpp_source.
- fetch_contents (optional, bool, False)
determines if the contents of a valid resource type will be fetched.
- max_retries (optional, int, 10)
max number of attempts to fetch the contents a resource.
- retry_wait_time (optional, int, 1)
wait time in seconds in between retrying attempts to fetch the contents of a resorce.
Notes
Note
You can refer to the IBM documentation for additional information on the NIM concept and command at https://www.ibm.com/support/knowledgecenter/ssw_aix_73/install/nim_concepts.html, https://www.ibm.com/support/knowledgecenter/ssw_aix_73/n_commands/nim.html, https://www.ibm.com/support/knowledgecenter/ssw_aix_73/n_commands/nim_master_setup.html.
Examples
- name: Show all NIM resource objects.
ibm.power_aix.nim_resource:
action: show
- name: Create a copy of the images from source to location and
define a NIM lpp_source resource from that location.
ibm.power_aix.nim_resource:
action: create
name: lpp_730
object_type: lpp_resource
attributes:
source: /software/AIX7300
location: /nim1/copy_AIX7300_resource
- name: Define a NIM lpp_source resource object from a directory that
contains the images.
ibm.power_aix.nim_resource:
action: create
name: lpp_730
object_type: lpp_resource
attributes:
location: /nim1/copy_AIX7300_resource
- name: Define a NIM spot (Shared Product Object Tree) resource
using a defined lpp_source.
ibm.power_aix.nim_resource:
action: create
name: spot_730
object_type: spot
attributes:
source: lpp_730
location: /nim1/spot_730_resource
- name: Create a NIM resource group object.
ibm.power_aix.nim_resource:
action: create
name: ResGrp730
object_type: res_group
attributes:
lpp_source: lpp_730
spot: spot_730
bosinst_data: bosinst_data730
comments: "730 Resources"
- name: Show all the defined NIM resource objects.
ibm.power_aix.nim_resource:
action: show
- name: Show all the defined NIM resource objects of type spot.
ibm.power_aix.nim_resource:
action: show
object_type: spot
- name: Show a specific NIM resource object.
ibm.power_aix.nim_resource:
action: show
name: lpp_730
- name: Delete a NIM resource object.
ibm.power_aix.nim_resource:
action: delete
name: spot_730
Return Values
- msg (always, str, Resource spot_730 was removed.)
The execution message.
- rc (If the command failed., int, )
The return code.
- stdout (always, str, )
The standard output.
- stderr (always, str, )
The standard error.
- cmd (always, str, )
Command executed.
- nim_resource_found (If I(action=show)., bool, )
Return if a queried object resource exist.
- nim_resources (If I(action=show)., dict, {‘nim_resources’: {‘lpp_source_test’: {‘Rstate’: ‘ready for use’, ‘alloc_count’: ‘0’, ‘arch’: ‘power’, ‘class’: ‘resources’, ‘location’: ‘/nim1/lpp_source_test4’, ‘prev_state’: ‘unavailable for use’, ‘server’: ‘master’, ‘simages’: ‘yes’, ‘type’: ‘lpp_source’}}})
Dictionary output with the NIM resource object information.
Status
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by community.