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
1=== modified file 'config.yaml'
2--- config.yaml 2013-04-30 09:37:52 +0000
3+++ config.yaml 2014-02-19 12:31:39 +0000
4@@ -41,3 +41,16 @@
5 type: int
6 default: 2
7 description: Number of peer units required to bootstrap cluster services.
8+ monitor_host:
9+ type: string
10+ description: |
11+ One or more IPs, separated by space, that will be used as a saftey check
12+ for avoiding split brain situations. Nodes in the cluster will ping these
13+ IPs periodicaly. Node that can not ping monitor_host will not run shared
14+ resources (VIP, shared disk...).
15+ monitor_interval:
16+ type: string
17+ default: 5s
18+ description: |
19+ Time period between checks of resource health. It consists of a number
20+ and a time factor, e.g. 5s = 5 seconds. 2m = 2 minutes.
21
22=== modified file 'hooks/hooks.py'
23--- hooks/hooks.py 2013-03-24 13:33:02 +0000
24+++ hooks/hooks.py 2014-02-19 12:31:39 +0000
25@@ -226,6 +226,19 @@
26 ' resource-stickiness="100"'
27 pcmk.commit(cmd)
28
29+ # Configure Ping service
30+ monitor_host = utils.config_get('monitor_host')
31+ if monitor_host:
32+ cmd = 'crm -F configure primitive Ping' \
33+ ' ocf:pacemaker:ping params host_list="%s"' \
34+ ' multiplier="100" op monitor interval="%s"' %\
35+ (monitor_host,
36+ monitor_interval)
37+ cmd2 = 'crm -F configure clone PingClone Ping' \
38+ ' meta interleave="true"'
39+ pcmk.commit(cmd)
40+ pcmk.commit(cmd2)
41+
42 # Only configure the cluster resources
43 # from the oldest peer unit.
44 if cluster.oldest_peer(cluster.peer_units()):
45@@ -256,6 +269,10 @@
46 resource_params[res_name])
47 pcmk.commit(cmd)
48 utils.juju_log('INFO', '%s' % cmd)
49+ if monitor_host:
50+ cmd = 'crm -F configure location Ping-%s %s rule' \
51+ ' -inf: pingd lte 0' % (res_name, res_name)
52+ pcmk.commit(cmd)
53
54 utils.juju_log('INFO', 'Configuring Groups')
55 utils.juju_log('INFO', str(groups))
56
57=== modified file 'revision'
58--- revision 2013-04-30 19:48:37 +0000
59+++ revision 2014-02-19 12:31:39 +0000
60@@ -1,1 +1,1 @@
61-67
62+68

Subscribers

People subscribed via source and target branches

to all changes: