Merge lp:~hopem/charms/precise/glance/lp1227008 into lp:~charmers/charms/precise/glance/trunk

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 36
Proposed branch: lp:~hopem/charms/precise/glance/lp1227008
Merge into: lp:~charmers/charms/precise/glance/trunk
Diff against target: 49 lines (+24/-2)
3 files modified
config.yaml (+11/-0)
hooks/glance-relations (+12/-1)
revision (+1/-1)
To merge this branch: bzr merge lp:~hopem/charms/precise/glance/lp1227008
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+186272@code.launchpad.net
To post a comment you must log in.
37. By Edward Hope-Morley

* bumped version
* filtered out extra newline char in output of 'ceph osd ls'

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-02-14 23:21:43 +0000
3+++ config.yaml 2013-09-18 18:41:38 +0000
4@@ -60,3 +60,14 @@
5 ssl_key:
6 type: string
7 description: SSL key to use with certificate specified as ssl_cert.
8+ ceph-osd-replication-count:
9+ default: 2
10+ type: int
11+ description: |
12+ This value dictates the number of replicas ceph must make of any
13+ object it stores within the images rbd pool. Of course, this only
14+ applies if using Ceph as a backend store. Note that once the images
15+ rbd pool has been created, changing this value will not have any
16+ effect (although it can be changed in ceph by manually configuring
17+ your ceph cluster).
18+
19
20=== modified file 'hooks/glance-relations'
21--- hooks/glance-relations 2013-06-03 20:08:45 +0000
22+++ hooks/glance-relations 2013-09-18 18:41:38 +0000
23@@ -179,7 +179,18 @@
24
25 # Create the images pool if it does not already exist
26 if ! rados --id $SERVICE_NAME lspools | grep -q images; then
27- rados --id $SERVICE_NAME mkpool images
28+ local num_osds=$(ceph --id $SERVICE_NAME osd ls| egrep "[^\s]"| wc -l)
29+ local cfg_key='ceph-osd-replication-count'
30+ local rep_count="$(config-get $cfg_key)"
31+ if [ -z "$rep_count" ]
32+ then
33+ rep_count=2
34+ juju-log "config returned empty string for $cfg_key - using value of 2"
35+ fi
36+ local num_pgs=$(((num_osds*100)/rep_count))
37+ ceph --id $SERVICE_NAME osd pool create images $num_pgs $num_pgs
38+ ceph --id $SERVICE_NAME osd pool set images size $rep_count
39+ # TODO: set appropriate crush ruleset
40 fi
41
42 # Configure glance for ceph storage options
43
44=== modified file 'revision'
45--- revision 2013-06-03 20:08:45 +0000
46+++ revision 2013-09-18 18:41:38 +0000
47@@ -1,1 +1,1 @@
48-143
49+144

Subscribers

People subscribed via source and target branches