Skip to main content

NIM Backup Overview

NIM Backup Overview

NIM Backup refers to the process of creating, listing, viewing, and restoring backup images on LPAR and VIOS clients using the Network Installation Management (NIM) system. The backup operations are performed through the NIM master, which defines mksysb or ios_backup resources depending on the type of client.

The NIM Backup process includes creating a database backup file, transferring and restoring the database backup on the NIM master, and unconfiguring the NIM master machine that needs to be migrated. The backup files are stored in specified locations, and the process can handle different types of backups such as mksysb, ios_mksysb, ios_backup, and savevg.

Main Functions

There are several main functions in this folder. Some of them are nim_mksysb_create, nim_mksysb_restore, nim_iosbackup_create, and nim_iosbackup_restore. We will dive a little into nim_mksysb_create and nim_iosbackup_create.


nim_mksysb_create

The nim_mksysb_create function performs a NIM define operation to create a mksysb backup. It builds the name for the backup, computes the backup location, and constructs the NIM command to create the mksysb resource. If the module is not in check mode, it executes the command and updates the results with the status of the operation.

def nim_mksysb_create(module, target, objtype, params):
"""
Perform a NIM define operation to create a mksysb

arguments:
module (dict): the module variable
target (str): the NIM Client to backup
objtype (str): the type of mksysb to create, can be mksysb or ios_mksysb
params (dict): the NIM command parameters
note:
set results['status'][target] with the status
return:
True if backup succeeded or skipped
False otherwise
"""

name = build_name(target, params['name'], params['name_prefix'], params['name_postfix'])

# compute backup location
if not os.path.exists(params['location']):
os.makedirs(params['location'])


nim_iosbackup_create

The nim_iosbackup_create function performs a define NIM operation to create a backup of a VIOS (ios_backup). It builds the name for the backup, computes the backup location, and constructs the NIM command to create the ios_backup resource. If the module is not in check mode, it executes the command and updates the results with the status of the operation.

def nim_iosbackup_create(module, target, params):
"""
Perform a define NIM operation to create a backup of a VIOS (ios_backup)

arguments:
module (dict): the module variable
target (str): the VIOS NIM Client to backup
params (dict): the NIM command parameters
note:
set results['status'][target] with the status
return:
True if restore succeeded or skipped
False otherwise
"""

name = build_name(target, params['name'], params['name_prefix'], params['name_postfix'])

# compute backup location
if not os.path.exists(params['location']):
os.makedirs(params['location'])
location = os.path.join(params['location'], name)

 

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