Merge lp:~openstack-charmers/charms/precise/hacluster/add-pingd-support into lp:charms/hacluster

Proposed by Marco Ceppi
Status: Merged
Merged at revision: 20
Proposed branch: lp:~openstack-charmers/charms/precise/hacluster/add-pingd-support
Merge into: lp:charms/hacluster
Diff against target: 62 lines (+31/-1)
3 files modified
config.yaml (+13/-0)
hooks/hooks.py (+17/-0)
revision (+1/-1)
To merge this branch: bzr merge lp:~openstack-charmers/charms/precise/hacluster/add-pingd-support
Reviewer Review Type Date Requested Status
James Page Pending
Marco Ceppi Pending
OpenStack Charmers Pending
Review via email: mp+207161@code.launchpad.net

This proposal supersedes a proposal from 2014-01-29.

To post a comment you must log in.
Revision history for this message
Marco Ceppi (marcoceppi) wrote : Posted in a previous version of this proposal

Deferring to openstack-charmers

review: Abstain
Revision history for this message
James Page (james-page) wrote : Posted in a previous version of this proposal

monitor_interval config is never actually retrieved:

    if monitor_host:
        cmd = 'crm -F configure primitive Ping' \
              ' ocf:pacemaker:ping params host_list="%s"' \
              ' multiplier="100" op monitor interval="%s"' %\
                                            (monitor_host,
                                             monitor_interval)

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'config.yaml'
--- config.yaml 2013-04-30 09:37:52 +0000
+++ config.yaml 2014-02-19 12:31:39 +0000
@@ -41,3 +41,16 @@
41 type: int41 type: int
42 default: 242 default: 2
43 description: Number of peer units required to bootstrap cluster services.43 description: Number of peer units required to bootstrap cluster services.
44 monitor_host:
45 type: string
46 description: |
47 One or more IPs, separated by space, that will be used as a saftey check
48 for avoiding split brain situations. Nodes in the cluster will ping these
49 IPs periodicaly. Node that can not ping monitor_host will not run shared
50 resources (VIP, shared disk...).
51 monitor_interval:
52 type: string
53 default: 5s
54 description: |
55 Time period between checks of resource health. It consists of a number
56 and a time factor, e.g. 5s = 5 seconds. 2m = 2 minutes.
4457
=== modified file 'hooks/hooks.py'
--- hooks/hooks.py 2013-03-24 13:33:02 +0000
+++ hooks/hooks.py 2014-02-19 12:31:39 +0000
@@ -226,6 +226,19 @@
226 ' resource-stickiness="100"'226 ' resource-stickiness="100"'
227 pcmk.commit(cmd)227 pcmk.commit(cmd)
228228
229 # Configure Ping service
230 monitor_host = utils.config_get('monitor_host')
231 if monitor_host:
232 cmd = 'crm -F configure primitive Ping' \
233 ' ocf:pacemaker:ping params host_list="%s"' \
234 ' multiplier="100" op monitor interval="%s"' %\
235 (monitor_host,
236 monitor_interval)
237 cmd2 = 'crm -F configure clone PingClone Ping' \
238 ' meta interleave="true"'
239 pcmk.commit(cmd)
240 pcmk.commit(cmd2)
241
229 # Only configure the cluster resources242 # Only configure the cluster resources
230 # from the oldest peer unit.243 # from the oldest peer unit.
231 if cluster.oldest_peer(cluster.peer_units()):244 if cluster.oldest_peer(cluster.peer_units()):
@@ -256,6 +269,10 @@
256 resource_params[res_name])269 resource_params[res_name])
257 pcmk.commit(cmd)270 pcmk.commit(cmd)
258 utils.juju_log('INFO', '%s' % cmd)271 utils.juju_log('INFO', '%s' % cmd)
272 if monitor_host:
273 cmd = 'crm -F configure location Ping-%s %s rule' \
274 ' -inf: pingd lte 0' % (res_name, res_name)
275 pcmk.commit(cmd)
259276
260 utils.juju_log('INFO', 'Configuring Groups')277 utils.juju_log('INFO', 'Configuring Groups')
261 utils.juju_log('INFO', str(groups))278 utils.juju_log('INFO', str(groups))
262279
=== modified file 'revision'
--- revision 2013-04-30 19:48:37 +0000
+++ revision 2014-02-19 12:31:39 +0000
@@ -1,1 +1,1 @@
167168

Subscribers

People subscribed via source and target branches

to all changes: