]> git.proxmox.com Git - pve-docs.git/blobdiff - ha-manager.adoc
Update recommended system requirements
[pve-docs.git] / ha-manager.adoc
index 904347d3999c44b480765562391f42de4ab1c4e7..93c2632e46d347ced4f967239d72119743360712 100644 (file)
@@ -137,9 +137,96 @@ resource of type `vm` (virtual machine) with the ID 100.
 
 For now we have two important resources types - virtual machines and
 containers. One basic idea here is that we can bundle related software
-into such VM or container, so there is no need to compose one big
+into such VM or container, so there is no need to compose one big
 service from other services, like it was done with `rgmanager`. In
-general, a HA enabled resource should not depend on other resources.
+general, a HA managed resource should not depend on other resources.
+
+
+Management Tasks
+----------------
+
+This section provides a short overview of common management tasks. The
+first step is to enable HA for a resource. This is done by adding the
+resource to the HA resource configuration. You can do this using the
+GUI, or simply use the command line tool, for example:
+
+----
+# ha-manager add vm:100
+----
+
+The HA stack now tries to start the resources and keeps it
+running. Please note that you can configure the ``requested''
+resources state. For example you may want the HA stack to stop the
+resource:
+
+----
+# ha-manager set vm:100 --state stopped
+----
+
+and start it again later:
+
+----
+# ha-manager set vm:100 --state started
+----
+
+You can also use the normal VM and container management commands. They
+automatically forward the commands to the HA stack, so
+
+----
+# qm start 100
+----
+
+simply sets the requested state to `started`. Same applied to `qm
+stop`, which sets the requested state to `stopped`.
+
+NOTE: The HA stack works fully asynchronous and needs to communicate
+with other cluster members. So it takes some seconds until you see
+the result of such actions.
+
+To view the current HA resource configuration use:
+
+----
+# ha-manager config
+vm:100
+       state stopped
+----
+
+And you can view the actual HA manager and resource state with:
+
+----
+# ha-manager status
+quorum OK
+master node1 (active, Wed Nov 23 11:07:23 2016)
+lrm elsa (active, Wed Nov 23 11:07:19 2016)
+service vm:100 (node1, started)
+----
+
+You can also initiate resource migration to other nodes:
+
+----
+# ha-manager migrate vm:100 node2
+----
+
+This uses online migration and tries to keep the VM running. Online
+migration needs to transfer all used memory over the network, so it is
+sometimes faster to stop VM, then restart it on the new node. This can be
+done using the `relocate` command:
+
+----
+# ha-manager relocate vm:100 node2
+----
+
+Finally, you can remove the resource from the HA configuration using
+the following command:
+
+----
+# ha-manager remove vm:100
+----
+
+NOTE: This does not start or stop the resource.
+
+But all HA related tasks can be done in the GUI, so there is no need to
+use the command line at all.
 
 
 How It Works
@@ -166,8 +253,8 @@ handles node fencing.
 .Locks in the LRM & CRM
 [NOTE]
 Locks are provided by our distributed configuration file system (pmxcfs).
-They are used to guarantee that each LRM is active once and working. As a
-LRM only executes actions when it holds its lock we can mark a failed node
+They are used to guarantee that each LRM is active once and working. As an
+LRM only executes actions when it holds its lock, we can mark a failed node
 as fenced if we can acquire its lock. This lets us then recover any failed
 HA services securely without any interference from the now unknown failed node.
 This all gets supervised by the CRM which holds currently the manager master
@@ -177,8 +264,6 @@ lock.
 Service States
 ~~~~~~~~~~~~~~
 
-[thumbnail="gui-ha-manager-status.png"]
-
 The CRM use a service state enumeration to record the current service
 state. We display this state on the GUI and you can query it using
 the `ha-manager` command line tool:
@@ -205,6 +290,10 @@ request_stop::
 Service should be stopped. The CRM waits for confirmation from the
 LRM.
 
+stopping::
+
+Pending stop request. But the CRM did not get the request so far.
+
 started::
 
 Service is active an LRM should start it ASAP if not already running.
@@ -212,6 +301,11 @@ If the Service fails and is detected to be not running the LRM
 restarts it
 (see xref:ha_manager_start_failure_policy[Start Failure Policy]).
 
