Adds ceph-osd-replication-count to config.yaml
Fixes: bug 1227008
This commit is contained in:
parent
a9d1d2ea5a
commit
14f532bcb7
10
config.yaml
10
config.yaml
@ -26,6 +26,16 @@ options:
|
||||
default: RegionOne
|
||||
type: string
|
||||
description: OpenStack Region
|
||||
ceph-osd-replication-count:
|
||||
default: 2
|
||||
type: int
|
||||
description: |
|
||||
This value dictates the number of replicas ceph must make of any
|
||||
object it stores within the images rbd pool. Of course, this only
|
||||
applies if using Ceph as a backend store. Note that once the images
|
||||
rbd pool has been created, changing this value will not have any
|
||||
effect (although it can be changed in ceph by manually configuring
|
||||
your ceph cluster).
|
||||
# HA configuration settings
|
||||
vip:
|
||||
type: string
|
||||
|
@ -150,7 +150,9 @@ def ceph_changed():
|
||||
juju_log('ceph relation incomplete. Peer not ready?')
|
||||
return
|
||||
|
||||
if not ensure_ceph_keyring(service=service_name(),
|
||||
service = service_name()
|
||||
|
||||
if not ensure_ceph_keyring(service=service,
|
||||
user='glance', group='glance'):
|
||||
juju_log('Could not create ceph keyring: peer not ready?')
|
||||
return
|
||||
@ -159,7 +161,9 @@ def ceph_changed():
|
||||
CONFIGS.write(CEPH_CONF)
|
||||
|
||||
if eligible_leader(CLUSTER_RES):
|
||||
ensure_ceph_pool(service=service_name())
|
||||
_config = config()
|
||||
ensure_ceph_pool(service=service,
|
||||
replicas=_config['ceph-osd-replication-count'])
|
||||
|
||||
|
||||
@hooks.hook('identity-service-relation-joined')
|
||||
|
@ -126,11 +126,11 @@ def migrate_database():
|
||||
subprocess.check_call(cmd)
|
||||
|
||||
|
||||
def ensure_ceph_pool(service):
|
||||
def ensure_ceph_pool(service, replicas):
|
||||
'''Creates a ceph pool for service if one does not exist'''
|
||||
# TODO: Ditto about moving somewhere sharable.
|
||||
if not ceph_pool_exists(service=service, name=service):
|
||||
ceph_create_pool(service=service, name=service)
|
||||
ceph_create_pool(service=service, name=service, replicas=replicas)
|
||||
|
||||
|
||||
def do_openstack_upgrade(configs):
|
||||
|
@ -222,7 +222,8 @@ class GlanceRelationTests(CharmTestCase):
|
||||
self.assertEquals([call('/etc/glance/glance-api.conf'),
|
||||
call('/etc/ceph/ceph.conf')],
|
||||
configs.write.call_args_list)
|
||||
self.ensure_ceph_pool.assert_called_with(service=self.service_name())
|
||||
self.ensure_ceph_pool.assert_called_with(service=self.service_name(),
|
||||
replicas=2)
|
||||
|
||||
def test_keystone_joined_not_leader(self):
|
||||
self.eligible_leader.return_value = False
|
||||
|
Loading…
x
Reference in New Issue
Block a user