I wrote all the missing resource agents related to the nova ecosystem. All the RAs are available on my Github. All the ‘nova’ RAs mainly re-use the structure of the resource agent written by Martin Gerhard Loschwitz from Hastexo. See here.
I. Prerequisites
First of all, install the nova components and add yournova.conf file:
If you use Ubuntu, you can prevent those upstart services from running at boot. You can use the .override file facility for this. For other Linux distro see tools like: update-rc.d, insserv or chkconfig.
Verify that Pacemaker knows the new RAs by running the following command:
1
$ sudo crm ra info ocf:openstack:nova-api
II. Setup the resources
I will skip the pacemaker installation steps, I assume that Pacemaker is already configured and running. If you just configured a new 2 nodes cluster, you must see this output from the crm_mon command:
123456789101112
$ sudo crm_mon -1
============Last updated: Thu Jun 21 09:49:48 2012
Last change: Thu Jun 21 09:41:34 2012 via crm_attribute on ha-01
Stack: openais
Current DC: ha-01 - partition with quorum
Version: 1.1.6-9971ebba4494012a93c03b40a2c58ec0eb60f50c
2 Nodes configured, 2 expected votes
0 Resources configured.
============Online: [ ha-01 ha-02 ]
Since we are going to configure a 2 nodes active/passive cluster, you need to custom some parameters in your pacemaker setup:
Disable STONITH
Ignore the quorum policy
Set the resource stickness to prevent resource failbacks. It’s not mandatory but recommended. Don’t forget that the stickiness is additive in groups. Every active member of the group will contribute its stickiness value to the group’s total. Here we have 5 resource agents, each resource has a weight of 100, then the group as a whole will prefer its current location with a score of 500.
Since both of them have the same internal functionnement (connection to an AMPQ server and to a database server), I will only write one example. Simply change the name of the resource agent. The example below uses nova-scheduler.