DRMGR-HOOKS(8)

NAME
drmgr-hooks - Hooks run by drmgr

DESCRIPTION
When drmgr is run to perform PowerVM Dynamic Logical Partitioning (DLPAR) operations, a set of hooks may be triggered to validate, and, or be aware of the incoming operation.

Not all the DLPAR operations are providing hook calls. Currently only the LPAR Migration operation (LPM) is concerned.

The hooks are executable files stored in a directory named "DRC TYPE" in /etc/drmgr.d/. For instance, hooks run when a LPAR migration is done are stored in /etc/drmgr.d/pmig.

Hook files can be symbolic links to executable files. All the hooks can be stored in /etc/drmgr.d and linked into multiple directories to provide multiple DRC type's hooks.

ARGUMENTS

Hooks are called without any arguments but with these environment variables set:

DRC_TYPE
    The Dynamic reconfiguration connector type to act upon from the following list: pmig, pci, cpu, mem, port, slot, phb.

PHASE
    The phase of the operation from the following list: check, undocheck, pre, post.

ACTION
    The action in progress from the following list: add, remove, migrate.

DRC_COUNT
    The number of impacted items.

LPAR MIGRATION

When a LPAR migration is initiated the check phase is first triggered. Hooks called at check phase may returned a non zero value to prevent the migration operation to happen. The error messages displayed in STDOUT or STDERR would be reported to the end user through the HMC.

If the check phase has failed, because at least one hook has returned a non null value, the undocheck phase is launched. Return value for the undocheck phase is ignored.

If the check phase succeeded, the pre and later post phases are triggered. Returned values for these 2 phases are ignored, and the post phase is triggered even if the LPM operation has failed.

The ACTION variable is set always to migrate

The DRC_COUNT variable is set to 0.

CPU
When a CPU DLPAR add or remove operation is initiated, the pre and then post phases are triggered with the ACTION variable set to either add or remove value.

When the pre phase is called, the DRC_COUNT variable contains the desired number of CPU to add or remove. When the post phase is called, DRC_COUNT contains the number of CPU effectively added or removed.

Return values for these 2 phases are ignored.

The post phase is triggered even if the operation has failed.

ENVIRONMENT

The drmgr's hooks are called while holding the DLPAR lock, so any other DLPAR operation initiated from a hook is expected to fail.

The hooks standard input STDIN is redirected to /dev/null while STDOUT and STDERR are redirected to pipes. The outputs done in these pipes are reported to the end user when a hook has returned an error value and that error value is not ignored (e.g in the LPM, the check phase but not the pre or post phase)

Except the variables specified in the ARGUMENTS section, all the environment variables are unset before calling the hook.

FILES
/etc/drmgr.d/pmig/

/etc/drmgr.d/cpu/

AUTHOR
Laurent Dufour <ldufour@linux.ibm.com>

SEE ALSO
drmgr(8)