From e828e8c7bb2e890b243faa767992226dc270bb6f Mon Sep 17 00:00:00 2001 From: Alan Bishop Date: Wed, 11 Oct 2017 11:02:43 -0400 Subject: [PATCH] Enable Cinder as a backend for Glance Enable Cinder as a backend for Glance by adding 'cinder' to the list of allowed choices for the GlanceBackend heat parameter. Update the glance-api docker configuration to allow the feature to work. This is necessary because the feature uses iSCSI, which requires additional privileges. Depends-On: I850047e32f3608b3ce490e52e2e540695cb1a4ff Change-Id: I42241747de931103a04aa5ee2ed18fd46197d183 --- docker/services/glance-api.yaml | 16 +++++++++++++++- environments/storage/enable-ceph.yaml | 2 +- environments/storage/external-ceph.yaml | 2 +- environments/storage/glance-nfs.yaml | 2 +- puppet/services/glance-api.yaml | 4 ++-- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/docker/services/glance-api.yaml b/docker/services/glance-api.yaml index f1cd485ef7..e0c90a59d5 100644 --- a/docker/services/glance-api.yaml +++ b/docker/services/glance-api.yaml @@ -39,6 +39,13 @@ parameters: EnableInternalTLS: type: boolean default: false + GlanceBackend: + default: swift + description: The short name of the Glance backend to use. Should be one + of swift, rbd, cinder, or file + type: string + constraints: + - allowed_values: ['swift', 'file', 'rbd', 'cinder'] GlanceNfsEnabled: default: false description: > @@ -63,6 +70,7 @@ conditions: internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]} nfs_backend_enabled: {equals: [{get_param: GlanceNfsEnabled}, true]} + cinder_backend_enabled: {equals: [{get_param: GlanceBackend}, cinder]} resources: @@ -161,6 +169,12 @@ outputs: - nfs_backend_enabled - /var/lib/glance:/var/lib/glance - '' + - + if: + - cinder_backend_enabled + - - /dev:/dev + - /etc/iscsi:/etc/iscsi + - [] environment: - KOLLA_BOOTSTRAP=True - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS @@ -171,7 +185,7 @@ outputs: start_order: 2 image: *glance_api_image net: host - privileged: false + privileged: {if: [cinder_backend_enabled, true, false]} restart: always volumes: *glance_volumes environment: diff --git a/environments/storage/enable-ceph.yaml b/environments/storage/enable-ceph.yaml index 596ec16eb0..c43f2fa125 100644 --- a/environments/storage/enable-ceph.yaml +++ b/environments/storage/enable-ceph.yaml @@ -21,7 +21,7 @@ parameter_defaults: # Type: boolean CinderEnableRbdBackend: True - # The short name of the Glance backend to use. Should be one of swift, rbd, or file + # The short name of the Glance backend to use. Should be one of swift, rbd, cinder, or file # Type: string GlanceBackend: rbd diff --git a/environments/storage/external-ceph.yaml b/environments/storage/external-ceph.yaml index 0f2d0396b1..dde2c9074c 100644 --- a/environments/storage/external-ceph.yaml +++ b/environments/storage/external-ceph.yaml @@ -43,7 +43,7 @@ parameter_defaults: # Type: string CinderRbdPoolName: volumes - # The short name of the Glance backend to use. Should be one of swift, rbd, or file + # The short name of the Glance backend to use. Should be one of swift, rbd, cinder, or file # Type: string GlanceBackend: rbd diff --git a/environments/storage/glance-nfs.yaml b/environments/storage/glance-nfs.yaml index 3c13930616..359401d52b 100644 --- a/environments/storage/glance-nfs.yaml +++ b/environments/storage/glance-nfs.yaml @@ -21,7 +21,7 @@ parameter_defaults: # Static parameters - these are values that must be # included in the environment but should not be changed. # ****************************************************** - # The short name of the Glance backend to use. Should be one of swift, rbd, or file + # The short name of the Glance backend to use. Should be one of swift, rbd, cinder, or file # Type: string GlanceBackend: file diff --git a/puppet/services/glance-api.yaml b/puppet/services/glance-api.yaml index c7e9dd1dca..10e556b390 100644 --- a/puppet/services/glance-api.yaml +++ b/puppet/services/glance-api.yaml @@ -78,10 +78,10 @@ parameters: GlanceBackend: default: swift description: The short name of the Glance backend to use. Should be one - of swift, rbd, or file + of swift, rbd, cinder, or file type: string constraints: - - allowed_values: ['swift', 'file', 'rbd'] + - allowed_values: ['swift', 'file', 'rbd', 'cinder'] GlanceNfsEnabled: default: false description: >