Add support for Glance RBD backend
authorDan Prince <dprince@redhat.com>
Thu, 9 Apr 2015 12:41:24 +0000 (08:41 -0400)
committerDan Prince <dprince@redhat.com>
Mon, 4 May 2015 14:23:06 +0000 (10:23 -0400)
This patch adds support for a new GlanceBackend setting
which can be set to one of swift, rbd, or file to control
which Glance backend is configured for use by default.

Change-Id: Id6a3fbc3477e85e8e2446e3dc13d424f9535d0ff

controller.yaml
overcloud-without-mergepy.yaml
puppet/ceph-cluster-config.yaml
puppet/controller-puppet.yaml
puppet/hieradata/ceph.yaml
puppet/hieradata/controller.yaml
puppet/manifests/overcloud_controller.pp

index 37c0deb..6aaaecc 100644 (file)
@@ -144,6 +144,13 @@ parameters:
     default: http
     description: Protocol to use when connecting to glance, set to https for SSL.
     type: string
+  GlanceBackend:
+    default: swift
+    description: The short name of the Glance backend to use. Should be one
+      of swift, rbd, or file
+    type: string
+    constraints:
+    - allowed_values: ['swift', 'file', 'rbd']
   HeatPassword:
     default: unset
     description: The password for the Heat service account, used by the Heat services.
index 142e502..6c7a54e 100644 (file)
@@ -327,6 +327,13 @@ parameters:
     description: The password for the glance service account, used by the glance services.
     type: string
     hidden: true
+  GlanceBackend:
+    default: swift
+    description: The short name of the Glance backend to use. Should be one
+      of swift, rbd or file
+    type: string
+    constraints:
+    - allowed_values: ['swift', 'file', 'rbd']
   HeatPassword:
     default: unset
     description: The password for the Heat service account, used by the Heat services.
@@ -563,6 +570,7 @@ resources:
           GlancePort: {get_param: GlancePort}
           GlanceProtocol: {get_param: GlanceProtocol}
           GlancePassword: {get_param: GlancePassword}
+          GlanceBackend: {get_param: GlanceBackend}
           GlanceNotifierStrategy: {get_param: GlanceNotifierStrategy}
           GlanceLogFile: {get_param: GlanceLogFile}
           HeatPassword: {get_param: HeatPassword}
index e01bd19..f467312 100644 (file)
@@ -57,7 +57,7 @@ resources:
                         secret: 'ADMIN_KEY',
                         mode: '0644',
                         cap_mon: 'allow r',
-                        cap_osd: 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rwx pool=vms'
+                        cap_osd: 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rwx pool=vms, allow rwx pool=images'
                       }
                     }"
                     params:
index a904e04..8831cba 100644 (file)
@@ -144,6 +144,13 @@ parameters:
     default: http
     description: Protocol to use when connecting to glance, set to https for SSL.
     type: string
+  GlanceBackend:
+    default: swift
+    description: The short name of the Glance backend to use. Should be one
+      of swift, rbd, or file
+    type: string
+    constraints:
+    - allowed_values: ['swift', 'file', 'rbd']
   HeatPassword:
     default: unset
     description: The password for the Heat service account, used by the Heat services.
@@ -491,6 +498,7 @@ resources:
         glance_port: {get_param: GlancePort}
         glance_protocol: {get_param: GlanceProtocol}
         glance_password: {get_param: GlancePassword}
+        glance_backend: {get_param: GlanceBackend}
         glance_swift_store_auth_address: {list_join: ['', ['http://', {get_param: VirtualIP} , ':5000/v2.0']]}
         glance_notifier_strategy: {get_param: GlanceNotifierStrategy}
         glance_log_file: {get_param: GlanceLogFile}
@@ -708,6 +716,7 @@ resources:
                 glance::backend::swift::swift_store_auth_address: {get_input: glance_swift_store_auth_address}
                 glance::backend::swift::swift_store_user: service:glance
                 glance::backend::swift::swift_store_key: {get_input: glance_password}
+                glance_backend: {get_input: glance_backend}
 
                 # Heat
                 heat_stack_domain_admin_password: {get_input: heat_stack_domain_admin_password}
index e43b0da..33ce5ef 100644 (file)
@@ -9,3 +9,4 @@ ceph::profile::params::authentication_type: cephx
 ceph_pools:
   - volumes
   - vms
+  - images
index 5cf9f35..0256cbc 100644 (file)
@@ -48,12 +48,10 @@ swift::proxy::account_autocreate: true
 
 # glance
 glance::api::pipeline: 'keystone'
-glance::api::known_stores:
-  - glance.store.filesystem.Store
-  - glance.store.swift.Store
 glance::registry::pipeline: 'keystone'
 glance::registry::manage_service: true
 glance::backend::swift::swift_store_create_container_on_put: true
+glance::backend::rbd::rbd_store_user: 'openstack'
 
 # neutron
 neutron::core_plugin: 'ml2'
index b1ccf3d..cf2f21a 100644 (file)
@@ -249,11 +249,21 @@ if hiera('step') >= 3 {
     require => File['/etc/keystone/ssl/certs'],
   }
 
+  $glance_backend = downcase(hiera('glance_backend', 'swift'))
+  case $glance_backend {
+      swift: { $glance_store = 'glance.store.swift.Store' }
+      file: { $glance_store = 'glance.store.filesystem.Store' }
+      rbd: { $glance_store = 'glance.store.rbd.Store' }
+      default: { fail('Unrecognized glance_backend parameter.') }
+  }
+
   # TODO: notifications, scrubber, etc.
   include ::glance
-  include ::glance::api
+  class { 'glance::api':
+    known_stores => [$glance_store]
+  }
   include ::glance::registry
-  include ::glance::backend::swift
+  include join(['::glance::backend::', $glance_backend])
 
   class { 'nova':
     glance_api_servers     => join([hiera('glance_protocol'), '://', hiera('controller_virtual_ip'), ':', hiera('glance_port')]),