Chapter 2. Installing and configuring Instance HA
Red Hat OpenStack Platform (RHOSP) director deploys Instance High Availability (HA). However, you must perform additional steps to configure a new Instance HA deployment on a new overcloud. After you complete the steps, Instance HA will run on a subset of Compute nodes with a custom role.
Instance HA is not supported on RHOSP hyperconverged infrastructures (HCI) environments. To use Instance HA in your RHOSP HCI environment, you must designate a subset of the Compute nodes with the ComputeInstanceHA role to use the Instance HA. Red Hat Ceph Storage services must not be hosted on the Compute nodes that host Instance HA.
To enable instance HA in a different environment, such as an existing overcloud that uses standard or custom roles, perform only the procedures that are relevant to your deployment and adapt your templates accordingly.
2.1. Configuring the Instance HA role, flavor, and profile
Before deploying Instance HA, add the Instance HA role to your roles-data.yaml
file, create the Instance HA flavor, tag each Comput node that you want to manage with Instanc HA with the Instance HA profile, and map the Instance HA role to the Instance HA flavor.
You can modify the example file and role names in this procedure according to your environment.
Procedure
Add the
ComputeInstanceHA
role to yourroles-data.yaml
file and regenerate the file.$ openstack overcloud roles generate -o ~/my_roles_data.yaml Controller Compute ComputeInstanceHA
The
ComputeInstanceHA
role includes all the services in the defaultCompute
role, theComputeInstanceHA
services, and thePacemakerRemote
services.Create the
compute-instance-ha
flavor to tag the Compute nodes to manage with Instance HA.$ source ~/stackrc $ openstack flavor create --id auto --ram 6144 --disk 40 --vcpus 4 compute-instance-ha $ openstack flavor set --property "cpu_arch"="x86_64" --property "capabilities:boot_option"="local" --property "capabilities:profile"="compute-instance-ha" compute-instance-ha $ openstack flavor set --property resources:VCPU=0 --property resources:MEMORY_MB=0 --property resources:DISK_GB=0 --property resources:CUSTOM_BAREMETAL=1 compute-instance-ha
Tag each Compute node that you want to manage with Instance HA with the
compute-instance-ha
profile, and replace<NODE UUID>
with the actual UUID:$ openstack baremetal node set --property capabilities='profile:compute-instance-ha,boot_option:local' <NODE UUID>
Map the
ComputeInstanceHA
role to thecompute-instance-ha
flavor by creating an environment file with the following parameter:parameter_defaults: OvercloudComputeInstanceHAFlavor: compute-instance-ha
Additional resources
2.2. Enabling fencing on an overcloud with Instance HA
Enable fencing on all Controller and Compute nodes in the overcloud by creating an environment file with fencing information.
Procedure
Create the environment file in an accessible location, such as ~/templates, and include the following content:
parameter_defaults: EnableFencing: true FencingConfig: devices: - agent: fence_ipmilan host_mac: 00:ec:ad:cb:3c:c7 params: login: admin ipaddr: 192.168.24.1 ipport: 6230 passwd: password lanplus: 1 - agent: fence_ipmilan host_mac: 00:ec:ad:cb:3c:cb params: login: admin ipaddr: 192.168.24.1 ipport: 6231 passwd: password lanplus: 1 - agent: fence_ipmilan host_mac: 00:ec:ad:cb:3c:cf params: login: admin ipaddr: 192.168.24.1 ipport: 6232 passwd: password lanplus: 1 - agent: fence_ipmilan host_mac: 00:ec:ad:cb:3c:d3 params: login: admin ipaddr: 192.168.24.1 ipport: 6233 passwd: password lanplus: 1 - agent: fence_ipmilan host_mac: 00:ec:ad:cb:3c:d7 params: login: admin ipaddr: 192.168.24.1 ipport: 6234 passwd: password lanplus: 1
If you do not use shared storage for your Compute instance, add the following parameter to the environment file that you created:
parameter_defaults: ExtraConfig: tripleo::instanceha::no_shared_storage: true
Additional resources
2.3. Deploying the overcloud with Instance HA
If you already deployed the overcloud, rerun the openstack overcloud deploy
command with the additional Instance HA files you created. You can configure Instance HA for your overcloud at any time after you create the undercloud.
Prerequisites
- Instance HA role, flavor, and profile is configured.
- Fencing is enabled on the overcloud.
Procedure
Use the
openstack overcloud deploy
command with the-e
option for each environment file that you created and with thecompute-instanceha.yaml
environment file. Replace<FLAVOR_ENV_FILE>
and<FENCING_ENV_FILE>
with the appropriate file names in your environment:$ openstack overcloud deploy --templates \ -e <FLAVOR_ENV_FILE> \ -e <FENCING_ENV_FILE> \ -r my_roles_data.yaml \ -e /usr/share/openstack-tripleo-heat-templates/environments/compute-instanceha.yaml
Note-
Do not modify the
compute-instanceha.yaml
environment file. - Include the full path to each environment file that you want to include in the overcloud deployment.
-
Do not modify the
After the deployment is complete, each Compute node includes a STONITH
device and a GuestNode
service.
2.4. Testing Instance HA evacuation
To test that Instance HA evacuates instances correctly, you trigger evacuation on a Compute node and check that the Instance HA agents successfully evacuate and re-create the instance on a different Compute node.
The following procedure involves deliberately crashing a Compute node, which triggers the automated evacuation of instances with Instance HA.
Prerequisites
- Instance HA is deployed on the Compute node.
Procedure
Start one or more instances on the overcloud.
stack@director $ . overcloudrc stack@director $ openstack server create --image cirros --flavor 2 test-failover stack@director $ openstack server list -c Name -c Status
Log in to the Compute node that hosts the instances and change to the
root
user. Replacecompute-n
with the name of the Compute node:stack@director $ . stackrc stack@director $ ssh -l heat-admin compute-n heat-admin@compute-n $ su -
Crash the Compute node.
root@compute-n $ echo c > /proc/sysrq-trigger
Wait a few minutes for the node to restart, and then verify that the instances from the Compute node that you crash are re-created on another Compute node:
stack@director $ openstack server list -c Name -c Status stack@director $ openstack compute service list
2.5. Designating instances to evacuate with Instance HA
By default, Instance HA evacuates all instances from a failed node. You can configure Instance HA to only evacuate instances with specific images or flavors.
Prerequisites
- Instance HA is deployed on the overcloud.
Procedure
-
Log in to the undercloud as the
stack
user. Source the
overcloudrc
file:$ source ~/overcloudrc
Use one of the following options:
Tag an image:
(overcloud) $ openstack image set --tag evacuable <image_id>
Replace
<image_id>
with the ID of the image that you want to evacuate.Tag a flavor:
(overcloud) $ openstack flavor set --property evacuable=true <flavor_id>
Replace
<flavor_id>
with the ID of the flavor that you want to evacuate.