Registering a Critical Device

Important - In a Cluster, you must configure all the Cluster Members in the same way.

Description

You can add a user-defined critical device to the default list of critical devices. Use this command to register <device> as a critical process, and add it to the list of devices that must run for the Cluster Member to be considered active. If <device> fails, then the Cluster Member is seen as failed.

If a Critical Device fails to report its state to the Cluster Member in the configured timeout, the Critical Device, and by design the Cluster Member, are seen as failed.

Define the status of the Critical Device that is reported to ClusterXL upon registration.

This initial status can be one of these:

  • ok - Critical Device is alive.

  • init - Critical Device is initializing. The Cluster Member is Down. In this state, the Cluster Member cannot become Active.

  • problem - Critical Device failed. If this state is reported to ClusterXL, the Cluster Member immediately goes Down. This causes a failover.

Syntax

Shell

Command

Gaia Clish

N / A

Expert mode

cphaconf set_pnote -d <Name of Critical Device> -t <Timeout in Sec> -s {ok | init | problem} [-p] [-g] register

Notes:

  • The "-t" flags specifies how frequently to expect the periodic reports from this Critical Device.

    If no periodic reports should be expected, then enter the value 0 (zero).

  • The "-p" flag makes these changes permanent (survive reboot).

  • The "-g" flag applies the command to all configured Virtual Systems.

Restrictions

  • Total number of critical devices (pnotes) on Cluster Member is limited to 16.

  • Name of any critical device (pnote) on Cluster Member is limited to 15 characters, and must not include white spaces.

Example use case

This example assumes that all other Critical Devices report their statues as "ok".

Do these steps on each Cluster Member:

  1. Create a shell script that does these actions:

    1. Examine the used space in the critical disk partitions.

    2. If the used space in these partitions:

      • Is above the threshold, then register a user-defined Critical Device and report its status as "problem".

        As a result, the Cluster Member changes its cluster state to "Down" (if there is at least one Cluster Member in the status "Active").

      • Is below the threshold, then register a user-defined Critical Device and report its status as "ok".

        As a result, the Cluster Member changes its cluster state to "Standby" or "Active".

    Example script syntax:

    #!/bin/bash
    
    # Get the used % in the partition lv_current
    var_lv_current=$(df -h | grep lv_current | awk '{print $5}'| sed 's/[%]//')
    # Get the used % in the partition lv_log
    var_lv_log=$(df -h | grep lv_log | awk '{print $5}'| sed 's/[%]//')
    
    if [ "$var_lv_current" -gt 90 -o "$var_lv_log" -gt 90 ];
        then
            # If the partition is full, then bring the cluster member down
            $FWDIR/bin/cphaconf set_pnote -d Storage -s problem report
        else
            # If the partition is free enough, then bring the cluster member up
            $FWDIR/bin/cphaconf set_pnote -d Storage -s ok report
            $FWDIR/bin/cphaconf set_pnote -d Storage unregister
    fi
    
  2. Configure a scheduled job to run this shell script at the relevant time intervals.

    See the R82 Gaia Administration Guide.