Using Serviceguard Node Capacities and Package Weights, April 2009

14
Use case 4: Using Weights with Package Dependencies
If you configure weight for a package which requires another package with weight to be up on the
same node (that is the package specifies a same node dependency on another package), the node
must have sufficient capacity for both packages. For a description of package dependencies, please
refer to the manpage for cmmakepkg (1m) command and the Managing Serviceguard manual.
Say you have a cluster with the following specification (see figure below):
Cluster has two nodes. You estimate that node1 has a capacity of 4 and node2 has a capacity of
3 for running packages.
You have four packages: pkg1, pkg2, pkg3, and pkg4 with priorities 10, 20, 30, and 40
respectively.
All packages are configured to run on both nodes and they all prefer to run on node1 (that is
node1 is the first node in the package’s configured node list).
You estimate that:
pkg1 and pkg2 have a weight of 2
pkg3, and pkg4 have a weight of 1
Pkg1 is the highest priority package and it prefers node1. So, it will run on node1. This means that
node1 has a capacity of 2 available for running other packages. Pkg2 is the 2nd highest priority
package and it also prefers node1. Pkg2 requires pkg3 to run on the same node and together they
have a weight of 3. So, pkg2 cannot run on node1 and will run on node2 instead (along with pkg3).
This means that node2 has no capacity remaining for running other packages. Pkg4 has a weight of
1 and prefers node1 and node1 has sufficient capacity available. So, it will run on node1.
Now if node1 fails, since node2 has no capacity remaining for running other packages, some
packages must be halted to make room for pkg1 which has the highest priority. Pkg1 has a weight of
2. Since node2 does not have sufficient capacity for both pkg1 and pkg2, Serviceguard will halt
pkg2 to make room for pkg1. Pkg1 and pkg3 will run on node2. Pkg4 will go down because it is the
lowest priority package.
Figure 3: Weight and dependency example
Package name = pkg1
Nodes = node1, node2
Priority = 10
Weight value = 2
State = running on node1
Package name = pkg3
Nodes = node1, node2
Priority = 30
Weight value = 1
State = running on node2
Pkg2
depends
on pkg3
to be up
on the
same
node
Package name = pkg4
Nodes = node1, node2
Priority = 40
Weight value = 1
State = running on node1
Node name = node1
Capacity value = 4
Capacity remaining = 1
Node name = node2
Capacity value = 3
Capacity remaining = 0
Package name = pkg2
Nodes = node1, node2
Priority = 20
Weight value = 2
State = running on node2
Package name = pkg1
Nodes = node1, node2
Priority = 10
Weight value = 2
State = running on node1
Package name = pkg3
Nodes = node1, node2
Priority = 30
Weight value = 1
State = running on node2
Pkg2
depends
on pkg3
to be up
on the
same
node
Package name = pkg4
Nodes = node1, node2
Priority = 40
Weight value = 1
State = running on node1
Node name = node1
Capacity value = 4
Capacity remaining = 1
Node name = node2
Capacity value = 3
Capacity remaining = 0
Package name = pkg2
Nodes = node1, node2
Priority = 20
Weight value = 2
State = running on node2