+starting::
+
+Pending start request. But the CRM has not got any confirmation from the
+LRM that the service is running.
+
 fence::
 
 Wait for node fencing (service node is not inside quorate cluster
@@ -225,6 +319,13 @@ Do not touch the service state. We use this state while we reboot a
 node, or when we restart the LRM daemon
 (see xref:ha_manager_package_updates[Package Updates]).
 
+ignored::
+
+Act as if the service were not managed by HA at all.
+Useful, when full control over the service is desired temporarily,
+without removing it from the HA configuration.
+
+
 migrate::
 
 Migrate service (live) to other node.
@@ -234,6 +335,14 @@ error::
 Service is disabled because of LRM errors. Needs manual intervention
 (see xref:ha_manager_error_recovery[Error Recovery]).
 
+queued::
+
+Service is newly added, and the CRM has not seen it so far.
+
+disabled::
+
+Service is stopped and marked as `disabled`
+
 
 Local Resource Manager
 ~~~~~~~~~~~~~~~~~~~~~~
@@ -260,7 +369,7 @@ The LRM lost its lock, this means a failure happened and quorum was lost.
 After the LRM gets in the active state it reads the manager status
 file in `/etc/pve/ha/manager_status` and determines the commands it
 has to execute for the services it owns.
-For each command a worker gets started, this workers are running in
+For each command a worker gets started, these workers are running in
 parallel and are limited to at most 4 by default. This default setting
 may be changed through the datacenter configuration key `max_worker`.
 When finished the worker process gets collected and its result saved for
@@ -272,19 +381,19 @@ The default value of at most 4 concurrent workers may be unsuited for
 a specific setup. For example may 4 live migrations happen at the same
 time, which can lead to network congestions with slower networks and/or
 big (memory wise) services. Ensure that also in the worst case no congestion
-happens and lower the `max_worker` value if needed. In the contrary, if you
+happens and lower the `max_worker` value if needed. On the contrary, if you
 have a particularly powerful high end setup you may also want to increase it.
 
-Each command requested by the CRM is uniquely identifiable by an UID, when
-the worker finished its result will be processed and written in the LRM
+Each command requested by the CRM is uniquely identifiable by a UID, when
+the worker finishes its result will be processed and written in the LRM
 status file `/etc/pve/nodes/<nodename>/lrm_status`. There the CRM may collect
 it and let its state machine - respective the commands output - act on it.
 
 The actions on each service between CRM and LRM are normally always synced.
-This means that the CRM requests a state uniquely marked by an UID, the LRM
+This means that the CRM requests a state uniquely marked by a UID, the LRM
 then executes this action *one time* and writes back the result, also
 identifiable by the same UID. This is needed so that the LRM does not
-executes an outdated command.
+execute an outdated command.
 With the exception of the `stop` and the `error` command,
 those two do not depend on the result produced and are executed
 always in the case of the stopped state and once in the case of
@@ -321,10 +430,11 @@ lost agent lock::
 
 The CRM lost its lock, this means a failure happened and quorum was lost.
 
-It main task is to manage the services which are configured to be highly
-available and try to always enforce them to the wanted state, e.g.: a
-enabled service will be started if its not running, if it crashes it will
-be started again. Thus it dictates the LRM the actions it needs to execute.
+Its main task is to manage the services which are configured to be highly
+available and try to always enforce the requested state. For example, a
+service with the requested state 'started' will be started if its not
+already running. If it crashes it will be automatically started again.
+Thus the CRM dictates the actions the LRM needs to execute.
 
 When an node leaves the cluster quorum, its state changes to unknown.
 If the current CRM then can secure the failed nodes lock, the services
@@ -349,14 +459,16 @@ automatically distributed to the cluster nodes, and all nodes share
 the same HA configuration.
 
 
+[[ha_manager_resource_config]]
 Resources
 ~~~~~~~~~
 
-[thumbnail="gui-ha-manager-resources-view.png"]
+[thumbnail="screenshot/gui-ha-manager-status.png"]
+
 
 The resource configuration file `/etc/pve/ha/resources.cfg` stores
 the list of resources managed by `ha-manager`. A resource configuration
-inside that list look like this:
+inside that list looks like this:
 
 ----
 <type>: <name>
@@ -373,7 +485,7 @@ properties:
 include::ha-resources-opts.adoc[]
 
 Here is a real world example with one VM and one container. As you see,
-the syntax of those files is really simple, so it is even posiible to
+the syntax of those files is really simple, so it is even possible to
 read or edit those files using your favorite editor:
 
 .Configuration Example (`/etc/pve/ha/resources.cfg`)
@@ -386,7 +498,7 @@ ct: 102
     # Note: use default settings for everything
 ----
 
-[thumbnail="gui-ha-manager-add-resource.png"]
+[thumbnail="screenshot/gui-ha-manager-add-resource.png"]
 
 Above config was generated using the `ha-manager` command line tool:
 
@@ -400,7 +512,7 @@ Above config was generated using the `ha-manager` command line tool:
 Groups
 ~~~~~~
 
-[thumbnail="gui-ha-manager-groups-view.png"]
+[thumbnail="screenshot/gui-ha-manager-groups-view.png"]
 
 The HA group configuration file `/etc/pve/ha/groups.cfg` is used to
 define groups of cluster nodes. A resource can be restricted to run
@@ -416,9 +528,9 @@ group: <group>
 
 include::ha-groups-opts.adoc[]
 
-[thumbnail="gui-ha-manager-add-group.png"]
+[thumbnail="screenshot/gui-ha-manager-add-group.png"]
 
-A commom requirement is that a resource should run on a specific
+A common requirement is that a resource should run on a specific
 node. Usually the resource is able to run on other nodes, so you can define
 an unrestricted group with a single member:
 
@@ -429,7 +541,7 @@ an unrestricted group with a single member:
 For bigger clusters, it makes sense to define a more detailed failover
 behavior. For example, you may want to run a set of services on
 `node1` if possible. If `node1` is not available, you want to run them
-equally splitted on `node2` and `node3`. If those nodes also fail the
+equally split on `node2` and `node3`. If those nodes also fail the
 services should run on `node4`. To achieve this you could set the node
 list to:
 
@@ -463,7 +575,7 @@ group: mygroup2
 
 
 The `nofailback` options is mostly useful to avoid unwanted resource
-movements during administartion tasks. For example, if you need to
+movements during administration tasks. For example, if you need to
 migrate a service to a node which hasn't the highest priority in the
 group, you need to tell the HA manager to not move this service
 instantly back by setting the `nofailback` option.
@@ -485,7 +597,7 @@ resource runs twice when it gets recovered on another node. This is a
 really important task, because without, it would not be possible to
 recover a resource on another node.
 
-If a node would not get fenced, it would be in an unknown state where
+If a node did not get fenced, it would be in an unknown state where
 it may have still access to shared resources. This is really
 dangerous!  Imagine that every network but the storage one broke. Now,
 while not reachable from the public network, the VM still runs and
@@ -577,7 +689,7 @@ Start Failure Policy
 ---------------------
 
 The start failure policy comes in effect if a service failed to start on a
-node once ore more times. It can be used to configure how often a restart
+node one or more times. It can be used to configure how often a restart
 should be triggered on the same node and how often a service should be
 relocated so that it gets a try to be started on another node.
 The aim of this policy is to circumvent temporary unavailability of shared
@@ -601,7 +713,7 @@ actual node. The default is set to one.
 
 NOTE: The relocate count state will only reset to zero when the
 service had at least one successful start. That means if a service is
-re-enabled without fixing the error only the restart policy gets
+re-started without fixing the error only the restart policy gets
 repeated.
 
 
@@ -611,17 +723,24 @@ Error Recovery
 
 If after all tries the service state could not be recovered it gets
 placed in an error state. In this state the service won't get touched
-by the HA stack anymore.  To recover from this state you should follow
-these steps:
+by the HA stack anymore. The only way out is disabling a service:
+
+----
+# ha-manager set vm:100 --state disabled
+----
+
+This can also be done in the web interface.
 
-* bring the resource back into a safe and consistent state (e.g.,
-killing its process)
+To recover from the error state you should do the following:
 
-* disable the ha resource to place it in an stopped state
+* bring the resource back into a safe and consistent state (e.g.:
+kill its process if the service could not be stopped)
+
+* disable the resource to remove the error flag
 
 * fix the error which led to this failures
 
-* *after* you fixed all errors you may enable the service again
+* *after* you fixed all errors you may request that the service starts again
 
 
 [[ha_manager_package_updates]]
@@ -641,10 +760,10 @@ actions between the cluster and the local resource manager. For restarting,
 the LRM makes a request to the CRM to freeze all its services. This prevents
 that they get touched by the Cluster during the short time the LRM is restarting.
 After that the LRM may safely close the watchdog during a restart.
-Such a restart happens on a update and as already stated a active master
-CRM is needed to acknowledge the requests from the LRM, if this is not the case
-the update process can be too long which, in the worst case, may result in
-a watchdog reset.
+Such a restart happens normally during a package update and, as already stated,
+an active master CRM is needed to acknowledge the requests from the LRM. If
+this is not the case the update process can take too long which, in the worst
+case, may result in a reset triggered by the watchdog.
 
 
 Node Maintenance
@@ -678,7 +797,7 @@ from ``shutdown'', because the node immediately starts again.
 
 The LRM tells the CRM that it wants to restart, and waits until the
 CRM puts all resources into the `freeze` state (same mechanism is used
-for xref:ha_manager_package_updates[Pakage Updates]). This prevents
+for xref:ha_manager_package_updates[Package Updates]). This prevents
 that those resources are moved to other nodes. Instead, the CRM start
 the resources after the reboot on the same node.
 
@@ -696,38 +815,6 @@ NOTE: Please do not 'kill' services like `pve-ha-crm`, `pve-ha-lrm` or
 in a node reboot.
 
 
-[[ha_manager_service_operations]]
-Service Operations
-------------------
-
-This are how the basic user-initiated service operations (via
-`ha-manager`) work.
-
-enable::
-
-The service will be started by the LRM if not already running.
-
-disable::
-
-The service will be stopped by the LRM if running.
-
-migrate/relocate::
-
-The service will be relocated (live) to another node.
-
-remove::
-
-The service will be removed from the HA managed resource list. Its
-current state will not be touched.
-
-start/stop::
-
-`start` and `stop` commands can be issued to the resource specific tools
-(like `qm` or `pct`), they will forward the request to the
-`ha-manager` which then will execute the action and set the resulting
-service state (enabled, disabled).
-
-
 ifdef::manvolnum[]
 include::pve-copyright.adoc[]
 endif::manvolnum[]