Chapter 7. Configuring HA cluster resources on Red Hat OpenStack Platform
The following table lists the RHOSP-specific resource agents you use to configure resources for an HA cluster on RHOSP.
|
Provides support for RHOSP-specific resource agents. You must configure an |
|
Configures a virtual IP address resource. For information about configuring an |
|
Configures a floating IP address resource. For information about configuring an |
|
Configures a block storage resource. For information about configuring an |
When configuring other cluster resources, use the standard Pacemaker resource agents.
7.1. Configuring an openstack-info
resource in an HA cluster on Red Hat OpenStack Platform (required)
You must configure an openstack-info
resource in order to run any other RHOSP-specific resource agent except for the fence_openstack
fence agent.
This procedure to create an openstack-info
resource uses a clouds.yaml
file for RHOSP authentication.
Prerequisites
- A configured HA cluster running on RHOSP
- Access to the RHOSP APIs, using the RHOSP authentication method you will use for cluster configuration, as described in Setting up an authentication method for RHOSP
Procedure
Complete the following steps from any node in the cluster.
To view the options for the
openstack-info
resource agent, run the following command.# pcs resource describe openstack-info
Create the
openstack-info
resource as a clone resource. In this example, the resource is also namedopenstack-info
. This example uses aclouds.yaml
configuration file and thecloud=
parameter is set to the name of the cloud in yourclouds.yaml
file.# pcs resource create openstack-info openstack-info cloud="ha-example" clone
Check the cluster status to verify that the resource is running.
# pcs status Full List of Resources: * Clone Set: openstack-info-clone [openstack-info]: * Started: [ node01 node02 node03 ]
7.2. Configuring a virtual IP address in an HA cluster on Red Hat Openstack Platform
This procedure to create an RHOSP virtual IP address resource for an HA cluster on an RHOSP platform uses a clouds.yaml
file for RHOSP authentication.
The RHOSP virtual IP resource operates in conjunction with an IPaddr2
cluster resource. When you configure an RHOSP virtual IP address resource, the resource agent ensures that the RHOSP infrastructure associates the virtual IP address with a cluster node on the network. This allows an IPaddr2
resource to function on that node.
Prerequisites
- A configured HA cluster running on RHOSP
- An assigned IP address to use as the virtual IP address
- Access to the RHOSP APIs, using the RHOSP authentication method you will use for cluster configuration, as described in Setting up an authentication method for RHOSP
Procedure
Complete the following steps from any node in the cluster.
To view the options for the
openstack-virtual-ip
resource agent, run the following command.# pcs resource describe openstack-virtual-ip
Run the following command to determine the subnet ID for the virtual IP address you are using. In this example, the virtual IP address is 172.16.0.119.
# openstack --os-cloud=ha-example subnet list +--------------------------------------+ ... +----------------+ | ID | ... | Subnet | +--------------------------------------+ ... +----------------+ | 723c5a77-156d-4c3b-b53c-ee73a4f75185 | ... | 172.16.0.0/24 | +--------------------------------------+ ... +----------------+
Create the RHOSP virtual IP address resource.
The following command creates an RHOSP virtual IP address resource for an IP address of 172.16.0.119, specifying the subnet ID you determined in the previous step.
# pcs resource create ClusterIP-osp ocf:heartbeat:openstack-virtual-ip cloud=ha-example ip=172.16.0.119 subnet_id=723c5a77-156d-4c3b-b53c-ee73a4f75185
Configure ordering and location constraints:
-
Ensure that the
openstack-info
resource starts before the virtual IP address resource. Ensure that the Virtual IP address resource runs on the same node as the
openstack-info
resource.# pcs constraint order start openstack-info-clone then ClusterIP-osp Adding openstack-info-clone ClusterIP-osp (kind: Mandatory) (Options: first-action=start then-action=start) # pcs constraint colocation add ClusterIP-osp with openstack-info-clone score=INFINITY
-
Ensure that the
Create an
IPaddr2
resource for the virtual IP address.# pcs resource create ClusterIP ocf:heartbeat:IPaddr2 ip=172.16.0.119
Configure ordering and location constraints to ensure that the
openstack-virtual-ip
resource starts before theIPaddr2
resource and that theIPaddr2
resource runs on the same node as theopenstack-virtual-ip
resource.# pcs constraint order start ClusterIP-osp then ClusterIP Adding ClusterIP-osp ClusterIP (kind: Mandatory) (Options: first-action=start then-action=start) # pcs constraint colocation add ClusterIP with ClusterIP-osp
Verification
Verify the resource constraint configuration.
# pcs constraint config Location Constraints: Ordering Constraints: start ClusterIP-osp then start ClusterIP (kind:Mandatory) start openstack-info-clone then start ClusterIP-osp (kind:Mandatory) Colocation Constraints: ClusterIP with ClusterIP-osp (score:INFINITY) ClusterIP-osp with openstack-info-clone (score:INFINITY)
Check the cluster status to verify that the resources are running.
# pcs status . . . Full List of Resources: * fenceopenstack (stonith:fence_openstack): Started node01 * Clone Set: openstack-info-clone [openstack-info]: * Started: [ node01 node02 node03 ] * ClusterIP-osp (ocf::heartbeat:openstack-virtual-ip): Started node03 * ClusterIP (ocf::heartbeat:IPaddr2): Started node03
7.3. Configuring a floating IP address in an HA cluster on Red Hat OpenStack Platform
The following procedure creates a floating IP address resource for an HA cluster on RHOSP. This procedure uses a clouds.yaml
file for RHOSP authentication.
Prerequisites
- A configured HA cluster running on RHOSP
- An IP address on the public network to use as the floating IP address, assigned by the RHOSP administrator
- Access to the RHOSP APIs, using the RHOSP authentication method you will use for cluster configuration, as described in Setting up an authentication method for RHOSP
Procedure
Complete the following steps from any node in the cluster.
To view the options for the
openstack-floating-ip
resource agent, run the following command.# pcs resource describe openstack-floating-ip
Find the subnet ID for the address on the public network that you will use to create the floating IP address resource.
The public network is usually the network with the default gateway. Run the following command to display the default gateway address.
# route -n | grep ^0.0.0.0 | awk '{print $2}' 172.16.0.1
Run the following command to find the subnet ID for the public network. This command generates a table with ID and Subnet headings.
# openstack --os-cloud=ha-example subnet list +-------------------------------------+---+---------------+ | ID | | Subnet +-------------------------------------+---+---------------+ | 723c5a77-156d-4c3b-b53c-ee73a4f75185 | | 172.16.0.0/24 | +--------------------------------------+------------------+
Create the floating IP address resource, specifying the public IP address for the resource and the subnet ID for that address. When you configure the floating IP address resource, the resource agent configures a virtual IP address on the public network and associates it with a cluster node.
# pcs resource create float-ip openstack-floating-ip cloud="ha-example" ip_id="10.19.227.211" subnet_id="723c5a77-156d-4c3b-b53c-ee73a4f75185"
Configure an ordering constraint to ensure that the
openstack-info
resource starts before the floating IP address resource.# pcs constraint order start openstack-info-clone then float-ip Adding openstack-info-clone float-ip (kind: Mandatory) (Options: first-action=start then-action=start
Configure a location constraint to ensure that the floating IP address resource runs on the same node as the
openstack-info
resource.# pcs constraint colocation add float-ip with openstack-info-clone score=INFINITY
Verification
Verify the resource constraint configuration.
# pcs constraint config Location Constraints: Ordering Constraints: start openstack-info-clone then start float-ip (kind:Mandatory) Colocation Constraints: float-ip with openstack-info-clone (score:INFINITY)
Check the cluster status to verify that the resources are running.
# pcs status . . . Full List of Resources: * fenceopenstack (stonith:fence_openstack): Started node01 * Clone Set: openstack-info-clone [openstack-info]: * Started: [ node01 node02 node03 ] * float-ip (ocf::heartbeat:openstack-floating-ip): Started node02
7.4. Configuring a block storage resource in an HA cluster on Red Hat OpenStack Platform
The following procedure creates a block storage resource for an HA cluster on RHOSP. This procedure uses a clouds.yaml
file for RHOSP authentication.
Prerequisites
- A configured HA cluster running on RHOSP
- A block storage volume created by the RHOSP administrator
- Access to the RHOSP APIs, using the RHOSP authentication method you will use for cluster configuration, as described in Setting up an authentication method for RHOSP
Procedure
Complete the following steps from any node in the cluster.
To view the options for the
openstack-cinder-volume
resource agent, run the following command.# pcs resource describe openstack-cinder-volume
Determine the volume ID of the block storage volume you are configuring as a cluster resource.
Run the following command to display a table of available volumes that includes the UUID and name of each volume.
# openstack --os-cloud=ha-example volume list | ID | Name | | 23f67c9f-b530-4d44-8ce5-ad5d056ba926| testvolume-cinder-data-disk |
If you already know the volume name, you can run the following command, specifying the volume you are configuring. This displays a table with an ID field.
# openstack --os-cloud=ha-example volume show testvolume-cinder-data-disk
Create the block storage resource, specifying the ID for the volume.
# pcs resource create cinder-vol openstack-cinder-volume volume_id="23f67c9f-b530-4d44-8ce5-ad5d056ba926" cloud="ha-example"
Configure an ordering constraint to ensure that the
openstack-info
resource starts before the block storage resource.# pcs constraint order start openstack-info-clone then cinder-vol Adding openstack-info-clone cinder-vol (kind: Mandatory) (Options: first-action=start then-action=start
Configure a location constraint to ensure that the block storage resource runs on the same node as the
openstack-info
resource.# pcs constraint colocation add cinder-vol with openstack-info-clone score=INFINITY
Verification
Verify the resource constraint configuration.
# pcs constraint config Location Constraints: Ordering Constraints: start openstack-info-clone then start cinder-vol (kind:Mandatory) Colocation Constraints: cinder-vol with openstack-info-clone (score:INFINITY)
Check the cluster status to verify that the resource is running.
# pcs status . . . Full List of Resources: * Clone Set: openstack-info-clone [openstack-info]: * Started: [ node01 node02 node03 ] * cinder-vol (ocf::heartbeat:openstack-cinder-volume): Started node03 * fenceopenstack (stonith:fence_openstack): Started node01