cmmodpkg(1m)cmmodpkg(1m)NAMEcmmodpkg - enable or disable switching attributes for a high availabil‐
ity package
SYNOPSIScmmodpkg {-e[-t]|-d} [-n node_name]... [-v] package_name...
cmmodpkg [-v] [-n node_name] -R -s service_name package_name
cmmodpkg [-v] [-m on [-n node_name] | off] package_name ...
DESCRIPTIONcmmodpkg is used to perform runtime administration of Serviceguard
packages. In the first form, it performs two operations. It enables
or disables the ability of a package to switch to another node upon
failure of the package, and it enables or disables a particular node
from running specific packages.
This command may be run on any node within the cluster and may operate
on any package within the cluster. This command is not for use with
SYSTEM_MULTI_NODE packages (HP-UX only) in this first form.
To change a packages's switching attributes, a user must either be a
superuser with effective user ID of zero (see id(1) and su(1)), or have
an access policy of PACKAGE_ADMIN allowed in the cluster or package
configuration file. See access policy in cmquerycl(1m) or
cmmakepkg(1m).
Switching for a package can be enabled or disabled globally. For exam‐
ple, if a globally disabled package of type FAILOVER
fails, it will not switch to any other node, and if a globally enabled
package of type FAILOVER fails, it will attempt to switch to an alter‐
nate node according to its configured failover policy (see
cmmakepkg(1m)).
If the failover policy is CONFIGURED_NODE, the first available node is
chosen by starting at the top of the list of NODE_NAME entries in the
package configuration file and searching for the first node which is
both UP (part of the running cluster) and is enabled for that package.
For example, in a 3 node cluster, where node1, node2, and node3 are the
ordered list of NODE_NAME entries for a package, and the package is
currently running on node2, if node2 were to fail, the package would
first try to run on the primary node, node1.
In the case of the SITE_PREFERRED failover policy, Serviceguard chooses
the first available node by starting at the top of the list of
NODE_NAME entries in the package configuration file and searching for
the first node which is UP (part of the running cluster) and enabled
for that package, and which belongs to the last SITE
the package ran on. If the last SITE is unknown, SITE_PREFERRED
failover behaves identical to CONFIGURED_NODE
In the case of the MIN_PACKAGE_NODE failover policy, the first avail‐
able node is chosen by selecting a node from the list of NODE_NAME
entries, which is UP (part of the running cluster), enabled for that
package, and running the fewest number of other packages.
Switching can be enabled or disabled for a particular node. For exam‐
ple, if a package fails, it may not switch to a disabled node but could
switch to an enabled node.
Enabled simply means that switching is allowed for that package on that
node. Disabled means that switching is not allowed for that package on
that node. The current value for switching attributes can be seen with
the cmviewcl(1m) command and are specified for each package.
The behaviour of multi-node packages is different from that of failover
packages when you enable package switching with cmmodpkg. cmmodpkg will
cause a multi-node package to start for the first time only if auto_run
is disabled; this is different from the behavior with failover pack‐
ages. If a multi-node package has been halted with cmhaltpkg it can be
re-started only via cmrunpkg.
If a package run script fails, if its service fails, or if its subnet
fails on a particular node, there is most likely a package specific
problem with that node. The package switching to that particular node
will be disabled and the package will not be allowed to run there again
until package switching on the node is re-enabled. This prevents auto‐
matic restart/failure loops of the package. The administrator should
determine why the failure occurred and resolve it. Then, re-enable
package switching on that particular node via the -n and -e options.
See EXAMPLES SECTION.
The second form of cmmodpkg is used to reset the service restart
counter for service service_name contained in package package_name.
For package services which utilize the automatic restart facility, the
restart counter is used to determine when a package has exceeded its
restart limit. The restart limit is specified by the RESTART_COUNT
environment variable in the package control script.
The cluster monitor does not automatically reset the restart counter
when a package service has been successfully restarted. When a package
service successfully restarts after several attempts the administrator
may choose to reset the restart counter, thus enabling the service, in
the future, to have the full number of restart attempts up to the
restart limit. The current value of the restart counter may be obtained
by using the cmviewcl(1m) command.
The third form of cmmodpkg is used to place the modular failover pack‐
age(s) in maintenance mode. The package needs to be disabled before it
can be placed in maintenance mode.
When a package is in maintenance mode, SG will turn off monitoring of
package components: subnets, services, EMS resources and filesystems.
The package will not be automatically failed over or halted if any of
these components fail while the package is in maintenance mode.
Options
cmmodpkg supports the following options:
-e Enables package switching. This may cause a currently
down package to be started on a running node (accord‐
ing to its failover policy). If the -n option is
given, package switching will be enabled only for the
specified node(s); otherwise, switching will be
enabled globally. This will not cause the package to
move if the package is currently running elsewhere.
-d Disables package switching. This will not cause a
package to be halted, but it will keep the package
from being switched to a new node should the current
node fail. If the -n option is given, package switch‐
ing will be disabled only for the specified node(s);
otherwise, switching will be disabled globally.
-n node_name
Act on a specific node. If multiple -n options are
specified, each node_name will be enabled or disabled
in the order given on the command line (not in the
order specified in the package configuration file).
If the -n option is not given, switching will be
enabled or disabled globally for the package(s) speci‐
fied. When used in conjunction with -R, this parame‐
ter specifies on which node the service restart count
will be reset.
-R Resets the service restart counter to zero for the
service name specified by the -s option. The service
restart counter is maintained by the package manager
and is incremented each time the service fails. It is
used to determine when a package has exceeded its
restart limit as defined in the package control
script.
-s service_name
Specifies the name of the package service whose
restart counter is to be reset.
-v Verbose output will be displayed.
-t Test only. Provide an assessment of the package place‐
ment without affecting the current state of the nodes
or packages. This option can only be used in conjunc‐
tion with option -e. It validates the node's eligi‐
bility with respect to the package dependencies as
well as the external dependencies such as EMS
resources, package subnets, and storage before pre‐
dicting any package placement decisions.
-m on [-n node_name] | off
Enables/disables maintenance mode. The -m on option
places a package in maintenance mode; the -m off
option brings the package out of maintenance mode.
Package switching for this package must be disabled
before it is placed in or brought out of maintenance
mode. You can place a package in maintenance mode on
a node by using the -n option to specify the node. If
the package is down, you must specify the node. If the
package is running, you do not need to specify the
node, but, if you do, node_name must match the name of
the node where the package is running. While the
package is in maintenance mode on a node, it can only
be started on that node and if the package has weight,
its weight counts toward the node's capacity even if
the package is down. If you use the -m option to par‐
tially start a package which is in maintenance mode,
the package must be halted completely before you bring
it out of maintenance mode. Serviceguard ignores a
package's failures while it is in maintenance mode.
If a package in maintenance mode is running but some
components have failed, the package must be halted
before it can be brought out of maintenance mode.
cmmodpkg command will fail if placing a package in
maintenance mode causes the node's capacity to be
exceeded or placing a package in maintenance mode or
taking it out of maintenance mode causes any package
to halt or restart.
RETURN VALUEcmmodpkg returns the following value:
0 Successful completion.
1 Command failed.
EXAMPLES
Modify the package switching value to be disabled. If the package is
up and its node or any portion of the package fails, the package will
not be moved to another node:
cmmodpkg-d pkg1
Modify the package switching value of multiple packages to be enabled.
This command causes a currently down package to start running on the
first available node:
cmmodpkg-e pkg1 pkg2 pkg3
Modify a list of packages such that they will not be able to move to
node1:
cmmodpkg-n node1 -d pkg1 pkg2
Modify a package such that it will be able to move to node3, node2, or
node1. If the package is currently down but has package switching
enabled, the package will begin running on node3 because node3 is the
first node specified on the command line:
cmmodpkg-n node3 -n node2 -n node1 -e pkg1
Reset the restart counter for service SVC1 in package PKG1.
cmmodpkg-R -s SVC1 PKG1
Place a failover modular package in maintenance mode on node1. The
package is either down or running on node1:
cmmodpkg-m on -n node1 pkg1
Place a failover modular package in maintenance mode on the node where
it is running.
cmmodpkg-m on pkg1
AUTHORcmmodpkg was developed by HP.
SEE ALSOcmmakepkg(1m), cmquerycl(1m), cmhaltpkg(1m), cmrunpkg(1m),
cmviewcl(1m), cmeval(1m).
Requires Optional Serviceguard Software cmmodpkg(1m)