A high availability cluster (HA cluster) is a group of nodes that automatically restarts protected virtual machines (VMs) on nodes of the working group in case of failure of some of them. Such a cluster can consist of two or more nodes. Network storage and Direct LUN can be used for VM storage. Local storage is supported in a high availability cluster, but VMs on local storage are not protected.
The administrator can change most cluster parameters without stopping it, put nodes into maintenance mode, and monitor node status and the event log.
A high availability cluster allows:
- maintain cluster operation in case of failure of some nodes;
- service nodes without stopping running VMs;
- reduce the risk of data corruption when losing connection between nodes.
Requirements for a high availability cluster
You can create a high availability cluster under the following conditions:
- virtualization type — KVM;
- network configuration type — Switching;
-
storage types:
- for Hosting version — SAN;
-
for Infrastructure version — SAN and NAS in any combination;
- Only the NFSv4 protocol is supported for NAS.
- You can also use Ceph storage. To do this, create a hyperconverged cluster or add a metadata server (MDS) to an existing Ceph cluster.
- When using iSCSI as primary storage, do not place VM disks from nodes in other clusters in the LUN designated for primary storage.
- Storage of other types can be connected to a high availability cluster, but VMs in them will not be protected.
- when using SAN or external storage, all iSCSI and Fibre Channel cluster nodes must be operational and connected to the network storage;
- OS on cluster nodes — a supported version of AlmaLinux;
- number of nodes — 2 or more;
- system time on all nodes is synchronized. To synchronize time, use the chrony software.
Usage recommendations
- Before enabling high availability, ensure that network storages and communication channels with them are working reliably.
- Adding problematic nodes to the cluster is not recommended — servers that are prone to failures due to OS, disk, network issues, etc.
- It is not recommended to set the RAM overselling coefficient on nodes above 0.9. For more details, see the Overselling article.
- Ensure a resource reserve sufficient to run all protected VMs in case of a node failure.
- Use a high availability cluster for VMs where it is important to restore access in case of a failure.
If the recommendations are not followed, there are possible risks:
- increased number of failures;
- resource shortage;
- software failures leading to VM shutdown and redistribution within the cluster;
- failures in VM migration in case of a node failure;
- loss of functionality for individual VMs in the cluster.
Operating logic
Cluster nodes
One of the high availability cluster nodes is designated as the master. The master confirms node connections, collects their statuses, and initiates necessary actions in case of a failure. The remaining nodes operate as members. When a node connects:
- The ha-daemon service is installed on the node.
- The node is added to the high availability configuration.
- The ha-service service sends the updated configuration to the master.
Nodes select a master when high availability is enabled and when the current master fails. During the election, the cluster shows a transitional state in its statuses. Adding a new node does not trigger a new election.
Agent
A special service, the agent, runs on each high availability cluster node. The agent:
- determines the node state and saves it to the cluster storage;
- executes master decisions;
- isolates the node in case of a failure;
- stops and starts VMs.
Agents exchange statuses and select the master node. The master makes failure decisions. The administrator only sets the operating mode and protection parameters.
Operating mode and status
The cluster state is described by:
- operating mode — the target state set by the administrator. The cluster does not change the operating mode on its own. For example, the administrator selects normal mode or maintenance mode;
- status — the actual node state determined by the master. The administrator does not set the status: they see it in the interface and use it for diagnostics. The status may differ from the operating mode. A node can operate in normal mode but have a degraded or isolated status.
The master monitors the statuses of all nodes, while the remaining nodes monitor the master's status. Transitional statuses indicate that the cluster is performing an action. They show which stage of recovery is in progress.
The VM state is described by:
- protection policy — the target state set by the administrator: which VMs need to be protected;
- protection status — the actual protection state determined by the cluster.
Agents record events in the event log.
Node quality and configuration integrity
The quality of each node is determined by the following parameters:
- access to cluster configuration — a service area on the primary storage, through which nodes transmit configuration and statuses, as well as store event logs;
- access to the monitored IP address, which the node uses to check the external network. Optional parameter, common to all cluster nodes; Usually, the address of an upstream router or switch is specified as the monitored IP address. The node checks its availability and determines whether it has connectivity to the external network.
- group size — the number of nodes with the same cluster resource quality. Cluster resources are access to the primary storage, monitored network storages and Direct LUN, and the monitored IP address.
- cluster configuration version.
If node qualities differ, the cluster is divided into groups. Each group consists of nodes with the same quality. Only one group operates in the cluster at a time.
The configuration is considered intact if all group nodes use the same configuration version and see the same set of resources. Nodes with a different version or quality do not join the group.
Split-brain
Split-brain is a situation where nodes of the same quality lose connectivity with each other and form two or more independent groups. Each group considers itself active. If both groups continue to start VMs on the shared storage, VM data may become corrupted.
If the cluster has a primary storage, master election and split-brain protection are provided by exclusive locking of this storage. The agent can only operate with access to the primary storage. A node that loses access to the primary storage self-isolates and does not start VMs.
If the primary storage is unavailable or not used for locking, the cluster resolves the split-brain issue as follows:
- Identifies the group with the highest quality. If several groups have the same quality, it selects the larger group. If the groups are of the same size, the group containing the master remains active. Evaluation criteria from highest to lowest:
- All cluster resources in the group are available.
- Group size is less than the full cluster composition, monitored IP address is available.
- Monitored IP address is unavailable, group size matches the full cluster composition.
- Monitored IP address is unavailable, group size is less than the full cluster composition.
- Transfers the remaining groups to isolation mode — nodes in these groups do not start VMs and do not work with the shared storage.
For example, five nodes divided into two groups: two and three nodes. The monitored IP address is available in the first group, but not in the second. Therefore, the cluster continues to operate with the first group, even though it has fewer nodes.
Fencing and node return
Fencing is a mechanism for isolating a failed node. Its purpose is to ensure that VMs on this node stop and do not work with the shared storage while their copies are started on other nodes. Without fencing, split-brain and data corruption are possible. Fencing can be strict or soft:
- strict fencing reboots the node. This guarantees isolation within a specified time, but VMs are terminated abnormally, and data inside the guest OS may be lost;
- soft fencing first attempts to shut down VMs normally, and after successful shutdown, reports isolation without rebooting the node. This reduces the risk of data loss, but does not guarantee isolation: the VM may not have time to shut down within the allotted time. If the VM cannot be shut down within the allotted time, the node will reboot.
Failback is returning a node to the cluster after a failure. The failback policy determines whether the node returns automatically or waits for an administrator command. During automatic return, the node checks its resources and requests the master to return it to the group. During manual return, the node remains isolated until the administrator's command. The cluster does not automatically return VMs to the node: they remain on the nodes where they were started.
The administrator selects fencing and failback policies in the high availability settings.
Enabling high availability procedure
- The administrator selects:
- VMs for protection (or enables the protection policy for all VMs, including new ones).
- Primary and additional storages.
- Monitored IP address.
- Failback and fencing policies.
For more information on settings, see the Configuring high availability article.
- The platform installs and starts agents on the selected nodes. Installation takes approximately 1 to 10 minutes and depends, primarily, on the number of nodes and the type of primary storage.
- Cluster nodes check their quality, form groups, and select a master.
- VMs receive protection status.
- The cluster starts VM monitoring.
Diagnostics
Main components
Logs
To change the logging level of the ha-daemon service, on each node run the command:
/opt/ispsystem/ha-daemon/bin/ha-daemon --log-level=<level> --save && systemctl restart ha-daemonCommand explanation:
<level>— required logging level. Possible options:trace— detailed information about each operation;debug— detailed debug information;info— main events reflecting system operation;notice— important events;warn— warnings about potential issues;err— error information.
En
Es