Expose image locations by default when in use with a Ceph backend to support copy-on-write cloning in cinder and nova

This commit is contained in:
James Page 2016-01-07 11:38:02 +00:00
parent 7743416bd4
commit 8a0023faa4
4 changed files with 14 additions and 1 deletions

View File

@ -255,3 +255,10 @@ options:
wait for you to execute the openstack-upgrade action for this charm on
each unit. If False it will revert to existing behavior of upgrading
all units on config change.
expose-image-locations:
type: boolean
default: True
description: |
Expose underlying image locations via the API when using Ceph for image
storage. Only disable this option if you do not wish to use copy-on-write
clones of RAW format images with Ceph in Cinder and Nova.

View File

@ -32,6 +32,7 @@ class CephGlanceContext(OSContextGenerator):
# pool created based on service name.
'rbd_pool': service,
'rbd_user': service,
'expose_image_locations': config('expose-image-locations')
}

View File

@ -20,6 +20,8 @@ registry_host = {{ registry_host }}
registry_port = 9191
registry_client_protocol = http
show_multiple_locations = {{ expose_image_locations }}
{% if api_config_flags -%}
{% for key, value in api_config_flags.iteritems() -%}
{{ key }} = {{ value }}

View File

@ -42,10 +42,13 @@ class TestGlanceContexts(CharmTestCase):
self.is_relation_made.return_value = True
service = 'glance'
self.service_name.return_value = service
self.config.return_value = True
self.assertEquals(
contexts.CephGlanceContext()(),
{'rbd_pool': service,
'rbd_user': service})
'rbd_user': service,
'expose_image_locations': True})
self.config.assert_called_with('expose-image-locations')
def test_multistore(self):
self.relation_ids.return_value = ['random_rid']