Merge "Enable Cinder as a backend for Glance" into stable/pike
authorZuul <zuul@review.openstack.org>
Wed, 8 Nov 2017 05:15:21 +0000 (05:15 +0000)
committerGerrit Code Review <review@openstack.org>
Wed, 8 Nov 2017 05:15:21 +0000 (05:15 +0000)
1  2 
docker/services/glance-api.yaml

@@@ -39,6 -39,13 +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: >
      default: false
      description: Remove package if the service is being disabled during upgrade
      type: boolean
 +  GlanceNfsShare:
 +    default: ''
 +    description: >
 +      NFS share to mount for image storage (when GlanceNfsEnabled is true)
 +    type: string
 +  GlanceNfsOptions:
 +    default: 'intr,context=system_u:object_r:glance_var_lib_t:s0'
 +    description: >
 +      NFS mount options for image storage (when GlanceNfsEnabled is true)
 +    type: string
  
  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:
@@@ -118,10 -116,6 +126,10 @@@ outputs
                dest: "/etc/ceph/"
                merge: true
                preserve_properties: true
 +          permissions:
 +            - path: /var/lib/glance
 +              owner: glance:glance
 +              recurse: true
          /var/lib/kolla/config_files/glance_api_tls_proxy.json:
            command: /usr/sbin/httpd -DFOREGROUND
            config_files:
                        - 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
                  start_order: 2
                  image: *glance_api_image
                  net: host
-                 privileged: false
+                 privileged: {if: [cinder_backend_enabled, true, false]}
                  restart: always
                  volumes: *glance_volumes
                  environment:
                        - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
                  - {}
        host_prep_tasks:
 +        - name: Mount NFS on host
 +          vars:
 +            nfs_backend_enable: {get_param: GlanceNfsEnabled}
 +          mount: name=/var/lib/glance src="{{item.NFS_SHARE}}" fstype=nfs4 opts="{{item.NFS_OPTIONS}}" state=mounted
 +          with_items:
 +            - NFS_SHARE: {get_param: GlanceNfsShare}
 +              NFS_OPTIONS: {get_param: GlanceNfsOptions}
 +          when:
 +            - nfs_backend_enable
          - name: create persistent logs directory
            file:
              path: "{{ item }}"