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. openstack-info (required) Provides support for RHOSP-specific resource agents. You must configure an openstack-info resource as a cloned resource for your cluster in order to run any other RHOSP-specific resource agent other than the fence_openstack fence agent. For information about configuring an openstack-info resource see Configuring an openstack-info resource in an HA cluster on Red Hat OpenStack Platform . openstack-virtual-ip Configures a virtual IP address resource. For information about configuring an openstack-virtual-ip resource, see Configuring a virtual IP address in an HA cluster on Red Hat Openstack Platform . openstack-floating-ip Configures a floating IP address resource. For information about configuring an openstack-floating-ip resource, see Configuring a floating IP address in an HA cluster on Red Hat OpenStack Platform . openstack-cinder-volume Configures a block storage resource. For information about configuring an openstack-cinder-volume resource, see Configuring a block storage resource in an HA cluster on Red Hat OpenStack Platform . 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. Create the openstack-info resource as a clone resource. In this example, the resource is also named openstack-info . This example uses a clouds.yaml configuration file and the cloud= parameter is set to the name of the cloud in your clouds.yaml file. Check the cluster status to verify that the resource is running. 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. 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. 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 step. 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. Create an IPaddr2 resource for the virtual IP address. Configure ordering and location constraints to ensure that the openstack-virtual-ip resource starts before the IPaddr2 resource and that the IPaddr2 resource runs on the same node as the openstack-virtual-ip resource. Verification Verify the resource constraint configuration. Check the cluster status to verify that the resources are running. 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. 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. Run the following command to find the subnet ID for the public network. This command generates a table with ID and Subnet headings. 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. Configure an ordering constraint to ensure that the openstack-info resource starts before the floating IP address resource. Configure a location constraint to ensure that the floating IP address resource runs on the same node as the openstack-info resource. Verification Verify the resource constraint configuration. Check the cluster status to verify that the resources are running. 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. 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. 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. Create the block storage resource, specifying the ID for the volume. Configure an ordering constraint to ensure that the openstack-info resource starts before the block storage resource. Configure a location constraint to ensure that the block storage resource runs on the same node as the openstack-info resource. Verification Verify the resource constraint configuration. Check the cluster status to verify that the resource is running.

Commands:
pcs resource describe openstack-info
pcs resource create openstack-info openstack-info cloud="ha-example" clone
pcs status Full List of Resources: * Clone Set: openstack-info-clone [openstack-info]: * Started: [ node01 node02 node03 ]
pcs resource describe openstack-virtual-ip
openstack --os-cloud=ha-example subnet list +--------------------------------------+ ... +----------------+ | ID | ... | Subnet | +--------------------------------------+ ... +----------------+ | 723c5a77-156d-4c3b-b53c-ee73a4f75185 | ... | 172.16.0.0/24 | +--------------------------------------+ ... +----------------+
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
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
pcs resource create ClusterIP ocf:heartbeat:IPaddr2 ip=172.16.0.119
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
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)
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
pcs resource describe openstack-floating-ip
route -n | grep ^0.0.0.0 | awk '{print USD2}' 172.16.0.1
openstack --os-cloud=ha-example subnet list +-------------------------------------+---+---------------+ | ID | | Subnet +-------------------------------------+---+---------------+ | 723c5a77-156d-4c3b-b53c-ee73a4f75185 | | 172.16.0.0/24 | +--------------------------------------+------------------+
pcs resource create float-ip openstack-floating-ip cloud="ha-example" ip_id="10.19.227.211" subnet_id="723c5a77-156d-4c3b-b53c-ee73a4f75185"
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
pcs constraint colocation add float-ip with openstack-info-clone score=INFINITY
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)
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
pcs resource describe openstack-cinder-volume
openstack --os-cloud=ha-example volume list | ID | Name | | 23f67c9f-b530-4d44-8ce5-ad5d056ba926| testvolume-cinder-data-disk |
openstack --os-cloud=ha-example volume show testvolume-cinder-data-disk
pcs resource create cinder-vol openstack-cinder-volume volume_id="23f67c9f-b530-4d44-8ce5-ad5d056ba926" cloud="ha-example"
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
pcs constraint colocation add cinder-vol with openstack-info-clone score=INFINITY
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)
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