diff --git a/doc/sphinx/Clusters_from_Scratch/intro.rst b/doc/sphinx/Clusters_from_Scratch/intro.rst
index 733bdd8c60..eac0035379 100644
--- a/doc/sphinx/Clusters_from_Scratch/intro.rst
+++ b/doc/sphinx/Clusters_from_Scratch/intro.rst
@@ -1,29 +1,29 @@
-Read-Me-First
--------------
+Introduction
+------------
The Scope of this Document
##########################
Computer clusters can be used to provide highly available services or
resources. The redundancy of multiple machines is used to guard
against failures of many types.
This document will walk through the installation and setup of simple
clusters using the |CFS_DISTRO| distribution, version |CFS_DISTRO_VER|.
The clusters described here will use Pacemaker and Corosync to provide
resource management and messaging. Required packages and modifications
to their configuration files are described along with the use of the
Pacemaker command line tool for generating the XML used for cluster
control.
Pacemaker is a central component and provides the resource management
required in these systems. This management includes detecting and
recovering from the failure of various nodes, resources and services
under its control.
When more in-depth information is required, and for real-world usage,
please refer to the `Pacemaker Explained `_
manual.
.. include:: ../shared/pacemaker-intro.rst
diff --git a/doc/sphinx/Makefile.am b/doc/sphinx/Makefile.am
index d8ece45b3a..1593607c1f 100644
--- a/doc/sphinx/Makefile.am
+++ b/doc/sphinx/Makefile.am
@@ -1,114 +1,121 @@
#
# Copyright 2003-2020 the Pacemaker project contributors
#
# The version control history for this file may have further details.
#
# This source code is licensed under the GNU General Public License version 2
# or later (GPLv2+) WITHOUT ANY WARRANTY.
#
include $(top_srcdir)/mk/common.mk
# Things you might want to override on the command line
# Books to generate
-BOOKS ?= Clusters_from_Scratch \
- Pacemaker_Administration \
+BOOKS ?= Clusters_from_Scratch \
+ Pacemaker_Administration \
Pacemaker_Development \
+ Pacemaker_Explained \
Pacemaker_Remote
# Output formats to generate. Possible values:
# html (multiple HTML files)
# dirhtml (HTML files named index.html in multiple directories)
# singlehtml (a single large HTML file)
# text
# pdf
# epub
# latex
# linkcheck (not actually a format; check validity of external links)
#
# The results will end up in /_build/
BOOK_FORMATS ?= html
# Set to "a4" or "letter" if building latex format
PAPER ?= letter
# Additional options for sphinx-build
SPHINXFLAGS ?=
# toplevel rsync destination for www targets (without trailing slash)
RSYNC_DEST ?= root@www.clusterlabs.org:/var/www/html
# End of useful overrides
EXTRA_DIST = $(wildcard */*.rst)
# recursive, preserve symlinks/permissions/times, verbose, compress,
# don't cross filesystems, sparse, show progress
RSYNC_OPTS = -rlptvzxS --progress
BOOK_RSYNC_DEST = $(RSYNC_DEST)/$(PACKAGE)/doc/$(PACKAGE_SERIES)
TAG ?= $(shell [ -n "`git tag --points-at HEAD | head -1`" ] \
&& ( git tag --points-at HEAD | head -1 ) \
|| git log --pretty=format:Pacemaker-2.0.3-%h -n 1 HEAD)
BOOK = none
+DEPS_Clusters_from_Scratch = shared/pacemaker-intro.rst
+DEPS_Pacemaker_Administration = shared/pacemaker-intro.rst
+DEPS_Pacemaker_Development =
+DEPS_Pacemaker_Explained = shared/pacemaker-intro.rst
+DEPS_Pacemaker_Remote = $(wildcard $(srcdir)/Pacemaker_Remote/images/*.png)
+
if BUILD_SPHINX_DOCS
$(BOOKS:%=%/conf.py): conf.py.in
$(AM_V_GEN)sed \
-e 's/%VERSION%/$(VERSION)/g' \
-e 's/%BOOK_ID%/$(@:%/conf.py=%)/g' \
-e 's/%BOOK_TITLE%/$(subst _, ,$(@:%/conf.py=%))/g' \
$(<) > "$@"
-$(BOOK)/_build: _static/pacemaker.css $(BOOK)/conf.py $(wildcard $(srcdir)/$(BOOK)/*.rst)
+$(BOOK)/_build: _static/pacemaker.css $(BOOK)/conf.py $(DEPS_$(BOOK)) $(wildcard $(srcdir)/$(BOOK)/*.rst)
@echo 'Building "$(subst _, ,$(BOOK))" because of $?' $(PCMK_quiet)
$(AM_V_at)rm -rf "$@"
$(AM_V_BOOK)for format in $(BOOK_FORMATS); do \
echo -e "\n * Building $$format" $(PCMK_quiet); \
doctrees="doctrees"; \
real_format="$$format"; \
case "$$format" in \
pdf) real_format="latex" ;; \
gettext) doctrees="gettext-doctrees" ;; \
esac; \
$(SPHINX) -b "$$real_format" -d "$@/$$doctrees" \
-c "$(builddir)/$(BOOK)" \
-D latex_paper_size=$(PAPER) $(SPHINXFLAGS) \
"$(srcdir)/$(BOOK)" "$@/$$format" \
$(PCMK_quiet); \
if [ "$$format" = "pdf" ]; then \
$(MAKE) $(AM_MAKEFLAGS) -C "$@/$$format" \
all-pdf; \
fi; \
done
endif
.PHONY: books-upload
books-upload: all
if BUILD_SPHINX_DOCS
@echo "Uploading $(PACKAGE_SERIES) documentation set"
@for book in $(BOOKS); do \
echo " * $$book"; \
buildfile="$$book/_build/build-$(PACKAGE_SERIES).txt"; \
echo "Generated on `date --utc` from version $(TAG)" \
> "$$buildfile"; \
rsync $(RSYNC_OPTS) "$$buildfile" \
$(BOOK_FORMATS:%=$$book/_build/%) \
"$(BOOK_RSYNC_DEST)/$$book/"; \
done
endif
all-local:
if BUILD_SPHINX_DOCS
@for book in $(BOOKS); do \
$(MAKE) $(AM_MAKEFLAGS) BOOK=$$book \
PAPER="$(PAPER)" SPHINXFLAGS="$(SPHINXFLAGS)" \
BOOK_FORMATS="$(BOOK_FORMATS)" $$book/_build; \
done
endif
clean-local:
$(AM_V_at)-rm -rf $(BOOKS:%="$(builddir)/%/_build") $(BOOKS:%="$(builddir)/%/conf.py")
diff --git a/doc/sphinx/Pacemaker_Administration/agents.rst b/doc/sphinx/Pacemaker_Administration/agents.rst
index ba3645e0b2..18e1c5ce13 100644
--- a/doc/sphinx/Pacemaker_Administration/agents.rst
+++ b/doc/sphinx/Pacemaker_Administration/agents.rst
@@ -1,380 +1,380 @@
Resource Agents
---------------
Resource Agent Actions
######################
If one resource depends on another resource via constraints, the cluster will
interpret an expected result as sufficient to continue with dependent actions.
This may cause timing issues if the resource agent start returns before the
service is not only launched but fully ready to perform its function, or if the
resource agent stop returns before the service has fully released all its
claims on system resources. At a minimum, the start or stop should not return
before a status command would return the expected (started or stopped) result.
OCF Resource Agents
###################
Location of Custom Scripts
__________________________
.. index:: OCF resource agents
OCF Resource Agents are found in ``/usr/lib/ocf/resource.d/$PROVIDER``
When creating your own agents, you are encouraged to create a new directory
under ``/usr/lib/ocf/resource.d/`` so that they are not confused with (or
overwritten by) the agents shipped by existing providers.
So, for example, if you choose the provider name of big-corp and want a new
resource named big-app, you would create a resource agent called
``/usr/lib/ocf/resource.d/big-corp/big-app`` and define a resource:
.. code-block: xml
Actions
_______
All OCF resource agents are required to implement the following actions.
-.. table:: Required Actions for OCF Agents
-
-+--------------+-------------+------------------------------------------------+
-| Action | Description | Instructions |
-+==============+=============+================================================+
-| start | Start the | Return 0 on success and an appropriate |
-| | resource | error code otherwise. Must not report |
-| | | success until the resource is fully |
-| | | active. |
-| | | |
-| | | .. index:: |
-| | | pair: start; OCF action |
-| | | pair: start; action |
-+--------------+-------------+------------------------------------------------+
-| stop | Stop the | Return 0 on success and an appropriate |
-| | resource | error code otherwise. Must not report |
-| | | success until the resource is fully |
-| | | stopped. |
-| | | |
-| | | .. index:: |
-| | | pair: stop; OCF action |
-| | | pair: stop; action |
-+--------------+-------------+------------------------------------------------+
-| monitor | Check the | Exit 0 if the resource is running, 7 |
-| | resource's | if it is stopped, and any other OCF |
-| | state | exit code if it is failed. NOTE: The |
-| | | monitor script should test the state |
-| | | of the resource on the local machine |
-| | | only. |
-| | | |
-| | | .. index:: |
-| | | pair: monitor; OCF action |
-| | | pair: monitor; action |
-+--------------+-------------+------------------------------------------------+
-| meta-data | Describe | Provide information about this |
-| | the | resource in the XML format defined by |
-| | resource | the OCF standard. Exit with 0. NOTE: |
-| | | This is *not* required to be performed |
-| | | as root. |
-| | | |
-| | | .. index:: |
-| | | pair: meta-data; OCF action |
-| | | pair: meta-data; action |
-+--------------+-------------+------------------------------------------------+
-| validate-all | Verify the | Return 0 if parameters are valid, 2 if |
-| | supplied | not valid, and 6 if resource is not |
-| | parameters | configured. |
-| | | |
-| | | .. index:: |
-| | | pair: validate-all; OCF action |
-| | | pair: validate-all; action |
-+--------------+-------------+------------------------------------------------+
+.. table:: **Required Actions for OCF Agents**
+
+ +--------------+-------------+------------------------------------------------+
+ | Action | Description | Instructions |
+ +==============+=============+================================================+
+ | start | Start the | Return 0 on success and an appropriate |
+ | | resource | error code otherwise. Must not report |
+ | | | success until the resource is fully |
+ | | | active. |
+ | | | |
+ | | | .. index:: |
+ | | | pair: start; OCF action |
+ | | | pair: start; action |
+ +--------------+-------------+------------------------------------------------+
+ | stop | Stop the | Return 0 on success and an appropriate |
+ | | resource | error code otherwise. Must not report |
+ | | | success until the resource is fully |
+ | | | stopped. |
+ | | | |
+ | | | .. index:: |
+ | | | pair: stop; OCF action |
+ | | | pair: stop; action |
+ +--------------+-------------+------------------------------------------------+
+ | monitor | Check the | Exit 0 if the resource is running, 7 |
+ | | resource's | if it is stopped, and any other OCF |
+ | | state | exit code if it is failed. NOTE: The |
+ | | | monitor script should test the state |
+ | | | of the resource on the local machine |
+ | | | only. |
+ | | | |
+ | | | .. index:: |
+ | | | pair: monitor; OCF action |
+ | | | pair: monitor; action |
+ +--------------+-------------+------------------------------------------------+
+ | meta-data | Describe | Provide information about this |
+ | | the | resource in the XML format defined by |
+ | | resource | the OCF standard. Exit with 0. NOTE: |
+ | | | This is *not* required to be performed |
+ | | | as root. |
+ | | | |
+ | | | .. index:: |
+ | | | pair: meta-data; OCF action |
+ | | | pair: meta-data; action |
+ +--------------+-------------+------------------------------------------------+
+ | validate-all | Verify the | Return 0 if parameters are valid, 2 if |
+ | | supplied | not valid, and 6 if resource is not |
+ | | parameters | configured. |
+ | | | |
+ | | | .. index:: |
+ | | | pair: validate-all; OCF action |
+ | | | pair: validate-all; action |
+ +--------------+-------------+------------------------------------------------+
Additional requirements (not part of the OCF specification) are placed on
agents that will be used for advanced concepts such as clone resources.
-.. table:: Optional Actions for OCF Resource Agents
-
-+--------------+-------------+------------------------------------------------+
-| Action | Description | Instructions |
-+==============+=============+================================================+
-| promote | Promote the | Return 0 on success |
-| | local | |
-| | instance of | .. index:: |
-| | a promotable| pair: promote; OCF action |
-| | clone | pair: promote; action |
-| | resource to | |
-| | the master | |
-| | (primary) | |
-| | state. | |
-+--------------+-------------+------------------------------------------------+
-| demote | Demote the | Return 0 on success |
-| | local | |
-| | instance of | .. index:: |
-| | a promotable| pair: demote; OCF action |
-| | clone | pair: demote; action |
-| | resource to | |
-| | the slave | |
-| | (secondary) | |
-| | state. | |
-+--------------+-------------+------------------------------------------------+
-| notify | Used by the | Must not fail. Must exit with 0 |
-| | cluster to | |
-| | send | .. index:: |
-| | the agent | pair: notify; OCF action |
-| | pre- and | pair: notify; action |
-| | post- | |
-| | notification| |
-| | events | |
-| | telling the | |
-| | resource | |
-| | what has | |
-| | happened and| |
-| | will happen.| |
-+--------------+-------------+------------------------------------------------+
+.. table:: **Optional Actions for OCF Resource Agents**
+
+ +--------------+-------------+------------------------------------------------+
+ | Action | Description | Instructions |
+ +==============+=============+================================================+
+ | promote | Promote the | Return 0 on success |
+ | | local | |
+ | | instance of | .. index:: |
+ | | a promotable| pair: promote; OCF action |
+ | | clone | pair: promote; action |
+ | | resource to | |
+ | | the master | |
+ | | (primary) | |
+ | | state. | |
+ +--------------+-------------+------------------------------------------------+
+ | demote | Demote the | Return 0 on success |
+ | | local | |
+ | | instance of | .. index:: |
+ | | a promotable| pair: demote; OCF action |
+ | | clone | pair: demote; action |
+ | | resource to | |
+ | | the slave | |
+ | | (secondary) | |
+ | | state. | |
+ +--------------+-------------+------------------------------------------------+
+ | notify | Used by the | Must not fail. Must exit with 0 |
+ | | cluster to | |
+ | | send | .. index:: |
+ | | the agent | pair: notify; OCF action |
+ | | pre- and | pair: notify; action |
+ | | post- | |
+ | | notification| |
+ | | events | |
+ | | telling the | |
+ | | resource | |
+ | | what has | |
+ | | happened and| |
+ | | will happen.| |
+ +--------------+-------------+------------------------------------------------+
One action specified in the OCF specs, ``recover``, is not currently used by
the cluster. It is intended to be a variant of the ``start`` action that tries
to recover a resource locally.
.. important::
- If you create a new OCF resource agent, use `ocf-tester` to verify that the
- agent complies with the OCF standard properly.
+ If you create a new OCF resource agent, use `ocf-tester` to verify that the
+ agent complies with the OCF standard properly.
.. index:: ocf-tester
How are OCF Return Codes Interpreted?
_____________________________________
The first thing the cluster does is to check the return code against
the expected result. If the result does not match the expected value,
then the operation is considered to have failed, and recovery action is
initiated.
There are three types of failure recovery:
-.. table:: Types of recovery performed by the cluster
-
-+-------+------------------------------+--------------------------------------+
-| Type | Description | Action Taken by the Cluster |
-+=======+==============================+======================================+
-| soft | A transient error occurred | Restart the resource or move it to a |
-| | | new location |
-| | .. index:: | |
-| | pair: soft; OCF error | |
-+-------+------------------------------+--------------------------------------+
-| hard | A non-transient error that | Move the resource elsewhere and |
-| | may be specific to the | prevent it from being retried on the |
-| | current node | current node |
-| | | |
-| | .. index:: | |
-| | pair: hard; OCF error | |
-+-------+------------------------------+--------------------------------------+
-| fatal | A non-transient error that | Stop the resource and prevent it |
-| | will be common to all | from being started on any cluster |
-| | cluster nodes (e.g. a bad | node |
-| | configuration was specified) | |
-| | | |
-| | .. index:: | |
-| | pair: fatal; OCF error | |
-+-------+------------------------------+--------------------------------------+
+.. table:: **Types of recovery performed by the cluster**
+
+ +-------+------------------------------+--------------------------------------+
+ | Type | Description | Action Taken by the Cluster |
+ +=======+==============================+======================================+
+ | soft | A transient error occurred | Restart the resource or move it to a |
+ | | | new location |
+ | | .. index:: | |
+ | | pair: soft; OCF error | |
+ +-------+------------------------------+--------------------------------------+
+ | hard | A non-transient error that | Move the resource elsewhere and |
+ | | may be specific to the | prevent it from being retried on the |
+ | | current node | current node |
+ | | | |
+ | | .. index:: | |
+ | | pair: hard; OCF error | |
+ +-------+------------------------------+--------------------------------------+
+ | fatal | A non-transient error that | Stop the resource and prevent it |
+ | | will be common to all | from being started on any cluster |
+ | | cluster nodes (e.g. a bad | node |
+ | | configuration was specified) | |
+ | | | |
+ | | .. index:: | |
+ | | pair: fatal; OCF error | |
+ +-------+------------------------------+--------------------------------------+
.. _ocf_return_codes:
OCF Return Codes
________________
The following table outlines the different OCF return codes and the type of
recovery the cluster will initiate when a failure code is received. Although
counterintuitive, even actions that return 0 (aka. ``OCF_SUCCESS``) can be
considered to have failed, if 0 was not the expected return value.
-.. table:: OCF Exit Codes and their Recovery Types
-
-+-------+-----------------------+---------------------------------------------+----------+
-| Exit | OCF Alias | Description | Recovery |
-| Code | | | |
-+=======+=======================+=============================================+==========+
-| 0 | OCF_SUCCESS | Success. The command completed successfully.| soft |
-| | | This is the expected result for all start, | |
-| | | stop, promote and demote commands. | |
-| | | | |
-| | | .. index:: | |
-| | | pair: return code; OCF_SUCCESS | |
-| | | pair: return code; 0 | |
-+-------+-----------------------+---------------------------------------------+----------+
-| 1 | OCF_ERR_GENERIC | Generic "there was a problem" | soft |
-| | | error code. | |
-| | | | |
-| | | .. index:: | |
-| | | pair: return code; OCF_ERR_GENERIC | |
-| | | pair: return code; 1 | |
-+-------+-----------------------+---------------------------------------------+----------+
-| 2 | OCF_ERR_ARGS | The resource's configuration is not valid on| hard |
-| | | this machine. E.g. it refers to a location | |
-| | | not found on the node. | |
-| | | | |
-| | | .. index:: | |
-| | | pair: return code; OCF_ERR_ARGS | |
-| | | pair: return code; 2 | |
-+-------+-----------------------+---------------------------------------------+----------+
-| 3 | OCF_ERR_UNIMPLEMENTED | The requested action is not | hard |
-| | | implemented. | |
-| | | | |
-| | | .. index:: | |
-| | | pair: return code; OCF_ERR_UNIMPLEMENTED | |
-| | | pair: return code; 3 | |
-+-------+-----------------------+---------------------------------------------+----------+
-| 4 | OCF_ERR_PERM | The resource agent does not have | hard |
-| | | sufficient privileges to complete the task. | |
-| | | | |
-| | | .. index:: | |
-| | | pair: return code; OCF_ERR_PERM | |
-| | | pair: return code; 4 | |
-+-------+-----------------------+---------------------------------------------+----------+
-| 5 | OCF_ERR_INSTALLED | The tools required by the resource are | hard |
-| | | not installed on this machine. | |
-| | | | |
-| | | .. index:: | |
-| | | pair: return code; OCF_ERR_INSTALLED | |
-| | | pair: return code; 5 | |
-+-------+-----------------------+---------------------------------------------+----------+
-| 6 | OCF_ERR_CONFIGURED | The resource's configuration is invalid. | fatal |
-| | | E.g. required parameters are missing. | |
-| | | | |
-| | | .. index:: | |
-| | | pair: return code; OCF_ERR_CONFIGURED | |
-| | | pair: return code; 6 | |
-+-------+-----------------------+---------------------------------------------+----------+
-| 7 | OCF_NOT_RUNNING | The resource is safely stopped. The cluster | N/A |
-| | | will not attempt to stop a resource that | |
-| | | returns this for any action. | |
-| | | | |
-| | | .. index:: | |
-| | | pair: return code; OCF_NOT_RUNNING | |
-| | | pair: return code; 7 | |
-+-------+-----------------------+---------------------------------------------+----------+
-| 8 | OCF_RUNNING_MASTER | The resource is running in | soft |
-| | | master mode. | |
-| | | | |
-| | | .. index:: | |
-| | | pair: return code; OCF_RUNNING_MASTER | |
-| | | pair: return code; 8 | |
-+-------+-----------------------+---------------------------------------------+----------+
-| 9 | OCF_FAILED_MASTER | The resource is in master mode but has | soft |
-| | | failed. The resource will be demoted, | |
-| | | stopped and then started (and possibly | |
-| | | promoted) again. | |
-| | | | |
-| | | .. index:: | |
-| | | pair: return code; OCF_FAILED_MASTER | |
-| | | pair: return code; 9 | |
-+-------+-----------------------+---------------------------------------------+----------+
-| other | *none* | Custom error code. | soft |
-| | | | |
-| | | .. index:: | |
-| | | pair: return code; other | |
-+-------+-----------------------+---------------------------------------------+----------+
+.. table:: **OCF Exit Codes and their Recovery Types**
+
+ +-------+-----------------------+---------------------------------------------+----------+
+ | Exit | OCF Alias | Description | Recovery |
+ | Code | | | |
+ +=======+=======================+=============================================+==========+
+ | 0 | OCF_SUCCESS | Success. The command completed successfully.| soft |
+ | | | This is the expected result for all start, | |
+ | | | stop, promote and demote commands. | |
+ | | | | |
+ | | | .. index:: | |
+ | | | pair: return code; OCF_SUCCESS | |
+ | | | pair: return code; 0 | |
+ +-------+-----------------------+---------------------------------------------+----------+
+ | 1 | OCF_ERR_GENERIC | Generic "there was a problem" | soft |
+ | | | error code. | |
+ | | | | |
+ | | | .. index:: | |
+ | | | pair: return code; OCF_ERR_GENERIC | |
+ | | | pair: return code; 1 | |
+ +-------+-----------------------+---------------------------------------------+----------+
+ | 2 | OCF_ERR_ARGS | The resource's configuration is not valid on| hard |
+ | | | this machine. E.g. it refers to a location | |
+ | | | not found on the node. | |
+ | | | | |
+ | | | .. index:: | |
+ | | | pair: return code; OCF_ERR_ARGS | |
+ | | | pair: return code; 2 | |
+ +-------+-----------------------+---------------------------------------------+----------+
+ | 3 | OCF_ERR_UNIMPLEMENTED | The requested action is not | hard |
+ | | | implemented. | |
+ | | | | |
+ | | | .. index:: | |
+ | | | pair: return code; OCF_ERR_UNIMPLEMENTED | |
+ | | | pair: return code; 3 | |
+ +-------+-----------------------+---------------------------------------------+----------+
+ | 4 | OCF_ERR_PERM | The resource agent does not have | hard |
+ | | | sufficient privileges to complete the task. | |
+ | | | | |
+ | | | .. index:: | |
+ | | | pair: return code; OCF_ERR_PERM | |
+ | | | pair: return code; 4 | |
+ +-------+-----------------------+---------------------------------------------+----------+
+ | 5 | OCF_ERR_INSTALLED | The tools required by the resource are | hard |
+ | | | not installed on this machine. | |
+ | | | | |
+ | | | .. index:: | |
+ | | | pair: return code; OCF_ERR_INSTALLED | |
+ | | | pair: return code; 5 | |
+ +-------+-----------------------+---------------------------------------------+----------+
+ | 6 | OCF_ERR_CONFIGURED | The resource's configuration is invalid. | fatal |
+ | | | E.g. required parameters are missing. | |
+ | | | | |
+ | | | .. index:: | |
+ | | | pair: return code; OCF_ERR_CONFIGURED | |
+ | | | pair: return code; 6 | |
+ +-------+-----------------------+---------------------------------------------+----------+
+ | 7 | OCF_NOT_RUNNING | The resource is safely stopped. The cluster | N/A |
+ | | | will not attempt to stop a resource that | |
+ | | | returns this for any action. | |
+ | | | | |
+ | | | .. index:: | |
+ | | | pair: return code; OCF_NOT_RUNNING | |
+ | | | pair: return code; 7 | |
+ +-------+-----------------------+---------------------------------------------+----------+
+ | 8 | OCF_RUNNING_MASTER | The resource is running in | soft |
+ | | | master mode. | |
+ | | | | |
+ | | | .. index:: | |
+ | | | pair: return code; OCF_RUNNING_MASTER | |
+ | | | pair: return code; 8 | |
+ +-------+-----------------------+---------------------------------------------+----------+
+ | 9 | OCF_FAILED_MASTER | The resource is in master mode but has | soft |
+ | | | failed. The resource will be demoted, | |
+ | | | stopped and then started (and possibly | |
+ | | | promoted) again. | |
+ | | | | |
+ | | | .. index:: | |
+ | | | pair: return code; OCF_FAILED_MASTER | |
+ | | | pair: return code; 9 | |
+ +-------+-----------------------+---------------------------------------------+----------+
+ | other | *none* | Custom error code. | soft |
+ | | | | |
+ | | | .. index:: | |
+ | | | pair: return code; other | |
+ +-------+-----------------------+---------------------------------------------+----------+
Exceptions to the recovery handling described above:
* Probes (non-recurring monitor actions) that find a resource active
(or in master mode) will not result in recovery action unless it is
also found active elsewhere.
* The recovery action taken when a resource is found active more than
once is determined by the resource's ``multiple-active`` property.
* Recurring actions that return ``OCF_ERR_UNIMPLEMENTED``
do not cause any type of recovery.
LSB Resource Agents (Init Scripts)
##################################
LSB Compliance
______________
The relevant part of the
`LSB specifications `_
includes a description of all the return codes listed here.
Assuming `some_service` is configured correctly and currently
inactive, the following sequence will help you determine if it is
LSB-compatible:
#. Start (stopped):
.. code-block:: none
# /etc/init.d/some_service start ; echo "result: $?"
* Did the service start?
* Did the echo command print ``result: 0`` (in addition to the init script's
usual output)?
#. Status (running):
.. code-block:: none
# /etc/init.d/some_service status ; echo "result: $?"
* Did the script accept the command?
* Did the script indicate the service was running?
* Did the echo command print ``result: 0`` (in addition to the init script's
usual output)?
#. Start (running):
.. code-block:: none
# /etc/init.d/some_service start ; echo "result: $?"
* Is the service still running?
* Did the echo command print ``result: 0`` (in addition to the init
script's usual output)?
#. Stop (running):
.. code-block:: none
# /etc/init.d/some_service stop ; echo "result: $?"
* Was the service stopped?
* Did the echo command print ``result: 0`` (in addition to the init
script's usual output)?
#. Status (stopped):
.. code-block:: none
# /etc/init.d/some_service status ; echo "result: $?"
* Did the script accept the command?
* Did the script indicate the service was not running?
* Did the echo command print ``result: 3`` (in addition to the init
script's usual output)?
#. Stop (stopped):
.. code-block:: none
# /etc/init.d/some_service stop ; echo "result: $?"
* Is the service still stopped?
* Did the echo command print ``result: 0`` (in addition to the init
script's usual output)?
#. Status (failed):
This step is not readily testable and relies on manual inspection of the script.
The script can use one of the error codes (other than 3) listed in the
LSB spec to indicate that it is active but failed. This tells the
cluster that before moving the resource to another node, it needs to
stop it on the existing one first.
If the answer to any of the above questions is no, then the script is not
LSB-compliant. Your options are then to either fix the script or write an OCF
agent based on the existing script.
diff --git a/doc/sphinx/Pacemaker_Administration/configuring.rst b/doc/sphinx/Pacemaker_Administration/configuring.rst
index 626c396bbb..b0321f1909 100644
--- a/doc/sphinx/Pacemaker_Administration/configuring.rst
+++ b/doc/sphinx/Pacemaker_Administration/configuring.rst
@@ -1,264 +1,264 @@
Configuring Pacemaker
---------------------
Pacemaker's configuration, the CIB, is stored in XML format. Cluster
administrators have multiple options for modifying the configuration either via
the XML, or at a more abstract (and easier for humans to understand) level.
Pacemaker reacts to configuration changes as soon as they are saved.
Pacemaker's command-line tools and most higher-level tools provide the ability
to batch changes together and commit them at once, rather than make a series of
small changes, which could cause avoid unnecessary actions as Pacemaker
responds to each change individually.
Pacemaker tracks revisions to the configuration and will reject any update
older than the current revision. Thus, it is a good idea to serialize all
changes to the configuration. Avoid attempting simultaneous changes, whether on
the same node or different nodes, and whether manually or using some automated
configuration tool.
.. note::
It is not necessary to update the configuration on all cluster nodes.
Pacemaker immediately synchronizes changes to all active members of the
cluster. To reduce bandwidth, the cluster only broadcasts the incremental
updates that result from your changes and uses checksums to ensure that each
copy is consistent.
Configuration Using Higher-level Tools
______________________________________
Most users will benefit from using higher-level tools provided by projects
separate from Pacemaker. Some of the most commonly used include the crm shell,
hawk, and pcs. [#]_
See those projects' documentation for details on how to configure Pacemaker
using them.
Configuration Using Pacemaker's Command-Line Tools
__________________________________________________
Pacemaker provides lower-level, command-line tools to manage the cluster. Most
configuration tasks can be performed with these tools, without needing any XML
knowledge.
To enable STONITH for example, one could run:
.. code-block:: none
# crm_attribute --name stonith-enabled --update 1
Or, to check whether **node1** is allowed to run resources, there is:
.. code-block:: none
# crm_standby --query --node node1
Or, to change the failure threshold of **my-test-rsc**, one can use:
.. code-block:: none
# crm_resource -r my-test-rsc --set-parameter migration-threshold --parameter-value 3 --meta
Examples of using these tools for specific cases will be given throughout this
document where appropriate. See the man pages for further details.
See :ref:`cibadmin` for how to edit the CIB using XML.
See :ref:`crm_shadow` for a way to make a series of changes, then commit them
all at once to the live cluster.
Working with CIB Properties
###########################
Although these fields can be written to by the user, in
most cases the cluster will overwrite any values specified by the
user with the "correct" ones.
To change the ones that can be specified by the user, for example
``admin_epoch``, one should use:
.. code-block:: none
# cibadmin --modify --xml-text ''
A complete set of CIB properties will look something like this:
.. topic:: XML attributes set for a cib element
.. code-block:: xml
Querying and Setting Cluster Options
####################################
.. index::
pair: cluster option; querying
pair: cluster option; setting
Cluster options can be queried and modified using the ``crm_attribute`` tool.
To get the current value of ``cluster-delay``, you can run:
.. code-block:: none
# crm_attribute --query --name cluster-delay
which is more simply written as
.. code-block:: none
# crm_attribute -G -n cluster-delay
If a value is found, you'll see a result like this:
.. code-block:: none
# crm_attribute -G -n cluster-delay
scope=crm_config name=cluster-delay value=60s
If no value is found, the tool will display an error:
.. code-block:: none
# crm_attribute -G -n clusta-deway
scope=crm_config name=clusta-deway value=(null)
Error performing operation: No such device or address
To use a different value (for example, 30 seconds), simply run:
.. code-block:: none
# crm_attribute --name cluster-delay --update 30s
To go back to the cluster's default value, you can delete the value, for example:
.. code-block:: none
# crm_attribute --name cluster-delay --delete
Deleted crm_config option: id=cib-bootstrap-options-cluster-delay name=cluster-delay
When Options are Listed More Than Once
______________________________________
If you ever see something like the following, it means that the option you're
modifying is present more than once.
.. topic:: Deleting an option that is listed twice
.. code-block:: none
# crm_attribute --name batch-limit --delete
Multiple attributes match name=batch-limit in crm_config:
Value: 50 (set=cib-bootstrap-options, id=cib-bootstrap-options-batch-limit)
Value: 100 (set=custom, id=custom-batch-limit)
Please choose from one of the matches above and supply the 'id' with --id
In such cases, follow the on-screen instructions to perform the requested
action. To determine which value is currently being used by the cluster, refer
to the "Rules" chapter of *Pacemaker Explained*.
.. _remote_connection:
Connecting from a Remote Machine
################################
.. index::
pair: cluster; remote connection
pair: cluster; remote administration
Provided Pacemaker is installed on a machine, it is possible to connect to the
cluster even if the machine itself is not in the same cluster. To do this, one
simply sets up a number of environment variables and runs the same commands as
when working on a cluster node.
-.. table:: Environment Variables Used to Connect to Remote Instances of the CIB
-
-+----------------------+-----------+----------------------------------------------+
-| Environment Variable | Default | Description |
-+======================+===========+==============================================+
-| CIB_user | $USER | The user to connect as. Needs to be |
-| | | part of the ``haclient`` group on |
-| | | the target host. |
-| | | |
-| | | .. index:: |
-| | | pair: environment variable; CIB_user |
-+----------------------+-----------+----------------------------------------------+
-| CIB_passwd | | The user's password. Read from the |
-| | | command line if unset. |
-| | | |
-| | | .. index:: |
-| | | pair: environment variable; CIB_passwd |
-+----------------------+-----------+----------------------------------------------+
-| CIB_server | localhost | The host to contact |
-| | | |
-| | | .. index:: |
-| | | pair: environment variable; CIB_server |
-+----------------------+-----------+----------------------------------------------+
-| CIB_port | | The port on which to contact the server; |
-| | | required. |
-| | | |
-| | | .. index:: |
-| | | pair: environment variable; CIB_port |
-+----------------------+-----------+----------------------------------------------+
-| CIB_encrypted | TRUE | Whether to encrypt network traffic |
-| | | |
-| | | .. index:: |
-| | | pair: environment variable; CIB_encrypted |
-+----------------------+-----------+----------------------------------------------+
+.. table:: **Environment Variables Used to Connect to Remote Instances of the CIB**
+
+ +----------------------+-----------+----------------------------------------------+
+ | Environment Variable | Default | Description |
+ +======================+===========+==============================================+
+ | CIB_user | $USER | The user to connect as. Needs to be |
+ | | | part of the ``haclient`` group on |
+ | | | the target host. |
+ | | | |
+ | | | .. index:: |
+ | | | pair: environment variable; CIB_user |
+ +----------------------+-----------+----------------------------------------------+
+ | CIB_passwd | | The user's password. Read from the |
+ | | | command line if unset. |
+ | | | |
+ | | | .. index:: |
+ | | | pair: environment variable; CIB_passwd |
+ +----------------------+-----------+----------------------------------------------+
+ | CIB_server | localhost | The host to contact |
+ | | | |
+ | | | .. index:: |
+ | | | pair: environment variable; CIB_server |
+ +----------------------+-----------+----------------------------------------------+
+ | CIB_port | | The port on which to contact the server; |
+ | | | required. |
+ | | | |
+ | | | .. index:: |
+ | | | pair: environment variable; CIB_port |
+ +----------------------+-----------+----------------------------------------------+
+ | CIB_encrypted | TRUE | Whether to encrypt network traffic |
+ | | | |
+ | | | .. index:: |
+ | | | pair: environment variable; CIB_encrypted |
+ +----------------------+-----------+----------------------------------------------+
So, if **c001n01** is an active cluster node and is listening on port 1234
for connections, and **someuser** is a member of the **haclient** group,
then the following would prompt for **someuser**'s password and return
the cluster's current configuration:
.. code-block:: none
# export CIB_port=1234; export CIB_server=c001n01; export CIB_user=someuser;
# cibadmin -Q
For security reasons, the cluster does not listen for remote connections by
default. If you wish to allow remote access, you need to set the
``remote-tls-port`` (encrypted) or ``remote-clear-port`` (unencrypted) CIB
properties (i.e., those kept in the ``cib`` tag, like ``num_updates`` and
``epoch``).
-.. table:: Extra top-level CIB properties for remote access
-
-+----------------------+-----------+------------------------------------------------------+
-| CIB Property | Default | Description |
-+======================+===========+======================================================+
-| remote-tls-port | | Listen for encrypted remote connections |
-| | | on this port. |
-| | | |
-| | | .. index:: |
-| | | pair: remote connection option; remote-tls-port |
-+----------------------+-----------+------------------------------------------------------+
-| remote-clear-port | | Listen for plaintext remote connections |
-| | | on this port. |
-| | | |
-| | | .. index:: |
-| | | pair: remote connection option; remote-clear-port |
-+----------------------+-----------+------------------------------------------------------+
+.. table:: **Extra top-level CIB properties for remote access**
+
+ +----------------------+-----------+------------------------------------------------------+
+ | CIB Property | Default | Description |
+ +======================+===========+======================================================+
+ | remote-tls-port | | Listen for encrypted remote connections |
+ | | | on this port. |
+ | | | |
+ | | | .. index:: |
+ | | | pair: remote connection option; remote-tls-port |
+ +----------------------+-----------+------------------------------------------------------+
+ | remote-clear-port | | Listen for plaintext remote connections |
+ | | | on this port. |
+ | | | |
+ | | | .. index:: |
+ | | | pair: remote connection option; remote-clear-port |
+ +----------------------+-----------+------------------------------------------------------+
.. important::
The Pacemaker version on the administration host must be the same or greater
than the version(s) on the cluster nodes. Otherwise, it may not have the
schema files necessary to validate the CIB.
.. rubric:: Footnotes
.. [#] For a list, see "Configuration Tools" at
https://clusterlabs.org/components.html
diff --git a/doc/sphinx/Pacemaker_Administration/tools.rst b/doc/sphinx/Pacemaker_Administration/tools.rst
index 603bfbc101..aff767d9e9 100644
--- a/doc/sphinx/Pacemaker_Administration/tools.rst
+++ b/doc/sphinx/Pacemaker_Administration/tools.rst
@@ -1,553 +1,553 @@
Using Pacemaker Command-Line Tools
----------------------------------
.. _cmdline_output:
Controlling Command Line Output
###############################
Some of the pacemaker command line utilities have been converted to a new
output system. Among these tools are ``crm_mon`` and ``stonith_admin``. This
is an ongoing project, and more tools will be converted over time. This system
lets you control the formatting of output with ``--output-as=`` and the
destination of output with ``--output-to=``.
The available formats vary by tool, but at least plain text and XML are
supported by all tools that use the new system. The default format is plain
text. The default destination is stdout but can be redirected to any file.
Some formats support command line options for changing the style of the output.
For instance:
.. code-block:: none
# crm_mon --help-output
Usage:
crm_mon [OPTION?]
Provides a summary of cluster's current state.
Outputs varying levels of detail in a number of different formats.
Output Options:
--output-as=FORMAT Specify output format as one of: console (default), html, text, xml
--output-to=DEST Specify file name for output (or "-" for stdout)
--html-cgi Add text needed to use output in a CGI program
--html-stylesheet=URI Link to an external CSS stylesheet
--html-title=TITLE Page title
--text-fancy Use more highly formatted output
.. _crm_mon:
Monitor a Cluster with crm_mon
##############################
.. index::
pair: command-line tool; crm_mon
The ``crm_mon`` utility displays the current state of an active cluster. It can
show the cluster status organized by node or by resource, and can be used in
either single-shot or dynamically updating mode. It can also display operations
performed and information about failures.
Using this tool, you can examine the state of the cluster for irregularities,
and see how it responds when you cause or simulate failures.
See the manual page or the output of ``crm_mon --help`` for a full description
of its many options.
.. topic:: Sample output from crm_mon -1
.. code-block:: none
Cluster Summary:
* Stack: corosync
* Current DC: node2 (version 2.0.0-1) - partition with quorum
* Last updated: Mon Jan 29 12:18:42 2018
* Last change: Mon Jan 29 12:18:40 2018 by root via crm_attribute on node3
* 5 nodes configured
* 2 resources configured
Node List:
* Online: [ node1 node2 node3 node4 node5 ]
* Active resources:
* Fencing (stonith:fence_xvm): Started node1
* IP (ocf:heartbeat:IPaddr2): Started node2
.. topic:: Sample output from crm_mon -n -1
.. code-block:: none
Cluster Summary:
* Stack: corosync
* Current DC: node2 (version 2.0.0-1) - partition with quorum
* Last updated: Mon Jan 29 12:21:48 2018
* Last change: Mon Jan 29 12:18:40 2018 by root via crm_attribute on node3
* 5 nodes configured
* 2 resources configured
* Node List:
* Node node1: online
* Fencing (stonith:fence_xvm): Started
* Node node2: online
* IP (ocf:heartbeat:IPaddr2): Started
* Node node3: online
* Node node4: online
* Node node5: online
As mentioned in an earlier chapter, the DC is the node is where decisions are
made. The cluster elects a node to be DC as needed. The only significance of
the choice of DC to an administrator is the fact that its logs will have the
most information about why decisions were made.
.. _crm_mon_css:
Styling crm_mon output
______________________
.. index::
pair: crm_mon; CSS
Various parts of ``crm_mon``'s HTML output have a CSS class associated with
them. Not everything does, but some of the most interesting portions do. In
the following example, the status of each node has an ``online`` class and the
details of each resource have an ``rsc-ok`` class.
.. code-block:: html
Node List
Node: cluster01 online
ping (ocf::pacemaker:ping): Started
Node: cluster02 online
ping (ocf::pacemaker:ping): Started
By default, a stylesheet for styling these classes is included in the head of
the HTML output. The relevant portions of this stylesheet that would be used
in the above example is:
.. code-block:: css
If you want to override some or all of the styling, simply create your own
stylesheet, place it on a web server, and pass ``--html-stylesheet=``
to ``crm_mon``. The link is added after the default stylesheet, so your
changes take precedence. You don't need to duplicate the entire default.
Only include what you want to change.
.. _cibadmin:
Edit the CIB XML with cibadmin
##############################
.. index::
pair: command-line tool; cibadmin
The most flexible tool for modifying the configuration is Pacemaker's
``cibadmin`` command. With ``cibadmin``, you can query, add, remove, update
or replace any part of the configuration. All changes take effect immediately,
so there is no need to perform a reload-like operation.
The simplest way of using ``cibadmin`` is to use it to save the current
configuration to a temporary file, edit that file with your favorite
text or XML editor, and then upload the revised configuration.
.. topic:: Safely using an editor to modify the cluster configuration
.. code-block:: none
# cibadmin --query > tmp.xml
# vi tmp.xml
# cibadmin --replace --xml-file tmp.xml
Some of the better XML editors can make use of a RELAX NG schema to
help make sure any changes you make are valid. The schema describing
the configuration can be found in ``pacemaker.rng``, which may be
deployed in a location such as ``/usr/share/pacemaker`` depending on your
operating system distribution and how you installed the software.
If you want to modify just one section of the configuration, you can
query and replace just that section to avoid modifying any others.
.. topic:: Safely using an editor to modify only the resources section
.. code-block:: none
# cibadmin --query --scope resources > tmp.xml
# vi tmp.xml
# cibadmin --replace --scope resources --xml-file tmp.xml
To quickly delete a part of the configuration, identify the object you wish to
delete by XML tag and id. For example, you might search the CIB for all
STONITH-related configuration:
.. topic:: Searching for STONITH-related configuration items
.. code-block:: none
# cibadmin --query | grep stonith
If you wanted to delete the ``primitive`` tag with id ``child_DoFencing``,
you would run:
-.. code-block::
+.. code-block:: none
# cibadmin --delete --xml-text ''
See the cibadmin man page for more options.
.. warning::
Never edit the live ``cib.xml`` file directly. Pacemaker will detect such
changes and refuse to use the configuration.
.. _crm_shadow:
Batch Configuration Changes with crm_shadow
###########################################
.. index::
pair: command-line tool; crm_shadow
Often, it is desirable to preview the effects of a series of configuration
changes before updating the live configuration all at once. For this purpose,
``crm_shadow`` creates a "shadow" copy of the configuration and arranges for
all the command-line tools to use it.
To begin, simply invoke ``crm_shadow --create`` with a name of your choice,
and follow the simple on-screen instructions. Shadow copies are identified with
a name to make it possible to have more than one.
.. warning::
Read this section and the on-screen instructions carefully; failure to do so
could result in destroying the cluster's active configuration!
.. topic:: Creating and displaying the active sandbox
.. code-block:: none
# crm_shadow --create test
Setting up shadow instance
Type Ctrl-D to exit the crm_shadow shell
shadow[test]:
shadow[test] # crm_shadow --which
test
From this point on, all cluster commands will automatically use the shadow copy
instead of talking to the cluster's active configuration. Once you have
finished experimenting, you can either make the changes active via the
``--commit`` option, or discard them using the ``--delete`` option. Again, be
sure to follow the on-screen instructions carefully!
For a full list of ``crm_shadow`` options and commands, invoke it with the
``--help`` option.
.. topic:: Use sandbox to make multiple changes all at once, discard them, and verify real configuration is untouched
.. code-block:: none
shadow[test] # crm_failcount -r rsc_c001n01 -G
scope=status name=fail-count-rsc_c001n01 value=0
shadow[test] # crm_standby --node c001n02 -v on
shadow[test] # crm_standby --node c001n02 -G
scope=nodes name=standby value=on
shadow[test] # cibadmin --erase --force
shadow[test] # cibadmin --query
shadow[test] # crm_shadow --delete test --force
Now type Ctrl-D to exit the crm_shadow shell
shadow[test] # exit
# crm_shadow --which
No active shadow configuration defined
# cibadmin -Q
See the next section, :ref:`crm_simulate`, for how to test your changes before
committing them to the live cluster.
.. _crm_simulate:
Simulate Cluster Activity with crm_simulate
###########################################
.. index::
pair: command-line tool; crm_simulate
The command-line tool `crm_simulate` shows the results of the same logic
the cluster itself uses to respond to a particular cluster configuration and
status.
As always, the man page is the primary documentation, and should be consulted
for further details. This section aims for a better conceptual explanation and
practical examples.
Replaying cluster decision-making logic
_______________________________________
At any given time, one node in a Pacemaker cluster will be elected DC, and that
node will run Pacemaker's scheduler to make decisions.
Each time decisions need to be made (a "transition"), the DC will have log
messages like "Calculated transition ... saving inputs in ..." with a file
name. You can grab the named file and replay the cluster logic to see why
particular decisions were made. The file contains the live cluster
configuration at that moment, so you can also look at it directly to see the
value of node attributes, etc., at that time.
The simplest usage is (replacing $FILENAME with the actual file name):
.. topic:: Simulate cluster response to a given CIB
.. code-block:: none
# crm_simulate --simulate --xml-file $FILENAME
That will show the cluster state when the process started, the actions that
need to be taken ("Transition Summary"), and the resulting cluster state if the
actions succeed. Most actions will have a brief description of why they were
required.
The transition inputs may be compressed. ``crm_simulate`` can handle these
compressed files directly, though if you want to edit the file, you'll need to
uncompress it first.
You can do the same simulation for the live cluster configuration at the
current moment. This is useful mainly when using ``crm_shadow`` to create a
sandbox version of the CIB; the ``--live-check`` option will use the shadow CIB
if one is in effect.
.. topic:: Simulate cluster response to current live CIB or shadow CIB
.. code-block:: none
# crm_simulate --simulate --live-check
Why decisions were made
_______________________
To get further insight into the "why", it gets user-unfriendly very quickly. If
you add the ``--show-scores`` option, you will also see all the scores that
went into the decision-making. The node with the highest cumulative score for a
resource will run it. You can look for ``-INFINITY`` scores in particular to
see where complete bans came into effect.
You can also add ``-VVVV`` to get more detailed messages about what's happening
under the hood. You can add up to two more V's even, but that's usually useful
only if you're a masochist or tracing through the source code.
Visualizing the action sequence
_______________________________
Another handy feature is the ability to generate a visual graph of the actions
needed, using the ``--dot-file`` option. This relies on the separate
Graphviz [#]_ project.
.. topic:: Generate a visual graph of cluster actions from a saved CIB
.. code-block:: none
# crm_simulate --simulate --xml-file $FILENAME --dot-file $FILENAME.dot
# dot $FILENAME.dot -Tsvg > $FILENAME.svg
``$FILENAME.dot`` will contain a GraphViz representation of the cluster's
response to your changes, including all actions with their ordering
dependencies.
``$FILENAME.svg`` will be the same information in a standard graphical format
that you can view in your browser or other app of choice. You could, of course,
use other ``dot`` options to generate other formats.
How to interpret the graphical output:
* Bubbles indicate actions, and arrows indicate ordering dependencies
* Resource actions have text of the form
``__`` indicating that the
specified action will be executed for the specified resource on the
specified node, once if interval is 0 or at specified recurring interval
otherwise
* Actions with black text will be sent to the executor (that is, the
appropriate agent will be invoked)
* Actions with orange text are "pseudo" actions that the cluster uses
internally for ordering but require no real activity
* Actions with a solid green border are part of the transition (that is, the
cluster will attempt to execute them in the given order -- though a
transition can be interrupted by action failure or new events)
* Dashed arrows indicate dependencies that are not present in the transition
graph
* Actions with a dashed border will not be executed. If the dashed border is
blue, the cluster does not feel the action needs to be executed. If the
dashed border is red, the cluster would like to execute the action but
cannot. Any actions depending on an action with a dashed border will not be
able to execute.
* Loops should not happen, and should be reported as a bug if found.
.. topic:: Small Cluster Transition
.. image:: ../../shared/en-US/images/Policy-Engine-small.png
:alt: An example transition graph as represented by Graphviz
:height: 325
:width: 1161
:scale: 75 %
:align: center
In the above example, it appears that a new node, ``pcmk-2``, has come online
and that the cluster is checking to make sure ``rsc1``, ``rsc2`` and ``rsc3``
are not already running there (indicated by the ``rscN_monitor_0`` entries).
Once it did that, and assuming the resources were not active there, it would
have liked to stop ``rsc1`` and ``rsc2`` on ``pcmk-1`` and move them to
``pcmk-2``. However, there appears to be some problem and the cluster cannot or
is not permitted to perform the stop actions which implies it also cannot
perform the start actions. For some reason, the cluster does not want to start
``rsc3`` anywhere.
.. topic:: Complex Cluster Transition
.. image:: ../../shared/en-US/images/Policy-Engine-big.png
:alt: Complex transition graph that you're not expected to be able to read
:width: 1455
:height: 1945
:scale: 75 %
:align: center
What-if scenarios
_________________
You can make changes to the saved or shadow CIB and simulate it again, to see
how Pacemaker would react differently. You can edit the XML by hand, use
command-line tools such as ``cibadmin`` with either a shadow CIB or the
``CIB_file`` environment variable set to the filename, or use higher-level tool
support (see the man pages of the specific tool you're using for how to perform
actions on a saved CIB file rather than the live CIB).
You can also inject node failures and/or action failures into the simulation;
see the ``crm_simulate`` man page for more details.
This capability is useful when using a shadow CIB to edit the configuration.
Before committing the changes to the live cluster with ``crm_shadow --commit``,
you can use ``crm_simulate`` to see how the cluster will react to the changes.
.. _attrd_updater:
.. _crm_attribute:
Manage Node Attributes, Cluster Options and Defaults with crm_attribute and attrd_updater
#########################################################################################
.. index::
pair: command-line tool; attrd_updater
pair: command-line tool; crm_attribute
``crm_attribute`` and ``attrd_updater`` are confusingly similar tools with subtle
differences.
``attrd_updater`` can query and update node attributes. ``crm_attribute`` can query
and update not only node attributes, but also cluster options, resource
defaults, and operation defaults.
To understand the differences, it helps to understand the various types of node
attribute.
-.. table:: Types of Node Attributes
-
-+-----------+----------+-------------------+------------------+----------------+----------------+
-| Type | Recorded | Recorded in | Survive full | Manageable by | Manageable by |
-| | in CIB? | attribute manager | cluster restart? | crm_attribute? | attrd_updater? |
-| | | memory? | | | |
-+===========+==========+===================+==================+================+================+
-| permanent | yes | no | yes | yes | no |
-+-----------+----------+-------------------+------------------+----------------+----------------+
-| transient | yes | yes | no | yes | yes |
-+-----------+----------+-------------------+------------------+----------------+----------------+
-| private | no | yes | no | no | yes |
-+-----------+----------+-------------------+------------------+----------------+----------------+
+.. table:: **Types of Node Attributes**
+
+ +-----------+----------+-------------------+------------------+----------------+----------------+
+ | Type | Recorded | Recorded in | Survive full | Manageable by | Manageable by |
+ | | in CIB? | attribute manager | cluster restart? | crm_attribute? | attrd_updater? |
+ | | | memory? | | | |
+ +===========+==========+===================+==================+================+================+
+ | permanent | yes | no | yes | yes | no |
+ +-----------+----------+-------------------+------------------+----------------+----------------+
+ | transient | yes | yes | no | yes | yes |
+ +-----------+----------+-------------------+------------------+----------------+----------------+
+ | private | no | yes | no | no | yes |
+ +-----------+----------+-------------------+------------------+----------------+----------------+
As you can see from the table above, ``crm_attribute`` can manage permanent and
transient node attributes, while ``attrd_updater`` can manage transient and
private node attributes.
The difference between the two tools lies mainly in *how* they update node
attributes: ``attrd_updater`` always contacts the Pacemaker attribute manager
directly, while ``crm_attribute`` will contact the attribute manager only for
transient node attributes, and will instead modify the CIB directly for
permanent node attributes (and for transient node attributes when unable to
contact the attribute manager).
By contacting the attribute manager directly, ``attrd_updater`` can change
an attribute's "dampening" (whether changes are immediately flushed to the CIB
or after a specified amount of time, to minimize disk writes for frequent
changes), set private node attributes (which are never written to the CIB), and
set attributes for nodes that don't yet exist.
By modifying the CIB directly, ``crm_attribute`` can set permanent node
attributes (which are only in the CIB and not managed by the attribute
manager), and can be used with saved CIB files and shadow CIBs.
However a transient node attribute is set, it is synchronized between the CIB
and the attribute manager, on all nodes.
Other Commonly Used Tools
#########################
Other command-line tools include:
.. index::
pair: command-line tool; crm_failcount
pair: command-line tool; crm_node
pair: command-line tool; crm_report
pair: command-line tool; crm_standby
pair: command-line tool; crm_verify
pair: command-line tool; stonith_admin
* ``crm_failcount``: query or delete resource fail counts
* ``crm_node``: manage cluster nodes
* ``crm_report``: generate a detailed cluster report for bug submissions
* ``crm_resource``: manage cluster resources
* ``crm_standby``: manage standby status of nodes
* ``crm_verify``: validate a CIB
* ``stonith_admin``: manage fencing devices
See the manual pages for details.
.. rubric:: Footnotes
.. [#] Graph visualization software. See http://www.graphviz.org/ for details.
diff --git a/doc/sphinx/Pacemaker_Administration/upgrading.rst b/doc/sphinx/Pacemaker_Administration/upgrading.rst
index b2f00cc914..1d6f0f68ad 100644
--- a/doc/sphinx/Pacemaker_Administration/upgrading.rst
+++ b/doc/sphinx/Pacemaker_Administration/upgrading.rst
@@ -1,485 +1,485 @@
Upgrading a Pacemaker Cluster
-----------------------------
Pacemaker Versioning
####################
Pacemaker has an overall release version, plus separate version numbers for
certain internal components.
* **Pacemaker release version:** This version consists of three numbers
(*x.y.z*).
The major version number (the *x* in *x.y.z*) increases when at least some
rolling upgrades are not possible from the previous major version. For example,
a rolling upgrade from 1.0.8 to 1.1.15 should always be supported, but a
rolling upgrade from 1.0.8 to 2.0.0 may not be possible.
The minor version (the *y* in *x.y.z*) increases when there are significant
changes in cluster default behavior, tool behavior, and/or the API interface
(for software that utilizes Pacemaker libraries). The main benefit is to alert
you to pay closer attention to the release notes, to see if you might be
affected.
The release counter (the *z* in *x.y.z*) is increased with all public releases
of Pacemaker, which typically include both bug fixes and new features.
* **CRM feature set:** This version number applies to the communication between
full cluster nodes, and is used to avoid problems in mixed-version clusters.
The major version number increases when nodes with different versions would not
work (rolling upgrades are not allowed). The minor version number increases
when mixed-version clusters are allowed only during rolling upgrades. The
minor-minor version number is ignored, but allows resource agents to detect
cluster support for various features. [#]_
Pacemaker ensures that the longest-running node is the cluster's DC. This
ensures new features are not enabled until all nodes are upgraded to support
them.
* **Pacemaker Remote protocol version:** This version applies to communication
between a Pacemaker Remote node and the cluster. It increases when an older
cluster node would have problems hosting the connection to a newer
Pacemaker Remote node. To avoid these problems, Pacemaker Remote nodes will
accept connections only from cluster nodes with the same or newer
Pacemaker Remote protocol version.
Unlike with CRM feature set differences between full cluster nodes,
mixed Pacemaker Remote protocol versions between Pacemaker Remote nodes and
full cluster nodes are fine, as long as the Pacemaker Remote nodes have the
older version. This can be useful, for example, to host a legacy application
in an older operating system version used as a Pacemaker Remote node.
* **XML schema version:** Pacemaker’s configuration syntax — what's allowed in
the Configuration Information Base (CIB) — has its own version. This allows
the configuration syntax to evolve over time while still allowing clusters
with older configurations to work without change.
Upgrading Cluster Software
##########################
There are three approaches to upgrading a cluster, each with advantages and
disadvantages.
-.. table:: Upgrade Methods
-
-+---------------------------------------------------+----------+----------+--------+---------+----------+----------+
-| Method | Available| Can be | Service| Service | Exercises| Allows |
-| | between | used with| outage | recovery| failover | change of|
-| | all | Pacemaker| during | during | logic | messaging|
-| | versions | Remote | upgrade| upgrade | | layer |
-| | | nodes | | | | [#]_ |
-+===================================================+==========+==========+========+=========+==========+==========+
-| Complete cluster shutdown | yes | yes | always | N/A | no | yes |
-| | | | | | | |
-| .. index:: | | | | | | |
-| pair: cluster; upgrade with shutdown | | | | | | |
-| pair: upgrade; upgrade with shutdown | | | | | | |
-+---------------------------------------------------+----------+----------+--------+---------+----------+----------+
-| Rolling (node by node) | no | yes | always | yes | yes | no |
-| | | | [#]_ | | | |
-| | | | | | | |
-| .. index:: | | | | | | |
-| pair: cluster; rolling upgrade | | | | | | |
-| pair: upgrade; rolling upgrade | | | | | | |
-+---------------------------------------------------+----------+----------+--------+---------+----------+----------+
-| Detach and reattach | yes | no | only | no | no | yes |
-| | | | due to | | | |
-| | | | failure| | | |
-| | | | | | | |
-| .. index:: | | | | | | |
-| pair: cluster; upgrade with detach and reattach| | | | | | |
-| pair: upgrade; upgrade with detach and reattach| | | | | | |
-+---------------------------------------------------+----------+----------+--------+---------+----------+----------+
+.. table:: **Upgrade Methods**
+
+ +---------------------------------------------------+----------+----------+--------+---------+----------+----------+
+ | Method | Available| Can be | Service| Service | Exercises| Allows |
+ | | between | used with| outage | recovery| failover | change of|
+ | | all | Pacemaker| during | during | logic | messaging|
+ | | versions | Remote | upgrade| upgrade | | layer |
+ | | | nodes | | | | [#]_ |
+ +===================================================+==========+==========+========+=========+==========+==========+
+ | Complete cluster shutdown | yes | yes | always | N/A | no | yes |
+ | | | | | | | |
+ | .. index:: | | | | | | |
+ | pair: cluster; upgrade with shutdown | | | | | | |
+ | pair: upgrade; upgrade with shutdown | | | | | | |
+ +---------------------------------------------------+----------+----------+--------+---------+----------+----------+
+ | Rolling (node by node) | no | yes | always | yes | yes | no |
+ | | | | [#]_ | | | |
+ | | | | | | | |
+ | .. index:: | | | | | | |
+ | pair: cluster; rolling upgrade | | | | | | |
+ | pair: upgrade; rolling upgrade | | | | | | |
+ +---------------------------------------------------+----------+----------+--------+---------+----------+----------+
+ | Detach and reattach | yes | no | only | no | no | yes |
+ | | | | due to | | | |
+ | | | | failure| | | |
+ | | | | | | | |
+ | .. index:: | | | | | | |
+ | pair: cluster; upgrade with detach and reattach| | | | | | |
+ | pair: upgrade; upgrade with detach and reattach| | | | | | |
+ +---------------------------------------------------+----------+----------+--------+---------+----------+----------+
Complete Cluster Shutdown
_________________________
In this scenario, one shuts down all cluster nodes and resources,
then upgrades all the nodes before restarting the cluster.
#. On each node:
a. Shutdown the cluster software (pacemaker and the messaging layer).
#. Upgrade the Pacemaker software. This may also include upgrading the
messaging layer and/or the underlying operating system.
#. Check the configuration with the ``crm_verify`` tool.
#. On each node:
a. Start the cluster software.
Currently, only Corosync version 2 and greater is supported as the cluster
layer, but if another stack is supported in the future, the stack does not
need to be the same one before the upgrade.
One variation of this approach is to build a new cluster on new hosts.
This allows the new version to be tested beforehand, and minimizes downtime by
having the new nodes ready to be placed in production as soon as the old nodes
are shut down.
Rolling (node by node)
______________________
In this scenario, each node is removed from the cluster, upgraded, and then
brought back online, until all nodes are running the newest version.
Special considerations when planning a rolling upgrade:
* If you plan to upgrade other cluster software -- such as the messaging layer --
at the same time, consult that software's documentation for its compatibility
with a rolling upgrade.
* If the major version number is changing in the Pacemaker version you are
upgrading to, a rolling upgrade may not be possible. Read the new version's
release notes (as well the information here) for what limitations may exist.
* If the CRM feature set is changing in the Pacemaker version you are upgrading
to, you should run a mixed-version cluster only during a small rolling
upgrade window. If one of the older nodes drops out of the cluster for any
reason, it will not be able to rejoin until it is upgraded.
* If the Pacemaker Remote protocol version is changing, all cluster nodes
should be upgraded before upgrading any Pacemaker Remote nodes.
See the ClusterLabs wiki's
`release calendar `_
to figure out whether the CRM feature set and/or Pacemaker Remote protocol
version changed between the the Pacemaker release versions in your rolling
upgrade.
To perform a rolling upgrade, on each node in turn:
#. Put the node into standby mode, and wait for any active resources
to be moved cleanly to another node. (This step is optional, but
allows you to deal with any resource issues before the upgrade.)
#. Shutdown the cluster software (pacemaker and the messaging layer) on the node.
#. Upgrade the Pacemaker software. This may also include upgrading the
messaging layer and/or the underlying operating system.
#. If this is the first node to be upgraded, check the configuration
with the ``crm_verify`` tool.
#. Start the messaging layer.
This must be the same messaging layer (currently only Corosync version 2 and
greater is supported) that the rest of the cluster is using.
.. note::
Even if a rolling upgrade from the current version of the cluster to the
newest version is not directly possible, it may be possible to perform a
rolling upgrade in multiple steps, by upgrading to an intermediate version
first.
-.. table:: Version Compatibility Table
-
-+-------------------------+---------------------------+
-| Version being Installed | Oldest Compatible Version |
-+=========================+===========================+
-| Pacemaker 2.y.z | Pacemaker 1.1.11 [#]_ |
-+-------------------------+---------------------------+
-| Pacemaker 1.y.z | Pacemaker 1.0.0 |
-+-------------------------+---------------------------+
-| Pacemaker 0.7.z | Pacemaker 0.6.z |
-+-------------------------+---------------------------+
+.. table:: **Version Compatibility Table**
+
+ +-------------------------+---------------------------+
+ | Version being Installed | Oldest Compatible Version |
+ +=========================+===========================+
+ | Pacemaker 2.y.z | Pacemaker 1.1.11 [#]_ |
+ +-------------------------+---------------------------+
+ | Pacemaker 1.y.z | Pacemaker 1.0.0 |
+ +-------------------------+---------------------------+
+ | Pacemaker 0.7.z | Pacemaker 0.6.z |
+ +-------------------------+---------------------------+
Detach and Reattach
___________________
The reattach method is a variant of a complete cluster shutdown, where the
resources are left active and get re-detected when the cluster is restarted.
This method may not be used if the cluster contains any Pacemaker Remote nodes.
#. Tell the cluster to stop managing services. This is required to allow the
services to remain active after the cluster shuts down.
.. code-block:: none
# crm_attribute --name maintenance-mode --update true
#. On each node, shutdown the cluster software (pacemaker and the messaging
layer), and upgrade the Pacemaker software. This may also include upgrading
the messaging layer. While the underlying operating system may be upgraded
at the same time, that will be more likely to cause outages in the detached
services (certainly, if a reboot is required).
#. Check the configuration with the ``crm_verify`` tool.
#. On each node, start the cluster software.
Currently, only Corosync version 2 and greater is supported as the cluster
layer, but if another stack is supported in the future, the stack does not
need to be the same one before the upgrade.
#. Verify that the cluster re-detected all resources correctly.
#. Allow the cluster to resume managing resources again:
.. code-block:: none
# crm_attribute --name maintenance-mode --delete
.. note::
While the goal of the detach-and-reattach method is to avoid disturbing
running services, resources may still move after the upgrade if any
resource's location is governed by a rule based on transient node
attributes. Transient node attributes are erased when the node leaves the
cluster. A common example is using the ``ocf:pacemaker:ping`` resource to
set a node attribute used to locate other resources.
Upgrading the Configuration
###########################
.. index::
pair: upgrading; configuration
The CIB schema version can change from one Pacemaker version to another.
After cluster software is upgraded, the cluster will continue to use the older
schema version that it was previously using. This can be useful, for example,
when administrators have written tools that modify the configuration, and are
based on the older syntax. [#]_
However, when using an older syntax, new features may be unavailable, and there
is a performance impact, since the cluster must do a non-persistent
configuration upgrade before each transition. So while using the old syntax is
possible, it is not advisable to continue using it indefinitely.
Even if you wish to continue using the old syntax, it is a good idea to
follow the upgrade procedure outlined below, except for the last step, to ensure
that the new software has no problems with your existing configuration (since it
will perform much the same task internally).
If you are brave, it is sufficient simply to run ``cibadmin --upgrade``.
A more cautious approach would proceed like this:
#. Create a shadow copy of the configuration. The later commands will
automatically operate on this copy, rather than the live configuration.
.. code-block:: none
# crm_shadow --create shadow
#. Verify the configuration is valid with the new software (which may be
stricter about syntax mistakes, or may have dropped support for deprecated
features):
.. index::
pair: verify; configuration
.. code-block:: none
# crm_verify --live-check
#. Fix any errors or warnings.
#. Perform the upgrade:
.. code-block:: none
# cibadmin --upgrade
#. If this step fails, there are three main possibilities:
a. The configuration was not valid to start with (did you do steps 2 and
3?).
#. The transformation failed; `report a bug `_.
#. The transformation was successful but produced an invalid result.
If the result of the transformation is invalid, you may see a number of
errors from the validation library. If these are not helpful, visit the
`Validation FAQ wiki page `_
and/or try the manual upgrade procedure described below.
#. Check the changes:
.. code-block:: none
# crm_shadow --diff
If at this point there is anything about the upgrade that you wish to
fine-tune (for example, to change some of the automatic IDs), now is the
time to do so:
.. code-block:: none
# crm_shadow --edit
This will open the configuration in your favorite editor (whichever is
specified by the standard ``$EDITOR`` environment variable).
#. Preview how the cluster will react:
.. code-block:: none
# crm_simulate --live-check --save-dotfile shadow.dot -S
# dot -Tsvg shadow.dot -o shadow.svg
You can then view shadow.svg with any compatible image viewer or web
browser. Verify that either no resource actions will occur or that you are
happy with any that are scheduled. If the output contains actions you do
not expect (possibly due to changes to the score calculations), you may need
to make further manual changes. See :ref:`crm_simulate` for further details
on how to interpret the output of ``crm_simulate`` and ``dot``.
#. Upload the changes:
.. code-block:: none
# crm_shadow --commit shadow --force
In the unlikely event this step fails, please report a bug.
.. note::
It is also possible to perform the configuration upgrade steps manually:
#. Locate the ``upgrade*.xsl`` conversion scripts provided with the source
code. These will often be installed in a location such as
``/usr/share/pacemaker``, or may be obtained from the
`source repository `_.
#. Run the conversion scripts that apply to your older version, for example:
.. code-block:: none
# xsltproc /path/to/upgrade06.xsl config06.xml > config10.xml
#. Locate the ``pacemaker.rng`` script (from the same location as the xsl
files).
#. Check the XML validity:
.. code-block:: none
# xmllint --relaxng /path/to/pacemaker.rng config10.xml
The advantage of this method is that it can be performed without the cluster
running, and any validation errors are often more informative.
What Changed in 2.0
###################
The main goal of the 2.0 release was to remove support for deprecated syntax,
along with some small changes in default configuration behavior and tool
behavior. Highlights:
* Only Corosync version 2 and greater is now supported as the underlying
cluster layer. Support for Heartbeat and Corosync 1 (including CMAN) is
removed.
* The Pacemaker detail log file is now stored in
``/var/log/pacemaker/pacemaker.log`` by default.
* The record-pending cluster property now defaults to true, which
allows status tools such as crm_mon to show operations that are in
progress.
* Support for a number of deprecated build options, environment variables,
and configuration settings has been removed.
* The ``master`` tag has been deprecated in favor of using the ``clone`` tag
with the new ``promotable`` meta-attribute set to ``true``. "Master/slave"
clone resources are now referred to as "promotable" clone resources, though
it will take longer for the full terminology change to be completed.
* The public API for Pacemaker libraries that software applications can use
has changed significantly.
For a detailed list of changes, see the release notes and the
`Pacemaker 2.0 Changes `_
page on the ClusterLabs wiki.
What Changed in 1.0
###################
New
___
* Failure timeouts.
* New section for resource and operation defaults.
* Tool for making offline configuration changes.
* ``Rules``, ``instance_attributes``, ``meta_attributes`` and sets of
operations can be defined once and referenced in multiple places.
* The CIB now accepts XPath-based create/modify/delete operations. See
``cibadmin --help``.
* Multi-dimensional colocation and ordering constraints.
* The ability to connect to the CIB from non-cluster machines.
* Allow recurring actions to be triggered at known times.
Changed
_______
* Syntax
* All resource and cluster options now use dashes (-) instead of underscores
(_)
* ``master_slave`` was renamed to ``master``
* The ``attributes`` container tag was removed
* The operation field ``pre-req`` has been renamed ``requires``
* All operations must have an ``interval``, ``start``/``stop`` must have it
set to zero
* The ``stonith-enabled`` option now defaults to true.
* The cluster will refuse to start resources if ``stonith-enabled`` is true (or
unset) and no STONITH resources have been defined
* The attributes of colocation and ordering constraints were renamed for
clarity.
* ``resource-failure-stickiness`` has been replaced by ``migration-threshold``.
* The parameters for command-line tools have been made consistent
* Switched to 'RelaxNG' schema validation and 'libxml2' parser
* id fields are now XML IDs which have the following limitations:
* id's cannot contain colons (:)
* id's cannot begin with a number
* id's must be globally unique (not just unique for that tag)
* Some fields (such as those in constraints that refer to resources) are
IDREFs.
This means that they must reference existing resources or objects in
order for the configuration to be valid. Removing an object which is
referenced elsewhere will therefore fail.
* The CIB representation, from which a MD5 digest is calculated to verify
CIBs on the nodes, has changed.
This means that every CIB update will require a full refresh on any
upgraded nodes until the cluster is fully upgraded to 1.0. This will result
in significant performance degradation and it is therefore highly
inadvisable to run a mixed 1.0/0.6 cluster for any longer than absolutely
necessary.
* Ping node information no longer needs to be added to ``ha.cf``. Simply
include the lists of hosts in your ping resource(s).
Removed
_______
* Syntax
* It is no longer possible to set resource meta options as top-level
attributes. Use meta-attributes instead.
* Resource and operation defaults are no longer read from ``crm_config``.
.. rubric:: Footnotes
.. [#] Before CRM feature set 3.1.0 (Pacemaker 2.0.0), the minor-minor version
number was treated the same as the minor version.
.. [#] Currently, Corosync version 2 and greater is the only supported cluster
stack, but other stacks have been supported by past versions, and may be
supported by future versions.
.. [#] Any active resources will be moved off the node being upgraded, so there
will be at least a brief outage unless all resources can be migrated
"live".
.. [#] Rolling upgrades from Pacemaker 1.1.z to 2.y.z are possible only if the
cluster uses corosync version 2 or greater as its messaging layer, and
the Cluster Information Base (CIB) uses schema 1.0 or higher in its
``validate-with`` property.
.. [#] As of Pacemaker 2.0.0, only schema versions pacemaker-1.0 and higher
are supported (excluding pacemaker-1.1, which was an experimental schema
now known as pacemaker-next).
diff --git a/doc/sphinx/Pacemaker_Explained/acls.rst b/doc/sphinx/Pacemaker_Explained/acls.rst
new file mode 100644
index 0000000000..1786768a76
--- /dev/null
+++ b/doc/sphinx/Pacemaker_Explained/acls.rst
@@ -0,0 +1,335 @@
+Access Control Lists (ACLs)
+---------------------------
+
+.. Convert_to_RST:
+
+ anchor:ch-acls[Chapter 13, ACLs]
+ indexterm:[access control list]
+ indexterm:[ACL]
+
+ By default, the +root+ user or any user in the +haclient+ group can modify
+ Pacemaker's CIB without restriction. Pacemaker offers 'access control lists
+ (ACLs)' to provide more fine-grained authorization.
+
+ == ACL Prerequisites ==
+
+ In order to use ACLs:
+
+ * The Pacemaker software must have been compiled with ACL support. If the
+ output of the command `pacemakerd --features` contains `acls`, your
+ installation supports ACLs.
+
+ * Desired users must have user accounts in the +haclient+ group on all nodes in
+ the cluster.
+
+ * If your CIB was created before Pacemaker 1.1.12, it may need to be updated to
+ the current schema using `cibadmin --upgrade` in order to use the syntax
+ documented here.
+
+ * The +enable-acl+ <> must be set to true.
+
+ == ACL Configuration ==
+
+ ACLs are specified within an +acls+ element of the CIB. The +acls+ element may
+ contain any number of +acl_role+, +acl_target+, and +acl_group+ elements.
+
+ == ACL Roles ==
+
+ An ACL role is a collection of permissions allowing or denying access to
+ particular portions of the CIB.
+
+ .Properties of an ACL Role
+ [width="95%",cols="1m,<3",options="header",align="center"]
+ |====
+
+ |Attribute
+ |Description
+
+ |id
+ |A unique name for the role (required)
+ indexterm:[id,acl_role]
+ indexterm:[access control list,acl_role,id]
+
+ |description
+ |Arbitrary text (not used by Pacemaker)
+ indexterm:[description,acl_role]
+ indexterm:[access control list,acl_role,description]
+
+ |====
+
+ An +acl_role+ element may contain any number of +acl_permission+ elements.
+
+ .Properties of an ACL Permission
+ [width="95%",cols="1m,<3",options="header",align="center"]
+ |====
+
+ |Attribute
+ |Description
+
+ |id
+ |A unique name for the permission (required)
+ indexterm:[id,acl_permission]
+ indexterm:[access control list,acl_permission,id]
+
+ |description
+ |Arbitrary text (not used by Pacemaker)
+ indexterm:[description,acl_permission]
+ indexterm:[access control list,acl_permission,description]
+
+ |kind
+ |The access being granted. Allowed values are +read+, +write+, and +deny+.
+ A value of +write+ grants both read and write access.
+ indexterm:[kind,acl_permission]
+ indexterm:[access control list,acl_permission,kind]
+
+ |object-type
+ |The name of an XML element in the CIB to which the permission applies.
+ (Exactly one of +object-type+, +xpath+, and +reference+ must be specified for
+ a permission.)
+ indexterm:[object-type,acl_permission]
+ indexterm:[access control list,acl_permission,object-type]
+
+ |attribute
+ |If specified, the permission applies only to +object-type+ elements that have
+ this attribute set (to any value). If not specified, the permission applies to
+ all +object-type+ elements. May only be used with +object-type+.
+ indexterm:[attribute,acl_permission]
+ indexterm:[access control list,acl_permission,attribute]
+
+ |reference
+ |The ID of an XML element in the CIB to which the permission applies.
+ (Exactly one of +object-type+, +xpath+, and +reference+ must be specified for
+ a permission.)
+ indexterm:[reference,acl_permission]
+ indexterm:[access control list,acl_permission,reference]
+
+ |xpath
+ |An https://www.w3.org/TR/xpath-10/[XPath] specification selecting an XML
+ element in the CIB to which the permission applies. Attributes may be
+ specified in the XPath to select particular elements, but the permissions
+ apply to the entire element.
+ (Exactly one of +object-type+, +xpath+, and +reference+ must be specified for
+ a permission.)
+ indexterm:[xpath,acl_permission]
+ indexterm:[access control list,acl_permission,xpath]
+
+ |====
+
+ [IMPORTANT]
+ ====
+ * Permissions are applied to the selected XML element's entire XML subtree
+ (all elements enclosed within it).
+
+ * Write permission grants the ability to create, modify, or remove the element
+ and its subtree, and also the ability to create any "scaffolding" elements
+ (enclosing elements that do not have attributes other than an ID).
+
+ * Permissions for more specific matches (more deeply nested elements) take
+ precedence over more general ones.
+
+ * If multiple permissions are configured for the same match (for example, in
+ different roles applied to the same user), any +deny+ permission takes
+ precedence, then +write+, then lastly +read+.
+ ====
+
+ == ACL Targets and Groups ==
+
+ ACL targets correspond to user accounts on the system.
+
+ .Properties of an ACL Target
+ [width="95%",cols="1m,<3",options="header",align="center"]
+ |====
+
+ |Attribute
+ |Description
+
+ |id
+ |The name of a user on the system (required)
+ indexterm:[id,acl_target]
+ indexterm:[access control list,acl_target,id]
+
+ |====
+
+ ACL groups may be specified, but are not currently used by Pacemaker. This is
+ expected to change in a future version.
+
+ .Properties of an ACL Group
+ [width="95%",cols="1m,<3",options="header",align="center"]
+ |====
+
+ |Attribute
+ |Description
+
+ |id
+ |The name of a group on the system (required)
+ indexterm:[id,acl_group]
+ indexterm:[access control list,acl_group,id]
+
+ |====
+
+ Each +acl_target+ and +acl_group+ element may contain any number of +role+
+ elements.
+
+ .Properties of an ACL Role Reference
+ [width="95%",cols="1m,<3",options="header",align="center"]
+ |====
+
+ |Attribute
+ |Description
+
+ |id
+ |The +id+ of an +acl_role+ element that specifies permissions granted to the
+ enclosing target or group
+ indexterm:[id,role]
+ indexterm:[access control list,role,id]
+
+ |====
+
+ [IMPORTANT]
+ ====
+ The +root+ and +hacluster+ user accounts always have full access to the CIB,
+ regardless of ACLs. For other user accounts, when +enable-acl+ is true,
+ permission to all parts of the CIB is denied by default (permissions must be
+ explicitly granted).
+ ====
+
+ == ACL Examples ==
+
+ [source,XML]
+ ----
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ----
+
+ In the above example, the user +alice+ has the minimal permissions necessary to
+ run basic Pacemaker CLI tools, including using `crm_mon` to view the cluster
+ status, without being able to modify anything. The user +bob+ can view the
+ entire configuration and status of the cluster, but not make any changes. The
+ user +carol+ can read everything, and change selected cluster properties as
+ well as resource roles and location constraints. Finally, +dave+ has full read
+ and write access to the entire CIB.
+
+ Looking at the +minimal+ role in more depth, it is designed to allow read
+ access to the +cib+ tag itself, while denying access to particular portions of
+ its subtree (which is the entire CIB).
+
+ This is because the DC node is indicated in the +cib+ tag, so `crm_mon` will
+ not be able to report the DC otherwise. However, this does change the security
+ model to allow by default, since any portions of the CIB not explicitly denied
+ will be readable. The +cib+ read access could be removed and replaced with read
+ access to just the +crm_config+ and +status+ sections, for a safer approach at
+ the cost of not seeing the DC in status output.
+
+ For a simpler configuration, the +minimal+ role allows read access to the
+ entire +crm_config+ section, which contains cluster properties. It would be
+ possible to allow read access to specific properties instead (such as
+ +stonith-enabled+, +dc-uuid+, +have-quorum+, and +cluster-name+) to restrict
+ access further while still allowing status output, but cluster properties are
+ unlikely to be considered sensitive.
diff --git a/doc/sphinx/Pacemaker_Explained/advanced-options.rst b/doc/sphinx/Pacemaker_Explained/advanced-options.rst
new file mode 100644
index 0000000000..5ee5c9b5ed
--- /dev/null
+++ b/doc/sphinx/Pacemaker_Explained/advanced-options.rst
@@ -0,0 +1,759 @@
+Advanced Configuration
+----------------------
+
+.. Convert_to_RST:
+
+ [[s-recurring-start]]
+ == Specifying When Recurring Actions are Performed ==
+
+
+ By default, recurring actions are scheduled relative to when the
+ resource started. So if your resource was last started at 14:32 and
+ you have a backup set to be performed every 24 hours, then the backup
+ will always run in the middle of the business day -- hardly
+ desirable.
+
+ To specify a date and time that the operation should be relative to, set
+ the operation's +interval-origin+. The cluster uses this point to
+ calculate the correct +start-delay+ such that the operation will occur
+ at _origin + (interval * N)_.
+
+ So, if the operation's interval is 24h, its interval-origin is set to
+ 02:00 and it is currently 14:32, then the cluster would initiate
+ the operation with a start delay of 11 hours and 28 minutes. If the
+ resource is moved to another node before 2am, then the operation is
+ cancelled.
+
+ The value specified for +interval+ and +interval-origin+ can be any
+ date/time conforming to the
+ http://en.wikipedia.org/wiki/ISO_8601[ISO8601 standard]. By way of
+ example, to specify an operation that would run on the first Monday of
+ 2009 and every Monday after that, you would add:
+
+ .Specifying a Base for Recurring Action Intervals
+ =====
+ [source,XML]
+
+ =====
+
+ [[s-failure-handling]]
+ == Handling Resource Failure ==
+
+ By default, Pacemaker will attempt to recover failed resources by restarting
+ them. However, failure recovery is highly configurable.
+
+ === Failure Counts ===
+
+ Pacemaker tracks resource failures for each combination of node, resource, and
+ operation (start, stop, monitor, etc.).
+
+ You can query the fail count for a particular node, resource, and/or operation
+ using the `crm_failcount` command. For example, to see how many times the
+ 10-second monitor for +myrsc+ has failed on +node1+, run:
+
+ ----
+ # crm_failcount --query -r myrsc -N node1 -n monitor -I 10s
+ ----
+
+ If you omit the node, `crm_failcount` will use the local node. If you omit the
+ operation and interval, `crm_failcount` will display the sum of the fail counts
+ for all operations on the resource.
+
+ You can use `crm_resource --cleanup` or `crm_failcount --delete` to clear
+ fail counts. For example, to clear the above monitor failures, run:
+
+ ----
+ # crm_resource --cleanup -r myrsc -N node1 -n monitor -I 10s
+ ----
+
+ If you omit the resource, `crm_resource --cleanup` will clear failures for all
+ resources. If you omit the node, it will clear failures on all nodes. If you
+ omit the operation and interval, it will clear the failures for all operations
+ on the resource.
+
+ [NOTE]
+ ====
+ Even when cleaning up only a single operation, all failed operations will
+ disappear from the status display. This allows us to trigger a re-check of the
+ resource's current status.
+ ====
+
+ Higher-level tools may provide other commands for querying and clearing
+ fail counts.
+
+ The `crm_mon` tool shows the current cluster status, including any failed
+ operations. To see the current fail counts for any failed resources, call
+ `crm_mon` with the `--failcounts` option. This shows the fail counts per
+ resource (that is, the sum of any operation fail counts for the resource).
+
+ === Failure Response ===
+
+ Normally, if a running resource fails, pacemaker will try to stop it and start
+ it again. Pacemaker will choose the best location to start it each time, which
+ may be the same node that it failed on.
+
+ However, if a resource fails repeatedly, it is possible that there is an
+ underlying problem on that node, and you might desire trying a different node
+ in such a case. Pacemaker allows you to set your preference via the
+ +migration-threshold+ resource meta-attribute.
+ footnote:[
+ The naming of this option was perhaps unfortunate as it is easily
+ confused with live migration, the process of moving a resource from
+ one node to another without stopping it. Xen virtual guests are the
+ most common example of resources that can be migrated in this manner.
+ ]
+
+ If you define +migration-threshold=pass:[N]+ for a
+ resource, it will be banned from the original node after 'N' failures.
+
+ [NOTE]
+ ====
+ The +migration-threshold+ is per 'resource', even though fail counts are
+ tracked per 'operation'. The operation fail counts are added together
+ to compare against the +migration-threshold+.
+ ====
+
+ By default, fail counts remain until manually cleared by an administrator
+ using `crm_resource --cleanup` or `crm_failcount --delete` (hopefully after
+ first fixing the failure's cause). It is possible to have fail counts expire
+ automatically by setting the +failure-timeout+ resource meta-attribute.
+
+ [IMPORTANT]
+ ====
+ A successful operation does not clear past failures. If a recurring monitor
+ operation fails once, succeeds many times, then fails again days later, its
+ fail count is 2. Fail counts are cleared only by manual intervention or
+ falure timeout.
+ ====
+
+ For example, a setting of +migration-threshold=2+ and +failure-timeout=60s+
+ would cause the resource to move to a new node after 2 failures, and
+ allow it to move back (depending on stickiness and constraint scores) after one
+ minute.
+
+ [NOTE]
+ ====
+ +failure-timeout+ is measured since the most recent failure. That is, older
+ failures do not individually time out and lower the fail count. Instead, all
+ failures are timed out simultaneously (and the fail count is reset to 0) if
+ there is no new failure for the timeout period.
+ ====
+
+ There are two exceptions to the migration threshold concept:
+ when a resource either fails to start or fails to stop.
+
+ If the cluster property +start-failure-is-fatal+ is set to +true+ (which is the
+ default), start failures cause the fail count to be set to +INFINITY+ and thus
+ always cause the resource to move immediately.
+
+ Stop failures are slightly different and crucial. If a resource fails
+ to stop and STONITH is enabled, then the cluster will fence the node
+ in order to be able to start the resource elsewhere. If STONITH is
+ not enabled, then the cluster has no way to continue and will not try
+ to start the resource elsewhere, but will try to stop it again after
+ the failure timeout.
+
+ == Moving Resources ==
+ indexterm:[Moving,Resources]
+ indexterm:[Resource,Moving]
+
+ === Moving Resources Manually ===
+
+ There are primarily two occasions when you would want to move a
+ resource from its current location: when the whole node is under
+ maintenance, and when a single resource needs to be moved.
+
+ ==== Standby Mode ====
+
+ Since everything eventually comes down to a score, you could create
+ constraints for every resource to prevent them from running on one
+ node. While pacemaker configuration can seem convoluted at times, not even
+ we would require this of administrators.
+
+ Instead, one can set a special node attribute which tells the cluster
+ "don't let anything run here". There is even a helpful tool to help
+ query and set it, called `crm_standby`. To check the standby status
+ of the current machine, run:
+
+ ----
+ # crm_standby -G
+ ----
+
+ A value of +on+ indicates that the node is _not_ able to host any
+ resources, while a value of +off+ says that it _can_.
+
+ You can also check the status of other nodes in the cluster by
+ specifying the `--node` option:
+
+ ----
+ # crm_standby -G --node sles-2
+ ----
+
+ To change the current node's standby status, use `-v` instead of `-G`:
+
+ ----
+ # crm_standby -v on
+ ----
+
+ Again, you can change another host's value by supplying a hostname with `--node`.
+
+ A cluster node in standby mode will not run resources, but still contributes to
+ quorum, and may fence or be fenced by nodes.
+
+ ==== Moving One Resource ====
+
+ When only one resource is required to move, we could do this by creating
+ location constraints. However, once again we provide a user-friendly
+ shortcut as part of the `crm_resource` command, which creates and
+ modifies the extra constraints for you. If +Email+ were running on
+ +sles-1+ and you wanted it moved to a specific location, the command
+ would look something like:
+
+ ----
+ # crm_resource -M -r Email -H sles-2
+ ----
+
+ Behind the scenes, the tool will create the following location constraint:
+
+ [source,XML]
+
+
+ It is important to note that subsequent invocations of `crm_resource
+ -M` are not cumulative. So, if you ran these commands
+
+ ----
+ # crm_resource -M -r Email -H sles-2
+ # crm_resource -M -r Email -H sles-3
+ ----
+
+ then it is as if you had never performed the first command.
+
+ To allow the resource to move back again, use:
+
+ ----
+ # crm_resource -U -r Email
+ ----
+
+ Note the use of the word _allow_. The resource can move back to its
+ original location but, depending on +resource-stickiness+, it might
+ stay where it is. To be absolutely certain that it moves back to
+ +sles-1+, move it there before issuing the call to `crm_resource -U`:
+
+ ----
+ # crm_resource -M -r Email -H sles-1
+ # crm_resource -U -r Email
+ ----
+
+ Alternatively, if you only care that the resource should be moved from
+ its current location, try:
+
+ ----
+ # crm_resource -B -r Email
+ ----
+
+ Which will instead create a negative constraint, like
+
+ [source,XML]
+
+
+ This will achieve the desired effect, but will also have long-term
+ consequences. As the tool will warn you, the creation of a
+ +-INFINITY+ constraint will prevent the resource from running on that
+ node until `crm_resource -U` is used. This includes the situation
+ where every other cluster node is no longer available!
+
+ In some cases, such as when +resource-stickiness+ is set to
+ +INFINITY+, it is possible that you will end up with the problem
+ described in <>. The tool can detect
+ some of these cases and deals with them by creating both
+ positive and negative constraints. E.g.
+
+ +Email+ prefers +sles-1+ with a score of +-INFINITY+
+
+ +Email+ prefers +sles-2+ with a score of +INFINITY+
+
+ which has the same long-term consequences as discussed earlier.
+
+ === Moving Resources Due to Connectivity Changes ===
+
+ You can configure the cluster to move resources when external connectivity is
+ lost in two steps.
+
+ ==== Tell Pacemaker to Monitor Connectivity ====
+
+ First, add an *ocf:pacemaker:ping* resource to the cluster. The
+ *ping* resource uses the system utility of the same name to a test whether
+ list of machines (specified by DNS hostname or IPv4/IPv6 address) are
+ reachable and uses the results to maintain a node attribute called +pingd+
+ by default.
+ footnote:[
+ The attribute name is customizable, in order to allow multiple ping groups to be defined.
+ ]
+
+ [NOTE]
+ ===========
+ Older versions of Pacemaker used a different agent *ocf:pacemaker:pingd* which
+ is now deprecated in favor of *ping*. If your version of Pacemaker does not
+ contain the *ping* resource agent, download the latest version from
+ https://github.com/ClusterLabs/pacemaker/tree/master/extra/resources/ping
+ ===========
+
+ Normally, the ping resource should run on all cluster nodes, which means that
+ you'll need to create a clone. A template for this can be found below
+ along with a description of the most interesting parameters.
+
+ .Common Options for a 'ping' Resource
+ [width="95%",cols="1m,<4",options="header",align="center"]
+ |=========================================================
+
+ |Field
+ |Description
+
+ |dampen
+ |The time to wait (dampening) for further changes to occur. Use this
+ to prevent a resource from bouncing around the cluster when cluster
+ nodes notice the loss of connectivity at slightly different times.
+ indexterm:[dampen,Ping Resource Option]
+ indexterm:[Ping Resource,Option,dampen]
+
+ |multiplier
+ |The number of connected ping nodes gets multiplied by this value to
+ get a score. Useful when there are multiple ping nodes configured.
+ indexterm:[multiplier,Ping Resource Option]
+ indexterm:[Ping Resource,Option,multiplier]
+
+ |host_list
+ |The machines to contact in order to determine the current
+ connectivity status. Allowed values include resolvable DNS host
+ names, IPv4 and IPv6 addresses.
+ indexterm:[host_list,Ping Resource Option]
+ indexterm:[Ping Resource,Option,host_list]
+
+ |=========================================================
+
+ .An example ping cluster resource that checks node connectivity once every minute
+ =====
+ [source,XML]
+ ------------
+
+
+
+
+
+
+
+
+
+
+
+
+ ------------
+ =====
+
+ [IMPORTANT]
+ ===========
+ You're only half done. The next section deals with telling Pacemaker
+ how to deal with the connectivity status that +ocf:pacemaker:ping+ is
+ recording.
+ ===========
+
+ ==== Tell Pacemaker How to Interpret the Connectivity Data ====
+
+ [IMPORTANT]
+ ======
+ Before attempting the following, make sure you understand
+ <>.
+ ======
+
+ There are a number of ways to use the connectivity data.
+
+ The most common setup is for people to have a single ping
+ target (e.g. the service network's default gateway), to prevent the cluster
+ from running a resource on any unconnected node.
+
+ .Don't run a resource on unconnected nodes
+ =====
+ [source,XML]
+ -------
+
+
+
+
+
+ -------
+ =====
+
+ A more complex setup is to have a number of ping targets configured.
+ You can require the cluster to only run resources on nodes that can
+ connect to all (or a minimum subset) of them.
+
+ .Run only on nodes connected to three or more ping targets.
+ =====
+ [source,XML]
+ -------
+
+ ...
+
+ ...
+
+ ...
+
+
+
+
+
+ -------
+ =====
+
+ Alternatively, you can tell the cluster only to _prefer_ nodes with the best
+ connectivity. Just be sure to set +multiplier+ to a value higher than
+ that of +resource-stickiness+ (and don't set either of them to
+ +INFINITY+).
+
+ .Prefer the node with the most connected ping nodes
+ =====
+ [source,XML]
+ -------
+
+
+
+
+
+ -------
+ =====
+
+ It is perhaps easier to think of this in terms of the simple
+ constraints that the cluster translates it into. For example, if
+ *sles-1* is connected to all five ping nodes but *sles-2* is only
+ connected to two, then it would be as if you instead had the following
+ constraints in your configuration:
+
+ .How the cluster translates the above location constraint
+ =====
+ [source,XML]
+ -------
+
+
+ -------
+ =====
+
+ The advantage is that you don't have to manually update any
+ constraints whenever your network connectivity changes.
+
+ You can also combine the concepts above into something even more
+ complex. The example below shows how you can prefer the node with the
+ most connected ping nodes provided they have connectivity to at least
+ three (again assuming that +multiplier+ is set to 1000).
+
+ .A more complex example of choosing a location based on connectivity
+ =====
+ [source,XML]
+ -------
+
+
+
+
+
+
+
+
+ -------
+ =====
+
+ [[s-migrating-resources]]
+ === Migrating Resources ===
+
+ Normally, when the cluster needs to move a resource, it fully restarts
+ the resource (i.e. stops the resource on the current node
+ and starts it on the new node).
+
+ However, some types of resources, such as Xen virtual guests, are able to move to
+ another location without loss of state (often referred to as live migration
+ or hot migration). In pacemaker, this is called resource migration.
+ Pacemaker can be configured to migrate a resource when moving it,
+ rather than restarting it.
+
+ Not all resources are able to migrate; see the Migration Checklist
+ below, and those that can, won't do so in all situations.
+ Conceptually, there are two requirements from which the other
+ prerequisites follow:
+
+ * The resource must be active and healthy at the old location; and
+ * everything required for the resource to run must be available on
+ both the old and new locations.
+
+ The cluster is able to accommodate both 'push' and 'pull' migration models
+ by requiring the resource agent to support two special actions:
+ +migrate_to+ (performed on the current location) and +migrate_from+
+ (performed on the destination).
+
+ In push migration, the process on the current location transfers the
+ resource to the new location where is it later activated. In this
+ scenario, most of the work would be done in the +migrate_to+ action
+ and, if anything, the activation would occur during +migrate_from+.
+
+ Conversely for pull, the +migrate_to+ action is practically empty and
+ +migrate_from+ does most of the work, extracting the relevant resource
+ state from the old location and activating it.
+
+ There is no wrong or right way for a resource agent to implement migration,
+ as long as it works.
+
+ .Migration Checklist
+ * The resource may not be a clone.
+ * The resource must use an OCF style agent.
+ * The resource must not be in a failed or degraded state.
+ * The resource agent must support +migrate_to+ and
+ +migrate_from+ actions, and advertise them in its metadata.
+ * The resource must have the +allow-migrate+ meta-attribute set to
+ +true+ (which is not the default).
+
+ If an otherwise migratable resource depends on another resource
+ via an ordering constraint, there are special situations in which it will be
+ restarted rather than migrated.
+
+ For example, if the resource depends on a clone, and at the time the resource
+ needs to be moved, the clone has instances that are stopping and instances
+ that are starting, then the resource will be restarted. The scheduler is not
+ yet able to model this situation correctly and so takes the safer (if less
+ optimal) path.
+
+ Also, if a migratable resource depends on a non-migratable resource, and both
+ need to be moved, the migratable resource will be restarted.
+
+ [[s-node-health]]
+ == Tracking Node Health ==
+
+ A node may be functioning adequately as far as cluster membership is concerned,
+ and yet be "unhealthy" in some respect that makes it an undesirable location
+ for resources. For example, a disk drive may be reporting SMART errors, or the
+ CPU may be highly loaded.
+
+ Pacemaker offers a way to automatically move resources off unhealthy nodes.
+
+ === Node Health Attributes ===
+
+ Pacemaker will treat any node attribute whose name starts with +#health+ as an
+ indicator of node health. Node health attributes may have one of the following
+ values:
+
+ .Allowed Values for Node Health Attributes
+ [width="95%",cols="1,<3",options="header",align="center"]
+ |=========================================================
+
+ |Value
+ |Intended significance
+
+ |+red+
+ |This indicator is unhealthy
+ indexterm:[Node health,red]
+
+ |+yellow+
+ |This indicator is becoming unhealthy
+ indexterm:[Node health,yellow]
+
+ |+green+
+ |This indicator is healthy
+ indexterm:[Node health,green]
+
+ |'integer'
+ |A numeric score to apply to all resources on this node
+ (0 or positive is healthy, negative is unhealthy)
+ indexterm:[Node health,score]
+
+ |=========================================================
+
+ === Node Health Strategy ===
+
+ Pacemaker assigns a node health score to each node, as the sum of the values of
+ all its node health attributes. This score will be used as a location
+ constraint applied to this node for all resources.
+
+ The +node-health-strategy+ cluster option controls how Pacemaker responds to
+ changes in node health attributes, and how it translates +red+, +yellow+, and
+ +green+ to scores.
+
+ Allowed values are:
+
+ .Node Health Strategies
+ [width="95%",cols="1m,<3",options="header",align="center"]
+ |=========================================================
+
+ |Value
+ |Effect
+
+ |none
+ |Do not track node health attributes at all.
+ indexterm:[Node health,none]
+
+ |migrate-on-red
+ |Assign the value of +-INFINITY+ to +red+, and 0 to +yellow+ and +green+.
+ This will cause all resources to move off the node if any attribute is +red+.
+ indexterm:[Node health,migrate-on-red]
+
+ |only-green
+ |Assign the value of +-INFINITY+ to +red+ and +yellow+, and 0 to +green+.
+ This will cause all resources to move off the node if any attribute is +red+
+ or +yellow+.
+ indexterm:[Node health,only-green]
+
+ |progressive
+ |Assign the value of the +node-health-red+ cluster option to +red+, the value
+ of +node-health-yellow+ to +yellow+, and the value of +node-health-green+ to
+ +green+. Each node is additionally assigned a score of +node-health-base+
+ (this allows resources to start even if some attributes are +yellow+). This
+ strategy gives the administrator finer control over how important each value
+ is.
+ indexterm:[Node health,progressive]
+
+ |custom
+ |Track node health attributes using the same values as +progressive+ for
+ +red+, +yellow+, and +green+, but do not take them into account.
+ The administrator is expected to implement a policy by defining rules
+ (see <>) referencing node health attributes.
+ indexterm:[Node health,custom]
+
+ |=========================================================
+
+ === Measuring Node Health ===
+
+ Since Pacemaker calculates node health based on node attributes,
+ any method that sets node attributes may be used to measure node
+ health. The most common ways are resource agents or separate daemons.
+
+ Pacemaker provides examples that can be used directly or as a basis for
+ custom code. The +ocf:pacemaker:HealthCPU+ and +ocf:pacemaker:HealthSMART+
+ resource agents set node health attributes based on CPU and disk parameters.
+ The +ipmiservicelogd+ daemon sets node health attributes based on IPMI
+ values (the +ocf:pacemaker:SystemHealth+ resource agent can be used to manage
+ the daemon as a cluster resource).
+
+ In order to take advantage of this feature - firstly add the resource to your cluster, preferably as a cloned resource to constantly measure health on all nodes:
+
+ =====
+ [source,XML]
+ ------------
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ------------
+ =====
+
+ This way attrd_updater will set proper status for each node running this resource. Any attribute matching "#health-[a-zA-z]+" will force cluster to migrate all resources from unhealthy node and place it on other nodes according to all constraints defined in your cluster.
+
+ When the node is no longer faulty you can force the cluster to restart the cloned resource on faulty node and make it available to take resources, in this case since we are using HealthIOWait provider:
+
+ ----
+ # attrd_updater -n "#health-iowait" -U "green" --node="" -d "60s"
+ ----
+
+ == Reloading Services After a Definition Change ==
+
+ The cluster automatically detects changes to the definition of
+ services it manages. The normal response is to stop the
+ service (using the old definition) and start it again (with the new
+ definition). This works well, but some services are smarter and can
+ be told to use a new set of options without restarting.
+
+ To take advantage of this capability, the resource agent must:
+
+ . Accept the +reload+ operation and perform any required actions.
+ _The actions here depend completely on your application!_
+ +
+ .The DRBD agent's logic for supporting +reload+
+ =====
+ [source,Bash]
+ -------
+ case $1 in
+ start)
+ drbd_start
+ ;;
+ stop)
+ drbd_stop
+ ;;
+ reload)
+ drbd_reload
+ ;;
+ monitor)
+ drbd_monitor
+ ;;
+ *)
+ drbd_usage
+ exit $OCF_ERR_UNIMPLEMENTED
+ ;;
+ esac
+ exit $?
+ -------
+ =====
+ . Advertise the +reload+ operation in the +actions+ section of its metadata
+ +
+ .The DRBD Agent Advertising Support for the +reload+ Operation
+ =====
+ [source,XML]
+ -------
+
+
+
+ 1.1
+
+
+ Master/Slave OCF Resource Agent for DRBD
+
+
+ ...
+
+
+
+
+
+
+
+
+
+
+
+
+ -------
+ =====
+ . Advertise one or more parameters that can take effect using +reload+.
+ +
+ Any parameter with the +unique+ set to 0 is eligible to be used in this way.
+ +
+ .Parameter that can be changed using reload
+ =====
+ [source,XML]
+ -------
+
+ Full path to the drbd.conf file.
+ Path to drbd.conf
+
+
+ -------
+ =====
+
+ Once these requirements are satisfied, the cluster will automatically
+ know to reload the resource (instead of restarting) when a non-unique
+ field changes.
+
+ [NOTE]
+ ======
+ Metadata will not be re-read unless the resource needs to be started. This may
+ mean that the resource will be restarted the first time, even though you
+ changed a parameter with +unique=0+.
+ ======
+
+ [NOTE]
+ ======
+ If both a unique and non-unique field are changed simultaneously, the
+ resource will still be restarted.
+ ======
diff --git a/doc/sphinx/Pacemaker_Explained/advanced-resources.rst b/doc/sphinx/Pacemaker_Explained/advanced-resources.rst
new file mode 100644
index 0000000000..9f348e3467
--- /dev/null
+++ b/doc/sphinx/Pacemaker_Explained/advanced-resources.rst
@@ -0,0 +1,1480 @@
+Advanced Resource Types
+-----------------------
+
+.. Convert_to_RST:
+
+ [[group-resources]]
+ == Groups - A Syntactic Shortcut ==
+ indexterm:[Group Resources]
+ indexterm:[Resource,Groups]
+
+
+ One of the most common elements of a cluster is a set of resources
+ that need to be located together, start sequentially, and stop in the
+ reverse order. To simplify this configuration, we support the concept
+ of groups.
+
+ .A group of two primitive resources
+ ======
+ [source,XML]
+ -------
+
+
+
+
+
+
+
+
+ -------
+ ======
+
+
+ Although the example above contains only two resources, there is no
+ limit to the number of resources a group can contain. The example is
+ also sufficient to explain the fundamental properties of a group:
+
+ * Resources are started in the order they appear in (+Public-IP+
+ first, then +Email+)
+ * Resources are stopped in the reverse order to which they appear in
+ (+Email+ first, then +Public-IP+)
+
+ If a resource in the group can't run anywhere, then nothing after that
+ is allowed to run, too.
+
+ * If +Public-IP+ can't run anywhere, neither can +Email+;
+ * but if +Email+ can't run anywhere, this does not affect +Public-IP+
+ in any way
+
+ The group above is logically equivalent to writing:
+
+ .How the cluster sees a group resource
+ ======
+ [source,XML]
+ -------
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -------
+ ======
+
+ Obviously as the group grows bigger, the reduced configuration effort
+ can become significant.
+
+ Another (typical) example of a group is a DRBD volume, the filesystem
+ mount, an IP address, and an application that uses them.
+
+ === Group Properties ===
+ .Properties of a Group Resource
+ [width="95%",cols="3m,<5",options="header",align="center"]
+ |=========================================================
+
+ |Field
+ |Description
+
+ |id
+ |A unique name for the group
+ indexterm:[id,Group Resource Property]
+ indexterm:[Resource,Group Property,id]
+
+ |=========================================================
+
+ === Group Options ===
+
+ Groups inherit the +priority+, +target-role+, and +is-managed+ properties
+ from primitive resources. See <> for information about
+ those properties.
+
+ === Group Instance Attributes ===
+
+ Groups have no instance attributes. However, any that are set for the group
+ object will be inherited by the group's children.
+
+ === Group Contents ===
+
+ Groups may only contain a collection of cluster resources (see
+ <>). To refer to a child of a group resource, just use
+ the child's +id+ instead of the group's.
+
+ === Group Constraints ===
+
+ Although it is possible to reference a group's children in
+ constraints, it is usually preferable to reference the group itself.
+
+ .Some constraints involving groups
+ ======
+ [source,XML]
+ -------
+
+
+
+
+
+ -------
+ ======
+
+ === Group Stickiness ===
+ indexterm:[resource-stickiness,Groups]
+
+ Stickiness, the measure of how much a resource wants to stay where it
+ is, is additive in groups. Every active resource of the group will
+ contribute its stickiness value to the group's total. So if the
+ default +resource-stickiness+ is 100, and a group has seven members,
+ five of which are active, then the group as a whole will prefer its
+ current location with a score of 500.
+
+ [[s-resource-clone]]
+ == Clones - Resources That Can Have Multiple Active Instances ==
+ indexterm:[Clone Resources]
+ indexterm:[Resource,Clones]
+
+ 'Clone' resources are resources that can have more than one copy active at the
+ same time. This allows you, for example, to run a copy of a daemon on every
+ node. You can clone any primitive or group resource.
+ footnote:[
+ Of course, the service must support running multiple instances.
+ ]
+
+ === Anonymous versus Unique Clones ===
+
+ A clone resource is configured to be either 'anonymous' or 'globally unique'.
+
+ Anonymous clones are the simplest. These behave completely identically
+ everywhere they are running. Because of this, there can be only one instance of
+ an anonymous clone active per node.
+
+ The instances of globally unique clones are distinct entities. All instances
+ are launched identically, but one instance of the clone is not identical to any
+ other instance, whether running on the same node or a different node. As an
+ example, a cloned IP address can use special kernel functionality such that
+ each instance handles a subset of requests for the same IP address.
+
+ [[s-resource-promotable]]
+ === Promotable clones ===
+
+ indexterm:[Promotable Clone Resources]
+ indexterm:[Resource,Promotable]
+
+ If a clone is 'promotable', its instances can perform a special role that
+ Pacemaker will manage via the +promote+ and +demote+ actions of the resource
+ agent.
+
+ Services that support such a special role have various terms for the special
+ role and the default role: primary and secondary, master and replica,
+ controller and worker, etc. Pacemaker uses the terms 'master' and 'slave',
+ footnote:[
+ These are historical terms that will eventually be replaced, but the extensive
+ use of them and the need for backward compatibility makes it a long process.
+ You may see examples using a +master+ tag instead of a +clone+ tag with the
+ +promotable+ meta-attribute set to +true+; the +master+ tag is supported, but
+ deprecated, and will be removed in a future version. You may also see such
+ services referred to as 'multi-state' or 'stateful'; these means the same thing
+ as 'promotable'.
+ ]
+ but is agnostic to what the service calls them or what they do.
+
+ All that Pacemaker cares about is that an instance comes up in the default role
+ when started, and the resource agent supports the +promote+ and +demote+ actions
+ to manage entering and exiting the special role.
+
+ === Clone Properties ===
+
+ .Properties of a Clone Resource
+ [width="95%",cols="3m,<5",options="header",align="center"]
+ |=========================================================
+
+ |Field
+ |Description
+
+ |id
+ |A unique name for the clone
+ indexterm:[id,Clone Property]
+ indexterm:[Clone,Property,id]
+
+ |=========================================================
+
+ === Clone Options ===
+
+ <> inherited from primitive resources:
+ +priority, target-role, is-managed+
+
+ .Clone-specific configuration options
+ [width="95%",cols="1m,1,<3",options="header",align="center"]
+ |=========================================================
+
+ |Field
+ |Default
+ |Description
+
+ |globally-unique
+ |false
+ |If +true+, each clone instance performs a distinct function
+ indexterm:[globally-unique,Clone Option]
+ indexterm:[Clone,Option,globally-unique]
+
+ |clone-max
+ |number of nodes in cluster
+ |The maximum number of clone instances that can be started across the entire
+ cluster
+ indexterm:[clone-max,Clone Option]
+ indexterm:[Clone,Option,clone-max]
+
+ |clone-node-max
+ |1
+ |If +globally-unique+ is +true+, the maximum number of clone instances that can
+ be started on a single node
+ indexterm:[clone-node-max,Clone Option]
+ indexterm:[Clone,Option,clone-node-max]
+
+ |clone-min
+ |0
+ |Require at least this number of clone instances to be runnable before allowing
+ resources depending on the clone to be runnable. A value of 0 means require
+ all clone instances to be runnable.
+ indexterm:[clone-min,Clone Option]
+ indexterm:[Clone,Option,clone-min]
+
+ |notify
+ |false
+ |Call the resource agent's +notify+ action for all active instances, before and
+ after starting or stopping any clone instance. The resource agent must support
+ this action. Allowed values: +false+, +true+
+ indexterm:[notify,Clone Option]
+ indexterm:[Clone,Option,notify]
+
+ |ordered
+ |false
+ |If +true+, clone instances must be started sequentially instead of in parallel
+ Allowed values: +false+, +true+
+ indexterm:[ordered,Clone Option]
+ indexterm:[Clone,Option,ordered]
+
+ |interleave
+ |false
+ |When this clone is ordered relative to another clone, if this option is
+ +false+ (the default), the ordering is relative to 'all' instances of the
+ other clone, whereas if this option is +true+, the ordering is relative only
+ to instances on the same node.
+ Allowed values: +false+, +true+
+ indexterm:[interleave,Clone Option]
+ indexterm:[Clone,Option,interleave]
+
+ |promotable
+ |false
+ |If +true+, clone instances can perform a special role that Pacemaker will
+ manage via the resource agent's +promote+ and +demote+ actions. The resource
+ agent must support these actions.
+ Allowed values: +false+, +true+
+ indexterm:[promotable,Clone Option]
+ indexterm:[Clone,Option,promotable]
+
+ |promoted-max
+ |1
+ |If +promotable+ is +true+, the number of instances that can be promoted at one
+ time across the entire cluster
+ indexterm:[promoted-max,Clone Option]
+ indexterm:[Clone,Option,promoted-max]
+
+ |promoted-node-max
+ |1
+ |If +promotable+ is +true+ and +globally-unique+ is +false+, the number of
+ clone instances can be promoted at one time on a single node
+ indexterm:[promoted-node-max,Clone Option]
+ indexterm:[Clone,Option,promoted-node-max]
+
+ |=========================================================
+
+ For backward compatibility, +master-max+ and +master-node-max+ are accepted as
+ aliases for +promoted-max+ and +promoted-node-max+, but are deprecated since
+ 2.0.0, and support for them will be removed in a future version.
+
+ === Clone Contents ===
+
+ Clones must contain exactly one primitive or group resource.
+
+ .A clone that runs a web server on all nodes
+ ====
+ [source,XML]
+ ----
+
+
+
+
+
+
+
+ ----
+ ====
+
+ [WARNING]
+ You should never reference the name of a clone's child (the primitive or group
+ resource being cloned). If you think you need to do this, you probably need to
+ re-evaluate your design.
+
+ === Clone Instance Attributes ===
+
+ Clones have no instance attributes; however, any that are set here will be
+ inherited by the clone's child.
+
+ === Clone Constraints ===
+
+ In most cases, a clone will have a single instance on each active cluster
+ node. If this is not the case, you can indicate which nodes the
+ cluster should preferentially assign copies to with resource location
+ constraints. These constraints are written no differently from those
+ for primitive resources except that the clone's +id+ is used.
+
+ .Some constraints involving clones
+ ======
+ [source,XML]
+ -------
+
+
+
+
+
+ -------
+ ======
+
+ Ordering constraints behave slightly differently for clones. In the
+ example above, +apache-stats+ will wait until all copies of +apache-clone+
+ that need to be started have done so before being started itself.
+ Only if _no_ copies can be started will +apache-stats+ be prevented
+ from being active. Additionally, the clone will wait for
+ +apache-stats+ to be stopped before stopping itself.
+
+ Colocation of a primitive or group resource with a clone means that
+ the resource can run on any node with an active instance of the clone.
+ The cluster will choose an instance based on where the clone is running and
+ the resource's own location preferences.
+
+ Colocation between clones is also possible. If one clone +A+ is colocated
+ with another clone +B+, the set of allowed locations for +A+ is limited to
+ nodes on which +B+ is (or will be) active. Placement is then performed
+ normally.
+
+ ==== Promotable Clone Constraints ====
+
+ For promotable clone resources, the +first-action+ and/or +then-action+ fields
+ for ordering constraints may be set to +promote+ or +demote+ to constrain the
+ master role, and colocation constraints may contain +rsc-role+ and/or
+ +with-rsc-role+ fields.
+
+ .Additional colocation constraint options for promotable clone resources
+ [width="95%",cols="1m,1,<3",options="header",align="center"]
+ |=========================================================
+
+ |Field
+ |Default
+ |Description
+
+ |rsc-role
+ |Started
+ |An additional attribute of colocation constraints that specifies the
+ role that +rsc+ must be in. Allowed values: +Started+, +Master+,
+ +Slave+.
+ indexterm:[rsc-role,Ordering Constraints]
+ indexterm:[Constraints,Ordering,rsc-role]
+
+ |with-rsc-role
+ |Started
+ |An additional attribute of colocation constraints that specifies the
+ role that +with-rsc+ must be in. Allowed values: +Started+,
+ +Master+, +Slave+.
+ indexterm:[with-rsc-role,Ordering Constraints]
+ indexterm:[Constraints,Ordering,with-rsc-role]
+
+ |=========================================================
+
+ .Constraints involving promotable clone resources
+ ======
+ [source,XML]
+ -------
+
+
+
+
+
+
+
+ -------
+ ======
+
+ In the example above, +myApp+ will wait until one of the database
+ copies has been started and promoted to master before being started
+ itself on the same node. Only if no copies can be promoted will +myApp+ be
+ prevented from being active. Additionally, the cluster will wait for
+ +myApp+ to be stopped before demoting the database.
+
+ Colocation of a primitive or group resource with a promotable clone
+ resource means that it can run on any node with an active instance of
+ the promotable clone resource that has the specified role (+master+ or
+ +slave+). In the example above, the cluster will choose a location based on
+ where database is running as a +master+, and if there are multiple
+ +master+ instances it will also factor in +myApp+'s own location
+ preferences when deciding which location to choose.
+
+ Colocation with regular clones and other promotable clone resources is also
+ possible. In such cases, the set of allowed locations for the +rsc+
+ clone is (after role filtering) limited to nodes on which the
+ +with-rsc+ promotable clone resource is (or will be) in the specified role.
+ Placement is then performed as normal.
+
+ ==== Using Promotable Clone Resources in Colocation Sets ====
+
+ .Additional colocation set options relevant to promotable clone resources
+ [width="95%",cols="1m,1,<6",options="header",align="center"]
+ |=========================================================
+
+ |Field
+ |Default
+ |Description
+
+ |role
+ |Started
+ |The role that 'all members' of the set must be in. Allowed values: +Started+, +Master+,
+ +Slave+.
+ indexterm:[role,Ordering Constraints]
+ indexterm:[Constraints,Ordering,role]
+
+ |=========================================================
+
+ In the following example +B+'s master must be located on the same node as +A+'s master.
+ Additionally resources +C+ and +D+ must be located on the same node as +A+'s
+ and +B+'s masters.
+
+ .Colocate C and D with A's and B's master instances
+ ======
+ [source,XML]
+ -------
+
+
+
+
+
+
+
+
+
+
+
+
+ -------
+ ======
+
+ ==== Using Promotable Clone Resources in Ordered Sets ====
+
+ .Additional ordered set options relevant to promotable clone resources
+ [width="95%",cols="1m,1,<3",options="header",align="center"]
+ |=========================================================
+
+ |Field
+ |Default
+ |Description
+
+ |action
+ |value of +first-action+
+ |An additional attribute of ordering constraint sets that specifies the
+ action that applies to 'all members' of the set. Allowed
+ values: +start+, +stop+, +promote+, +demote+.
+ indexterm:[action,Ordering Constraints]
+ indexterm:[Constraints,Ordering,action]
+
+ |=========================================================
+
+ .Start C and D after first promoting A and B
+ ======
+ [source,XML]
+ -------
+
+
+
+
+
+
+
+
+
+
+
+
+ -------
+ ======
+
+ In the above example, +B+ cannot be promoted to a master role until +A+ has
+ been promoted. Additionally, resources +C+ and +D+ must wait until +A+ and +B+
+ have been promoted before they can start.
+
+
+ [[s-clone-stickiness]]
+ === Clone Stickiness ===
+
+ indexterm:[resource-stickiness,Clones]
+
+ To achieve a stable allocation pattern, clones are slightly sticky by
+ default. If no value for +resource-stickiness+ is provided, the clone
+ will use a value of 1. Being a small value, it causes minimal
+ disturbance to the score calculations of other resources but is enough
+ to prevent Pacemaker from needlessly moving copies around the cluster.
+
+ [NOTE]
+ ====
+ For globally unique clones, this may result in multiple instances of the
+ clone staying on a single node, even after another eligible node becomes
+ active (for example, after being put into standby mode then made active again).
+ If you do not want this behavior, specify a +resource-stickiness+ of 0
+ for the clone temporarily and let the cluster adjust, then set it back
+ to 1 if you want the default behavior to apply again.
+ ====
+
+ [IMPORTANT]
+ ====
+ If +resource-stickiness+ is set in the +rsc_defaults+ section, it will
+ apply to clone instances as well. This means an explicit +resource-stickiness+
+ of 0 in +rsc_defaults+ works differently from the implicit default used when
+ +resource-stickiness+ is not specified.
+ ====
+
+ === Clone Resource Agent Requirements ===
+
+ Any resource can be used as an anonymous clone, as it requires no
+ additional support from the resource agent. Whether it makes sense to
+ do so depends on your resource and its resource agent.
+
+ ==== Resource Agent Requirements for Globally Unique Clones ====
+
+ Globally unique clones require additional support in the resource agent. In
+ particular, it must only respond with +$\{OCF_SUCCESS}+ if the node has that
+ exact instance active. All other probes for instances of the clone should
+ result in +$\{OCF_NOT_RUNNING}+ (or one of the other OCF error codes if
+ they are failed).
+
+ Individual instances of a clone are identified by appending a colon and a
+ numerical offset, e.g. +apache:2+.
+
+ Resource agents can find out how many copies there are by examining
+ the +OCF_RESKEY_CRM_meta_clone_max+ environment variable and which
+ instance it is by examining +OCF_RESKEY_CRM_meta_clone+.
+
+ The resource agent must not make any assumptions (based on
+ +OCF_RESKEY_CRM_meta_clone+) about which numerical instances are active. In
+ particular, the list of active copies will not always be an unbroken
+ sequence, nor always start at 0.
+
+ ==== Resource Agent Requirements for Promotable Clones ====
+
+ Promotable clone resources require two extra actions, +demote+ and +promote+,
+ which are responsible for changing the state of the resource. Like +start+ and
+ +stop+, they should return +$\{OCF_SUCCESS}+ if they completed successfully or
+ a relevant error code if they did not.
+
+ The states can mean whatever you wish, but when the resource is
+ started, it must come up in the mode called +slave+. From there the
+ cluster will decide which instances to promote to +master+.
+
+ In addition to the clone requirements for monitor actions, agents must
+ also _accurately_ report which state they are in. The cluster relies
+ on the agent to report its status (including role) accurately and does
+ not indicate to the agent what role it currently believes it to be in.
+
+ .Role implications of OCF return codes
+ [width="95%",cols="1,<1",options="header",align="center"]
+ |=========================================================
+
+ |Monitor Return Code
+ |Description
+
+ |OCF_NOT_RUNNING
+ |Stopped
+ indexterm:[Return Code,OCF_NOT_RUNNING]
+
+ |OCF_SUCCESS
+ |Running (Slave)
+ indexterm:[Return Code,OCF_SUCCESS]
+
+ |OCF_RUNNING_MASTER
+ |Running (Master)
+ indexterm:[Return Code,OCF_RUNNING_MASTER]
+
+ |OCF_FAILED_MASTER
+ |Failed (Master)
+ indexterm:[Return Code,OCF_FAILED_MASTER]
+
+ |Other
+ |Failed (Slave)
+
+ |=========================================================
+
+ ==== Clone Notifications ====
+
+ If the clone has the +notify+ meta-attribute set to +true+, and the resource
+ agent supports the +notify+ action, Pacemaker will call the action when
+ appropriate, passing a number of extra variables which, when combined with
+ additional context, can be used to calculate the current state of the cluster
+ and what is about to happen to it.
+
+ .Environment variables supplied with Clone notify actions
+ [width="95%",cols="5,<3",options="header",align="center"]
+ |=========================================================
+
+ |Variable
+ |Description
+
+ |OCF_RESKEY_CRM_meta_notify_type
+ |Allowed values: +pre+, +post+
+ indexterm:[Environment Variable,OCF_RESKEY_CRM_meta_notify_,type]
+ indexterm:[type,Notification Environment Variable]
+
+ |OCF_RESKEY_CRM_meta_notify_operation
+ |Allowed values: +start+, +stop+
+ indexterm:[Environment Variable,OCF_RESKEY_CRM_meta_notify_,operation]
+ indexterm:[operation,Notification Environment Variable]
+
+ |OCF_RESKEY_CRM_meta_notify_start_resource
+ |Resources to be started
+ indexterm:[Environment Variable,OCF_RESKEY_CRM_meta_notify_,start_resource]
+ indexterm:[start_resource,Notification Environment Variable]
+
+ |OCF_RESKEY_CRM_meta_notify_stop_resource
+ |Resources to be stopped
+ indexterm:[Environment Variable,OCF_RESKEY_CRM_meta_notify_,stop_resource]
+ indexterm:[stop_resource,Notification Environment Variable]
+
+ |OCF_RESKEY_CRM_meta_notify_active_resource
+ |Resources that are running
+ indexterm:[Environment Variable,OCF_RESKEY_CRM_meta_notify_,active_resource]
+ indexterm:[active_resource,Notification Environment Variable]
+
+ |OCF_RESKEY_CRM_meta_notify_inactive_resource
+ |Resources that are not running
+ indexterm:[Environment Variable,OCF_RESKEY_CRM_meta_notify_,inactive_resource]
+ indexterm:[inactive_resource,Notification Environment Variable]
+
+ |OCF_RESKEY_CRM_meta_notify_start_uname
+ |Nodes on which resources will be started
+ indexterm:[Environment Variable,OCF_RESKEY_CRM_meta_notify_,start_uname]
+ indexterm:[start_uname,Notification Environment Variable]
+
+ |OCF_RESKEY_CRM_meta_notify_stop_uname
+ |Nodes on which resources will be stopped
+ indexterm:[Environment Variable,OCF_RESKEY_CRM_meta_notify_,stop_uname]
+ indexterm:[stop_uname,Notification Environment Variable]
+
+ |OCF_RESKEY_CRM_meta_notify_active_uname
+ |Nodes on which resources are running
+ indexterm:[Environment Variable,OCF_RESKEY_CRM_meta_notify_,active_uname]
+ indexterm:[active_uname,Notification Environment Variable]
+
+ |=========================================================
+
+ The variables come in pairs, such as
+ +OCF_RESKEY_CRM_meta_notify_start_resource+ and
+ +OCF_RESKEY_CRM_meta_notify_start_uname+, and should be treated as an
+ array of whitespace-separated elements.
+
+ +OCF_RESKEY_CRM_meta_notify_inactive_resource+ is an exception, as the
+ matching +uname+ variable does not exist since inactive resources
+ are not running on any node.
+
+ Thus, in order to indicate that +clone:0+ will be started on +sles-1+,
+ +clone:2+ will be started on +sles-3+, and +clone:3+ will be started
+ on +sles-2+, the cluster would set:
+
+ .Notification variables
+ ======
+ [source,Bash]
+ -------
+ OCF_RESKEY_CRM_meta_notify_start_resource="clone:0 clone:2 clone:3"
+ OCF_RESKEY_CRM_meta_notify_start_uname="sles-1 sles-3 sles-2"
+ -------
+ ======
+
+ [NOTE]
+ ====
+ Pacemaker will log but otherwise ignore failures of notify actions.
+ ====
+
+ ==== Interpretation of Notification Variables ====
+
+ .Pre-notification (stop):
+
+ * Active resources: +$OCF_RESKEY_CRM_meta_notify_active_resource+
+ * Inactive resources: +$OCF_RESKEY_CRM_meta_notify_inactive_resource+
+ * Resources to be started: +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ * Resources to be stopped: +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+
+
+ .Post-notification (stop) / Pre-notification (start):
+
+ * Active resources
+ ** +$OCF_RESKEY_CRM_meta_notify_active_resource+
+ ** minus +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+ * Inactive resources
+ ** +$OCF_RESKEY_CRM_meta_notify_inactive_resource+
+ ** plus +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+ * Resources that were started: +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ * Resources that were stopped: +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+
+
+ .Post-notification (start):
+
+ * Active resources:
+ ** +$OCF_RESKEY_CRM_meta_notify_active_resource+
+ ** minus +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+ ** plus +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ * Inactive resources:
+ ** +$OCF_RESKEY_CRM_meta_notify_inactive_resource+
+ ** plus +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+ ** minus +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ * Resources that were started: +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ * Resources that were stopped: +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+
+ ==== Extra Notifications for Promotable Clones ====
+
+ .Extra environment variables supplied for promotable clones
+ [width="95%",cols="5,<3",options="header",align="center"]
+ |=========================================================
+
+ |Variable
+ |Description
+
+ |OCF_RESKEY_CRM_meta_notify_master_resource
+ |Resources that are running in +Master+ mode
+ indexterm:[Environment Variable,OCF_RESKEY_CRM_meta_notify_,master_resource]
+ indexterm:[master_resource,Notification Environment Variable]
+
+ |OCF_RESKEY_CRM_meta_notify_slave_resource
+ |Resources that are running in +Slave+ mode
+ indexterm:[Environment Variable,OCF_RESKEY_CRM_meta_notify_,slave_resource]
+ indexterm:[slave_resource,Notification Environment Variable]
+
+ |OCF_RESKEY_CRM_meta_notify_promote_resource
+ |Resources to be promoted
+ indexterm:[Environment Variable,OCF_RESKEY_CRM_meta_notify_,promote_resource]
+ indexterm:[promote_resource,Notification Environment Variable]
+
+ |OCF_RESKEY_CRM_meta_notify_demote_resource
+ |Resources to be demoted
+ indexterm:[Environment Variable,OCF_RESKEY_CRM_meta_notify_,demote_resource]
+ indexterm:[demote_resource,Notification Environment Variable]
+
+ |OCF_RESKEY_CRM_meta_notify_promote_uname
+ |Nodes on which resources will be promoted
+ indexterm:[Environment Variable,OCF_RESKEY_CRM_meta_notify_,promote_uname]
+ indexterm:[promote_uname,Notification Environment Variable]
+
+ |OCF_RESKEY_CRM_meta_notify_demote_uname
+ |Nodes on which resources will be demoted
+ indexterm:[Environment Variable,OCF_RESKEY_CRM_meta_notify_,demote_uname]
+ indexterm:[demote_uname,Notification Environment Variable]
+
+ |OCF_RESKEY_CRM_meta_notify_master_uname
+ |Nodes on which resources are running in +Master+ mode
+ indexterm:[Environment Variable,OCF_RESKEY_CRM_meta_notify_,master_uname]
+ indexterm:[master_uname,Notification Environment Variable]
+
+ |OCF_RESKEY_CRM_meta_notify_slave_uname
+ |Nodes on which resources are running in +Slave+ mode
+ indexterm:[Environment Variable,OCF_RESKEY_CRM_meta_notify_,slave_uname]
+ indexterm:[slave_uname,Notification Environment Variable]
+
+ |=========================================================
+
+ ==== Interpretation of Promotable Notification Variables ====
+
+ .Pre-notification (demote):
+
+ * +Active+ resources: +$OCF_RESKEY_CRM_meta_notify_active_resource+
+ * +Master+ resources: +$OCF_RESKEY_CRM_meta_notify_master_resource+
+ * +Slave+ resources: +$OCF_RESKEY_CRM_meta_notify_slave_resource+
+ * Inactive resources: +$OCF_RESKEY_CRM_meta_notify_inactive_resource+
+ * Resources to be started: +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ * Resources to be promoted: +$OCF_RESKEY_CRM_meta_notify_promote_resource+
+ * Resources to be demoted: +$OCF_RESKEY_CRM_meta_notify_demote_resource+
+ * Resources to be stopped: +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+
+
+ .Post-notification (demote) / Pre-notification (stop):
+
+ * +Active+ resources: +$OCF_RESKEY_CRM_meta_notify_active_resource+
+ * +Master+ resources:
+ ** +$OCF_RESKEY_CRM_meta_notify_master_resource+
+ ** minus +$OCF_RESKEY_CRM_meta_notify_demote_resource+
+ * +Slave+ resources: +$OCF_RESKEY_CRM_meta_notify_slave_resource+
+ * Inactive resources: +$OCF_RESKEY_CRM_meta_notify_inactive_resource+
+ * Resources to be started: +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ * Resources to be promoted: +$OCF_RESKEY_CRM_meta_notify_promote_resource+
+ * Resources to be demoted: +$OCF_RESKEY_CRM_meta_notify_demote_resource+
+ * Resources to be stopped: +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+ * Resources that were demoted: +$OCF_RESKEY_CRM_meta_notify_demote_resource+
+
+
+ .Post-notification (stop) / Pre-notification (start)
+
+ * +Active+ resources:
+ ** +$OCF_RESKEY_CRM_meta_notify_active_resource+
+ ** minus +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+ * +Master+ resources:
+ ** +$OCF_RESKEY_CRM_meta_notify_master_resource+
+ ** minus +$OCF_RESKEY_CRM_meta_notify_demote_resource+
+ * +Slave+ resources:
+ ** +$OCF_RESKEY_CRM_meta_notify_slave_resource+
+ ** minus +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+ * Inactive resources:
+ ** +$OCF_RESKEY_CRM_meta_notify_inactive_resource+
+ ** plus +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+ * Resources to be started: +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ * Resources to be promoted: +$OCF_RESKEY_CRM_meta_notify_promote_resource+
+ * Resources to be demoted: +$OCF_RESKEY_CRM_meta_notify_demote_resource+
+ * Resources to be stopped: +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+ * Resources that were demoted: +$OCF_RESKEY_CRM_meta_notify_demote_resource+
+ * Resources that were stopped: +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+
+
+ .Post-notification (start) / Pre-notification (promote)
+
+ * +Active+ resources:
+ ** +$OCF_RESKEY_CRM_meta_notify_active_resource+
+ ** minus +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+ ** plus +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ * +Master+ resources:
+ ** +$OCF_RESKEY_CRM_meta_notify_master_resource+
+ ** minus +$OCF_RESKEY_CRM_meta_notify_demote_resource+
+ * +Slave+ resources:
+ ** +$OCF_RESKEY_CRM_meta_notify_slave_resource+
+ ** minus +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+ ** plus +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ * Inactive resources:
+ ** +$OCF_RESKEY_CRM_meta_notify_inactive_resource+
+ ** plus +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+ ** minus +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ * Resources to be started: +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ * Resources to be promoted: +$OCF_RESKEY_CRM_meta_notify_promote_resource+
+ * Resources to be demoted: +$OCF_RESKEY_CRM_meta_notify_demote_resource+
+ * Resources to be stopped: +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+ * Resources that were started: +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ * Resources that were demoted: +$OCF_RESKEY_CRM_meta_notify_demote_resource+
+ * Resources that were stopped: +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+
+ .Post-notification (promote)
+
+ * +Active+ resources:
+ ** +$OCF_RESKEY_CRM_meta_notify_active_resource+
+ ** minus +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+ ** plus +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ * +Master+ resources:
+ ** +$OCF_RESKEY_CRM_meta_notify_master_resource+
+ ** minus +$OCF_RESKEY_CRM_meta_notify_demote_resource+
+ ** plus +$OCF_RESKEY_CRM_meta_notify_promote_resource+
+ * +Slave+ resources:
+ ** +$OCF_RESKEY_CRM_meta_notify_slave_resource+
+ ** minus +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+ ** plus +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ ** minus +$OCF_RESKEY_CRM_meta_notify_promote_resource+
+ * Inactive resources:
+ ** +$OCF_RESKEY_CRM_meta_notify_inactive_resource+
+ ** plus +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+ ** minus +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ * Resources to be started: +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ * Resources to be promoted: +$OCF_RESKEY_CRM_meta_notify_promote_resource+
+ * Resources to be demoted: +$OCF_RESKEY_CRM_meta_notify_demote_resource+
+ * Resources to be stopped: +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+ * Resources that were started: +$OCF_RESKEY_CRM_meta_notify_start_resource+
+ * Resources that were promoted: +$OCF_RESKEY_CRM_meta_notify_promote_resource+
+ * Resources that were demoted: +$OCF_RESKEY_CRM_meta_notify_demote_resource+
+ * Resources that were stopped: +$OCF_RESKEY_CRM_meta_notify_stop_resource+
+
+ === Monitoring Promotable Clone Resources ===
+
+ The usual monitor actions are insufficient to monitor a promotable clone
+ resource, because Pacemaker needs to verify not only that the resource is
+ active, but also that its actual role matches its intended one.
+
+ Define two monitoring actions: the usual one will cover the slave role,
+ and an additional one with +role="master"+ will cover the master role.
+
+ .Monitoring both states of a promotable clone resource
+ ======
+ [source,XML]
+ -------
+
+
+
+
+
+
+
+
+
+
+
+ -------
+ ======
+
+ [IMPORTANT]
+ ===========
+ It is crucial that _every_ monitor operation has a different interval!
+ Pacemaker currently differentiates between operations
+ only by resource and interval; so if (for example) a promotable clone resource
+ had the same monitor interval for both roles, Pacemaker would ignore the
+ role when checking the status -- which would cause unexpected return
+ codes, and therefore unnecessary complications.
+ ===========
+
+ [[s-promotion-scores]]
+ === Determining Which Instance is Promoted ===
+
+ Pacemaker can choose a promotable clone instance to be promoted in one of two
+ ways:
+
+ * Promotion scores: These are node attributes set via the `crm_master` utility,
+ which generally would be called by the resource agent's start action if it
+ supports promotable clones. This tool automatically detects both the resource
+ and host, and should be used to set a preference for being promoted. Based on
+ this, +promoted-max+, and +promoted-node-max+, the instance(s) with the
+ highest preference will be promoted.
+
+ * Constraints: Location constraints can indicate which nodes are most preferred
+ as masters.
+
+ .Explicitly preferring node1 to be promoted to master
+ ======
+ [source,XML]
+ -------
+
+
+
+
+
+ -------
+ ======
+
+ [[s-resource-bundle]]
+ == Bundles - Isolated Environments ==
+ indexterm:[Resource,Bundle]
+ indexterm:[Container,Docker,Bundle]
+ indexterm:[Container,podman,Bundle]
+ indexterm:[Container,rkt,Bundle]
+
+ Pacemaker supports a special syntax for launching a
+ https://en.wikipedia.org/wiki/Operating-system-level_virtualization[container]
+ with any infrastructure it requires: the 'bundle'.
+
+ Pacemaker bundles support https://www.docker.com/[Docker],
+ https://podman.io/[podman], and https://coreos.com/rkt/[rkt]
+ container technologies.
+ footnote:[Docker is a trademark of Docker, Inc. No endorsement by or
+ association with Docker, Inc. is implied.]
+
+ .A bundle for a containerized web server
+ ====
+ [source,XML]
+ ----
+
+
+
+
+
+
+
+
+
+
+
+
+ ----
+ ====
+
+ === Bundle Prerequisites ===
+ indexterm:[Resource,Bundle,Prerequisites]
+
+ Before configuring a bundle in Pacemaker, the user must install the appropriate
+ container launch technology (Docker, podman, or rkt), and supply a fully
+ configured container image, on every node allowed to run the bundle.
+
+ Pacemaker will create an implicit resource of type +ocf:heartbeat:docker+,
+ +ocf:heartbeat:podman+, or +ocf:heartbeat:rkt+ to manage a bundle's
+ container. The user must ensure that the appropriate resource agent is
+ installed on every node allowed to run the bundle.
+
+ === Bundle Properties ===
+
+ indexterm:[XML element,bundle element]
+
+ .XML Attributes of a bundle Element
+ [width="95%",cols="3m,<5",options="header",align="center"]
+ |=========================================================
+
+ |Attribute
+ |Description
+
+ |id
+ |A unique name for the bundle (required)
+ indexterm:[XML attribute,id attribute,bundle element]
+ indexterm:[XML element,bundle element,id attribute]
+
+ |description
+ |Arbitrary text (not used by Pacemaker)
+ indexterm:[XML attribute,description attribute,bundle element]
+ indexterm:[XML element,bundle element,description attribute]
+
+ |=========================================================
+
+ A bundle must contain exactly one +docker+, +podman+, or +rkt+ element.
+
+ === Bundle Container Properties ===
+ indexterm:[XML element,docker element]
+ indexterm:[XML element,podman element]
+ indexterm:[XML element,rkt element]
+ indexterm:[Resource,Bundle,Container]
+
+ .XML attributes of a docker, podman, or rkt Element
+ [width="95%",cols="3m,4,<5",options="header",align="center"]
+ |====
+
+ |Attribute
+ |Default
+ |Description
+
+ |image
+ |
+ |Container image tag (required)
+ indexterm:[XML attribute,image attribute,docker element]
+ indexterm:[XML element,docker element,image attribute]
+ indexterm:[XML attribute,image attribute,podman element]
+ indexterm:[XML element,podman element,image attribute]
+ indexterm:[XML attribute,image attribute,rkt element]
+ indexterm:[XML element,rkt element,image attribute]
+
+ |replicas
+ |Value of +promoted-max+ if that is positive, else 1
+ |A positive integer specifying the number of container instances to launch
+ indexterm:[XML attribute,replicas attribute,docker element]
+ indexterm:[XML element,docker element,replicas attribute]
+ indexterm:[XML attribute,replicas attribute,podman element]
+ indexterm:[XML element,podman element,replicas attribute]
+ indexterm:[XML attribute,replicas attribute,rkt element]
+ indexterm:[XML element,rkt element,replicas attribute]
+
+ |replicas-per-host
+ |1
+ |A positive integer specifying the number of container instances allowed to run
+ on a single node
+ indexterm:[XML attribute,replicas-per-host attribute,docker element]
+ indexterm:[XML element,docker element,replicas-per-host attribute]
+ indexterm:[XML attribute,replicas-per-host attribute,podman element]
+ indexterm:[XML element,podman element,replicas-per-host attribute]
+ indexterm:[XML attribute,replicas-per-host attribute,rkt element]
+ indexterm:[XML element,rkt element,replicas-per-host attribute]
+
+ |promoted-max
+ |0
+ |A non-negative integer that, if positive, indicates that the containerized
+ service should be treated as a promotable service, with this many replicas
+ allowed to run the service in the master role
+ indexterm:[XML attribute,promoted-max attribute,docker element]
+ indexterm:[XML element,docker element,promoted-max attribute]
+ indexterm:[XML attribute,promoted-max attribute,podman element]
+ indexterm:[XML element,podman element,promoted-max attribute]
+ indexterm:[XML attribute,promoted-max attribute,rkt element]
+ indexterm:[XML element,rkt element,promoted-max attribute]
+
+ |network
+ |
+ |If specified, this will be passed to the `docker run`, `podman run`, or
+ `rkt run` command as the network setting for the container.
+ indexterm:[XML attribute,network attribute,docker element]
+ indexterm:[XML element,docker element,network attribute]
+ indexterm:[XML attribute,network attribute,podman element]
+ indexterm:[XML element,podman element,network attribute]
+ indexterm:[XML attribute,network attribute,rkt element]
+ indexterm:[XML element,rkt element,network attribute]
+
+ |run-command
+ |`/usr/sbin/pacemaker-remoted` if bundle contains a +primitive+, otherwise none
+ |This command will be run inside the container when launching it ("PID 1"). If
+ the bundle contains a +primitive+, this command 'must' start pacemaker-remoted
+ (but could, for example, be a script that does other stuff, too).
+ indexterm:[XML attribute,run-command attribute,docker element]
+ indexterm:[XML element,docker element,run-command attribute]
+ indexterm:[XML attribute,run-command attribute,podman element]
+ indexterm:[XML element,podman element,run-command attribute]
+ indexterm:[XML attribute,run-command attribute,rkt element]
+ indexterm:[XML element,rkt element,run-command attribute]
+
+ |options
+ |
+ |Extra command-line options to pass to the `docker run`, `podman run`, or
+ `rkt run` command
+ indexterm:[XML attribute,options attribute,docker element]
+ indexterm:[XML element,docker element,options attribute]
+ indexterm:[XML attribute,options attribute,podman element]
+ indexterm:[XML element,podman element,options attribute]
+ indexterm:[XML attribute,options attribute,rkt element]
+ indexterm:[XML element,rkt element,options attribute]
+
+ |====
+
+ [NOTE]
+ ====
+ Considerations when using cluster configurations or container images from
+ Pacemaker 1.1:
+
+ - If the container image has a pre-2.0.0 version of Pacemaker, set +run-command+
+ to +/usr/sbin/pacemaker_remoted+ (note the underbar instead of dash).
+
+ - +masters+ is accepted as an alias for +promoted-max+, but is deprecated since
+ 2.0.0, and support for it will be removed in a future version.
+ ====
+
+ === Bundle Network Properties ===
+
+ A bundle may optionally contain one ++ element.
+ indexterm:[XML element,network element]
+ indexterm:[Resource,Bundle,Networking]
+
+ .XML attributes of a network Element
+ [width="95%",cols="2m,1,<4",options="header",align="center"]
+ |=========================================================
+
+ |Attribute
+ |Default
+ |Description
+
+ |add-host
+ |TRUE
+ |If TRUE, and +ip-range-start+ is used, Pacemaker will automatically ensure
+ that +/etc/hosts+ inside the containers has entries for each
+ <> and its assigned IP.
+ indexterm:[XML element,add-host attribute,network element]
+ indexterm:[XML attribute,network element,add-host attribute]
+
+ |ip-range-start
+ |
+ |If specified, Pacemaker will create an implicit +ocf:heartbeat:IPaddr2+
+ resource for each container instance, starting with this IP address,
+ using up to +replicas+ sequential addresses. These addresses can be used
+ from the host's network to reach the service inside the container, though
+ it is not visible within the container itself. Only IPv4 addresses are
+ currently supported.
+ indexterm:[XML element,ip-range-start attribute,network element]
+ indexterm:[XML attribute,network element,ip-range-start attribute]
+
+ |host-netmask
+ |32
+ |If +ip-range-start+ is specified, the IP addresses are created with this
+ CIDR netmask (as a number of bits).
+ indexterm:[XML element,host-netmask attribute,network element]
+ indexterm:[XML attribute,network element,host-netmask attribute]
+
+ |host-interface
+ |
+ |If +ip-range-start+ is specified, the IP addresses are created on this
+ host interface (by default, it will be determined from the IP address).
+ indexterm:[XML element,host-interface attribute,network element]
+ indexterm:[XML attribute,network element,host-interface attribute]
+
+ |control-port
+ |3121
+ |If the bundle contains a +primitive+, the cluster will use this integer TCP
+ port for communication with Pacemaker Remote inside the container. Changing
+ this is useful when the container is unable to listen on the default port,
+ for example, when the container uses the host's network rather than
+ +ip-range-start+ (in which case +replicas-per-host+ must be 1), or when the
+ bundle may run on a Pacemaker Remote node that is already listening on the
+ default port. Any PCMK_remote_port environment variable set on the host or in
+ the container is ignored for bundle connections.
+ indexterm:[XML element,control-port attribute,network element]
+ indexterm:[XML attribute,network element,control-port attribute]
+
+ |=========================================================
+
+ [[s-resource-bundle-note-replica-names]]
+ [NOTE]
+ ====
+ Replicas are named by the bundle id plus a dash and an integer counter starting
+ with zero. For example, if a bundle named +httpd-bundle+ has +replicas=2+, its
+ containers will be named +httpd-bundle-0+ and +httpd-bundle-1+.
+ ====
+
+ Additionally, a +network+ element may optionally contain one or more
+ +port-mapping+ elements.
+ indexterm:[XML element,port-mapping]
+
+ .Attributes of a port-mapping Element
+ [width="95%",cols="2m,1,<4",options="header",align="center"]
+ |=========================================================
+
+ |Attribute
+ |Default
+ |Description
+
+ |id
+ |
+ |A unique name for the port mapping (required)
+ indexterm:[XML attribute,id attribute,port-mapping element]
+ indexterm:[XML element,port-mapping element,id attribute]
+
+ |port
+ |
+ |If this is specified, connections to this TCP port number on the host network
+ (on the container's assigned IP address, if +ip-range-start+ is specified)
+ will be forwarded to the container network. Exactly one of +port+ or +range+
+ must be specified in a +port-mapping+.
+ indexterm:[XML attribute,port attribute,port-mapping element]
+ indexterm:[XML element,port-mapping element,port attribute]
+
+ |internal-port
+ |value of +port+
+ |If +port+ and this are specified, connections to +port+ on the host's network
+ will be forwarded to this port on the container network.
+ indexterm:[XML attribute,internal-port attribute,port-mapping element]
+ indexterm:[XML element,port-mapping element,internal-port attribute]
+
+ |range
+ |
+ |If this is specified, connections to these TCP port numbers (expressed as
+ 'first_port'-'last_port') on the host network (on the container's assigned IP
+ address, if +ip-range-start+ is specified) will be forwarded to the same ports
+ in the container network. Exactly one of +port+ or +range+ must be specified
+ in a +port-mapping+.
+ indexterm:[XML attribute,range attribute,port-mapping element]
+ indexterm:[XML element,port-mapping element,range attribute]
+
+ |=========================================================
+
+ [NOTE]
+ ====
+ If the bundle contains a +primitive+, Pacemaker will automatically map the
+ +control-port+, so it is not necessary to specify that port in a
+ +port-mapping+.
+ ====
+
+ [[s-bundle-storage]]
+ === Bundle Storage Properties ===
+
+ A bundle may optionally contain one +storage+ element. A +storage+ element
+ has no properties of its own, but may contain one or more +storage-mapping+
+ elements.
+ indexterm:[XML element,storage element]
+ indexterm:[XML element,storage-mapping element]
+ indexterm:[Resource,Bundle,Storage]
+
+ .Attributes of a storage-mapping Element
+ [width="95%",cols="2m,1,<4",options="header",align="center"]
+ |=========================================================
+
+ |Attribute
+ |Default
+ |Description
+
+ |id
+ |
+ |A unique name for the storage mapping (required)
+ indexterm:[XML attribute,id attribute,storage-mapping element]
+ indexterm:[XML element,storage-mapping element,id attribute]
+
+ |source-dir
+ |
+ |The absolute path on the host's filesystem that will be mapped into the
+ container. Exactly one of +source-dir+ and +source-dir-root+ must be specified
+ in a +storage-mapping+.
+ indexterm:[XML attribute,source-dir attribute,storage-mapping element]
+ indexterm:[XML element,storage-mapping element,source-dir attribute]
+
+ |source-dir-root
+ |
+ |The start of a path on the host's filesystem that will be mapped into the
+ container, using a different subdirectory on the host for each container
+ instance. The subdirectory will be named the same as the
+ <>.
+ Exactly one of +source-dir+ and +source-dir-root+ must be specified in a
+ +storage-mapping+.
+ indexterm:[XML attribute,source-dir-root attribute,storage-mapping element]
+ indexterm:[XML element,storage-mapping element,source-dir-root attribute]
+
+ |target-dir
+ |
+ |The path name within the container where the host storage will be mapped
+ (required)
+ indexterm:[XML attribute,target-dir attribute,storage-mapping element]
+ indexterm:[XML element,storage-mapping element,target-dir attribute]
+
+ |options
+ |
+ |A comma-separated list of file system mount options to use when mapping the
+ storage
+ indexterm:[XML attribute,options attribute,storage-mapping element]
+ indexterm:[XML element,storage-mapping element,options attribute]
+
+ |=========================================================
+
+ [NOTE]
+ ====
+ Pacemaker does not define the behavior if the source directory does not already
+ exist on the host. However, it is expected that the container technology and/or
+ its resource agent will create the source directory in that case.
+ ====
+
+ [NOTE]
+ ====
+ If the bundle contains a +primitive+,
+ Pacemaker will automatically map the equivalent of
+ +source-dir=/etc/pacemaker/authkey target-dir=/etc/pacemaker/authkey+
+ and +source-dir-root=/var/log/pacemaker/bundles target-dir=/var/log+ into the
+ container, so it is not necessary to specify those paths in a
+ +storage-mapping+.
+ ====
+
+ [IMPORTANT]
+ ====
+ The +PCMK_authkey_location+ environment variable must not be set to anything
+ other than the default of `/etc/pacemaker/authkey` on any node in the cluster.
+ ====
+
+ [IMPORTANT]
+ ====
+ If SELinux is used in enforcing mode on the host, you must ensure the container
+ is allowed to use any storage you mount into it. For Docker and podman bundles,
+ adding "Z" to the mount options will create a container-specific label for the
+ mount that allows the container access.
+ ====
+
+ === Bundle Primitive ===
+
+ indexterm:[Resource,Bundle,Primitive]
+
+ A bundle may optionally contain one <>
+ resource. The primitive may have operations, instance attributes, and
+ meta-attributes defined, as usual.
+
+ If a bundle contains a primitive resource, the container image must include
+ the Pacemaker Remote daemon, and at least one of +ip-range-start+ or
+ +control-port+ must be configured in the bundle. Pacemaker will create an
+ implicit +ocf:pacemaker:remote+ resource for the connection, launch
+ Pacemaker Remote within the container, and monitor and manage the primitive
+ resource via Pacemaker Remote.
+
+ If the bundle has more than one container instance (replica), the primitive
+ resource will function as an implicit <> -- a
+ <> if the bundle has +masters+ greater
+ than zero.
+
+ [NOTE]
+ ====
+ If you want to pass environment variables to a bundle's Pacemaker Remote
+ connection or primitive, you have two options:
+
+ * Environment variables whose value is the same regardless of the underlying host
+ may be set using the container element's +options+ attribute.
+ * If you want variables to have host-specific values, you can use the
+ <> element to map a file on the host as
+ +/etc/pacemaker/pcmk-init.env+ in the container. Pacemaker Remote will parse
+ this file as a shell-like format, with variables set as NAME=VALUE, ignoring
+ blank lines and comments starting with "#".
+ ====
+
+ [IMPORTANT]
+ ====
+ When a bundle has a +primitive+, Pacemaker on all cluster nodes must be able to
+ contact Pacemaker Remote inside the bundle's containers.
+
+ * The containers must have an accessible network (for example, +network+ should
+ not be set to "none" with a +primitive+).
+ * The default, using a distinct network space inside the container, works in
+ combination with +ip-range-start+. Any firewall must allow access from all
+ cluster nodes to the +control-port+ on the container IPs.
+ * If the container shares the host's network space (for example, by setting
+ +network+ to "host"), a unique +control-port+ should be specified for each
+ bundle. Any firewall must allow access from all cluster nodes to the
+ +control-port+ on all cluster and remote node IPs.
+ ====
+
+ [[s-bundle-attributes]]
+ === Bundle Node Attributes ===
+
+ indexterm:[Resource,Bundle,Node Attributes]
+
+ If the bundle has a +primitive+, the primitive's resource agent may want to set
+ node attributes such as <>. However, with
+ containers, it is not apparent which node should get the attribute.
+
+ If the container uses shared storage that is the same no matter which node the
+ container is hosted on, then it is appropriate to use the promotion score on the
+ bundle node itself.
+
+ On the other hand, if the container uses storage exported from the underlying host,
+ then it may be more appropriate to use the promotion score on the underlying host.
+
+ Since this depends on the particular situation, the
+ +container-attribute-target+ resource meta-attribute allows the user to specify
+ which approach to use. If it is set to +host+, then user-defined node attributes
+ will be checked on the underlying host. If it is anything else, the local node
+ (in this case the bundle node) is used as usual.
+
+ This only applies to user-defined attributes; the cluster will always check the
+ local node for cluster-defined attributes such as +#uname+.
+
+ If +container-attribute-target+ is +host+, the cluster will pass additional
+ environment variables to the primitive's resource agent that allow it to set
+ node attributes appropriately: +CRM_meta_container_attribute_target+ (identical
+ to the meta-attribute value) and +CRM_meta_physical_host+ (the name of the
+ underlying host).
+
+ [NOTE]
+ ====
+ When called by a resource agent, the `attrd_updater` and `crm_attribute`
+ commands will automatically check those environment variables and set
+ attributes appropriately.
+ ====
+
+ === Bundle Meta-Attributes ===
+
+ indexterm:[Resource,Bundle,Meta-attributes]
+
+ Any meta-attribute set on a bundle will be inherited by the bundle's
+ primitive and any resources implicitly created by Pacemaker for the bundle.
+
+ This includes options such as +priority+, +target-role+, and +is-managed+. See
+ <> for more information.
+
+ === Limitations of Bundles ===
+
+ Restarting pacemaker while a bundle is unmanaged or the cluster is in
+ maintenance mode may cause the bundle to fail.
+
+ Bundles may not be explicitly cloned or included in groups. This includes the
+ bundle's primitive and any resources implicitly created by Pacemaker for the
+ bundle. (If +replicas+ is greater than 1, the bundle will behave like a clone
+ implicitly.)
+
+ Bundles do not have instance attributes, utilization attributes, or operations,
+ though a bundle's primitive may have them.
+
+ A bundle with a primitive can run on a Pacemaker Remote node only if the bundle
+ uses a distinct +control-port+.
diff --git a/doc/sphinx/Pacemaker_Explained/alerts.rst b/doc/sphinx/Pacemaker_Explained/alerts.rst
new file mode 100644
index 0000000000..baa121edc8
--- /dev/null
+++ b/doc/sphinx/Pacemaker_Explained/alerts.rst
@@ -0,0 +1,422 @@
+Alerts
+------
+
+.. Convert_to_RST:
+
+ anchor:ch-alerts[Chapter 7, Alerts]
+ indexterm:[Resource,Alerts]
+
+ 'Alerts' may be configured to take some external action when a cluster event
+ occurs (node failure, resource starting or stopping, etc.).
+
+
+ == Alert Agents ==
+
+ As with resource agents, the cluster calls an external program (an
+ 'alert agent') to handle alerts. The cluster passes information about the event
+ to the agent via environment variables. Agents can do anything
+ desired with this information (send an e-mail, log to a file,
+ update a monitoring system, etc.).
+
+
+ .Simple alert configuration
+ =====
+ [source,XML]
+ -----
+
+
+
+
+
+ -----
+ =====
+
+ In the example above, the cluster will call +my-script.sh+ for each event.
+
+ Multiple alert agents may be configured; the cluster will call all of them for
+ each event.
+
+ Alert agents will be called only on cluster nodes. They will be called for
+ events involving Pacemaker Remote nodes, but they will never be called _on_
+ those nodes.
+
+ == Alert Recipients ==
+
+ Usually alerts are directed towards a recipient. Thus each alert may be additionally configured with one or more recipients.
+ The cluster will call the agent separately for each recipient.
+
+ .Alert configuration with recipient
+ =====
+ [source,XML]
+ -----
+
+
+
+
+
+
+
+ -----
+ =====
+
+ In the above example, the cluster will call +my-script.sh+ for each event,
+ passing the recipient +some-address+ as an environment variable.
+
+ The recipient may be anything the alert agent can recognize --
+ an IP address, an e-mail address, a file name, whatever the particular
+ agent supports.
+
+
+ == Alert Meta-Attributes ==
+
+ As with resource agents, meta-attributes can be configured for alert agents
+ to affect how Pacemaker calls them.
+
+ .Meta-Attributes of an Alert
+
+ [width="95%",cols="m,1,<2",options="header",align="center"]
+ |=========================================================
+
+ |Meta-Attribute
+ |Default
+ |Description
+
+ |timestamp-format
+ |%H:%M:%S.%06N
+ |Format the cluster will use when sending the event's timestamp to the agent.
+ This is a string as used with the `date(1)` command.
+ indexterm:[Alert,Option,timestamp-format]
+
+ |timeout
+ |30s
+ |If the alert agent does not complete within this amount of time, it will be
+ terminated.
+ indexterm:[Alert,Option,timeout]
+
+ |=========================================================
+
+ Meta-attributes can be configured per alert agent and/or per recipient.
+
+ .Alert configuration with meta-attributes
+ =====
+ [source,XML]
+ -----
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -----
+ =====
+
+ In the above example, the +my-script.sh+ will get called twice for each event,
+ with each call using a 15-second timeout. One call will be passed the recipient
+ +someuser@example.com+ and a timestamp in the format +%D %H:%M+, while the
+ other call will be passed the recipient +otheruser@example.com+ and a timestamp
+ in the format +%c+.
+
+
+ == Alert Instance Attributes ==
+
+ As with resource agents, agent-specific configuration values may be configured
+ as instance attributes. These will be passed to the agent as additional
+ environment variables. The number, names and allowed values of these
+ instance attributes are completely up to the particular agent.
+
+ .Alert configuration with instance attributes
+ =====
+ [source,XML]
+ -----
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -----
+ =====
+
+
+ == Alert Filters ==
+
+ By default, an alert agent will be called for node events, fencing events, and
+ resource events. An agent may choose to ignore certain types of events, but
+ there is still the overhead of calling it for those events. To eliminate that
+ overhead, you may select which types of events the agent should receive.
+
+ .Alert configuration to receive only node events and fencing events
+ =====
+ [source,XML]
+ -----
+
+
+
+
+
+
+
+
+ -----
+ =====
+
+ The possible options within +