Merge lp:~hopem/charms/precise/ceph/lp1228316 into lp:~charmers/charms/precise/ceph/trunk

Proposed by Edward Hope-Morley
Status: Merged
Merge reported by: James Page
Merged at revision: not available
Proposed branch: lp:~hopem/charms/precise/ceph/lp1228316
Merge into: lp:~charmers/charms/precise/ceph/trunk
Diff against target: 48 lines (+11/-3)
3 files modified
hooks/ceph.py (+5/-0)
hooks/hooks.py (+5/-2)
revision (+1/-1)
To merge this branch: bzr merge lp:~hopem/charms/precise/ceph/lp1228316
Reviewer Review Type Date Requested Status
Adam Gandelman (community) Needs Information
Review via email: mp+186857@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Adam Gandelman (gandelman-a) wrote :

* The _default_caps are already essentially the default client caps. Is it really required to redefine them?

* Why are the caps now being set in the relation to the remote service?

This still doesn't address the issue of upgrading. Example: I have a cluster with a relation to one client (eg, glance). glance has the previous mon caps 'allow r' I upgrade my cluster to dumpling (which now requires 'allow rw' for clients wishing to mk a pool) and the charm. I add a relation to cinder. cinder gets 'mon rw'. If for some reason things got crazy, and I had to recreate the pools (manual or otherwise), cinder would be able to and glance wouldn't and I would be scratching my head trying to find out why. I'd expect the permissions to be consistent across all relations after the upgrade.

I'd love to see an upgrade-charm hook that iterates through the current ceph relation, check the permissions of each client and add the 'w' bit if required.

review: Needs Information
Revision history for this message
James Page (james-page) wrote :

Ed

I reworked this to include upgrade to existing keys; This actually appears to be broken already for the cloud archive for grizzly - I think the requirement for rw on mon may have crept in with a SRU upgrade for ceph.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/ceph.py'
2--- hooks/ceph.py 2013-07-08 08:32:38 +0000
3+++ hooks/ceph.py 2013-09-20 18:39:56 +0000
4@@ -196,6 +196,11 @@
5 'osd': ['allow rwx']
6 }
7
8+# charmed rbd clients currently create their own pool and need 'mon rw' to
9+# create a pool with non-default settings (lp1228316)
10+_default_client_caps = _default_caps
11+_default_client_caps['mon'] = ['allow rw']
12+
13
14 def get_named_key(name, caps=None):
15 caps = caps or _default_caps
16
17=== modified file 'hooks/hooks.py'
18--- hooks/hooks.py 2013-06-25 11:03:02 +0000
19+++ hooks/hooks.py 2013-09-20 18:39:56 +0000
20@@ -190,8 +190,10 @@
21 units = related_units(relid)
22 if len(units) > 0:
23 service_name = units[0].split('/')[0]
24+ caps = ceph._default_client_caps
25 relation_set(relation_id=relid,
26- key=ceph.get_named_key(service_name),
27+ key=ceph.get_named_key(service_name,
28+ caps=caps),
29 auth=config('auth-supported'))
30
31 log('End notify_client.')
32@@ -235,7 +237,8 @@
33 if ceph.is_quorum():
34 log('mon cluster in quorum - providing client with keys')
35 service_name = remote_unit().split('/')[0]
36- relation_set(key=ceph.get_named_key(service_name),
37+ relation_set(key=ceph.get_named_key(service_name,
38+ caps=ceph._default_client_caps),
39 auth=config('auth-supported'))
40 else:
41 log('mon cluster not in quorum - deferring key provision')
42
43=== modified file 'revision'
44--- revision 2013-06-20 23:58:01 +0000
45+++ revision 2013-09-20 18:39:56 +0000
46@@ -1,1 +1,1 @@
47-92
48+93

Subscribers

People subscribed via source and target branches