Language and Page Formatting Options

Chapter 7. Configuring HA cluster resources on Red Hat OpenStack Platform

Use the following resource agents when configuring resources for an HA cluster on RHOSP:

  • openstack-info: 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.
  • openstack-virtual-ip: Configures a virtual IP address resource
  • openstack-floating-ip: Configures a floating IP address resource
  • openstack-cinder-volume: Configures a block storage resource

When configuring other cluster resources, use the standard Pacemaker resource agents.

7.1. Configuring an openstack-info resource (required)

An openstack-info resource is required in order to run any other RHOSP-specific resource agent other than the fence_openstack fence agent.

The following procedure creates an openstack-info resource. This procedure 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 Authentication methods for RHOSP

Procedure

Complete the following steps from any node in the cluster.

  1. To view the options for the openstack-info resource agent, run the following command.

    # pcs resource describe openstack-info
  2. 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.

    # pcs resource create openstack-info openstack-info cloud="ha-example" clone
  3. 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

The following procedure creates an RHOSP virtual IP address resource for an HA cluster on an RHOSP platform. This procedure 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 IPadr2 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 Authentication methods for RHOSP

Procedure

Complete the following steps from any node in the cluster.

  1. To view the options for the openstack-virtual-ip resource agent, run the following command.

    # pcs resource describe openstack-virtual-ip
  2. 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  |
    +--------------------------------------+ ...  +----------------+
  3. 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
  4. Configure ordering and location constraints to ensure that the openstack-info resource starts before the virtual IP address resource and 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
  5. Create an IPaddr2 resource for the virtual IP address.

    # pcs resource create ClusterIP ocf:heartbeat:IPaddr2 ip=172.16.0.119
  6. 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.

    # 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

  1. 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)
  2. 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 Authentication methods for RHOSP

Procedure

Complete the following steps from any node in the cluster.

  1. To view the options for the openstack-floating-ip resource agent, run the following command.

    # pcs resource describe openstack-floating-ip
  2. Find the subnet ID for the address on the public network that you will use to create the floating IP address resource.

    1. 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
    2. 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 |
      +--------------------------------------+------------------+
  3. 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"
  4. 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
  5. 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

  1. 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)
  2. 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 Authentication methods for RHOSP

Procedure

Complete the following steps from any node in the cluster.

  1. To view the options for the openstack-cinder-volume resource agent, run the following command.

    # pcs resource describe openstack-cinder-volume
  2. 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
  3. 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"
  4. 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
  5. 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

  1. 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)
  2. 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