8.2. Enabling and Disabling High Availability for Nodes

To enable high availability on a node means to enable it for all virtual machines and containers on this node that are stored in the Virtuozzo Storage cluster.

Note the following:

  • When you assign the iSCSI network role to a node’s network interface (see Network Interface Roles) or joined a node to an S3 cluster in the Virtuozzo Storage management panel (see Creating the S3 Cluster), high availability is automatically enabled for virtual machines and containers on this node in the round-robin mode.

= When you enable HA for virtual machines and containers for the client server role during installation of Virtuozzo Storage with CLI management (see |vstorage| Server Roles), high availability is automatically enabled for virtual machines and containers on this node in the DRS mode.

To enable high availability on a node, do the following:

  1. Update Virtuozzo Storage to the latest version with yum update.

  2. Run the hastart script:

    # hastart -c <cluster> -n <storage_network/network_mask>
    

    Where <cluster> is the cluster name, e.g., vstor1, <storage_network> is the cluster internal network, and <network_mask> covers all the nodes in the cluster.

    The script will automatically install, configure, and start the HA services on the node as well as add the node to the HA configuration.

After enabling HA for the node, you can check the result with the shaman stat command.

8.2.1. Disabling High Availability for Specific Virtual Machines and Containers

By default, if high availability is enabled on a node, it affects all virtual machines and containers on said node. If necessary, you can disable HA for specific virtual machines and containers using the prlctl set command. For example:

# prlctl set MyVM --ha-enable no

To re-enable HA support, run:

# prlctl set MyVM --ha-enable yes

8.2.2. Enabling High Availability for iSCSI Targets

Note

If you use Virtuozzo Storage with GUI management, enable HA for iSCSI targets by assigning the iSCSI network role to a node’s network interface (see Network Interface Roles). Keep in mind that doing so also enables HA for virtual machines and containers on this node that are stored in the Virtuozzo Storage cluster.

If you use Virtuozzo Storage with CLI management, high availability for iSCSI targets is disabled by default. To enable it on a cluster node, do the following:

  1. If not yet done, enable HA on the node using the hastart script as described in the previous section.

  2. Add the iSCSI shaman role to the node. For example, on a node in the cluster vstor1, run:

    # shaman -c vstor1 add-role ISCSI
    

If you want HA to work only for iSCSI targets, change the shaman roles on the node by running the following command:

# shaman -c vstor1 set-roles ISCSI

8.2.3. Disabling High Availability on Nodes

Disabling HA on a node disables it for all virtual environments and iSCSI targets on this node that are stored in the Virtuozzo Storage cluster.

To disable HA on a node, do the following:

  1. Disable and stop HA services:

    # systemctl disable shaman.service
    # systemctl stop shaman.service
    # systemctl disable pdrs.service
    # systemctl stop pdrs.service
    
  2. Remove the node from the HA configuration. For example, for a node in the cluster vstor1, run:

    # shaman -c vstor1 leave