Re-add NFS backend for Glance
authorJiri Stransky <jistr@redhat.com>
Thu, 20 Oct 2016 17:27:42 +0000 (19:27 +0200)
committerJiri Stransky <jistr@redhat.com>
Fri, 21 Oct 2016 14:22:40 +0000 (16:22 +0200)
We lost ability to store Glance images in NFS mounts as we moved to NG
HA architecture. This patch re-adds that ability, but the parameter
interface changes because the semantics change as well. (Pacemaker
allowed for different mounts than just NFS so the parameters were more
generic, although we only ever tested and documented NFS usage.)

Change-Id: Ic5197e09846bbf75d780dcc74da1717dcf8301d0
Related-Bug: #1635606

environments/storage-environment.yaml
puppet/services/glance-base.yaml

index 8cf3462..8e02c30 100644 (file)
@@ -34,18 +34,18 @@ parameter_defaults:
   # CinderNfsServers: ''
 
 
-  #### GLANCE FILE BACKEND PACEMAKER SETTINGS (used for mounting NFS) ####
+  #### GLANCE NFS SETTINGS ####
 
-  ## Whether to make Glance 'file' backend a mount managed by Pacemaker
-  # GlanceFilePcmkManage: false
-  ## File system type of the mount
-  # GlanceFilePcmkFstype: nfs
-  ## Pacemaker mount point, e.g. '192.168.122.1:/export/glance' for NFS
-  ##  (If using IPv6, use both double- and single-quotes,
-  ##  e.g. "'[fdd0::1]:/export/glance'")
-  # GlanceFilePcmkDevice: ''
-  ## Options for the mount managed by Pacemaker
-  # GlanceFilePcmkOptions: ''
+  ## Make sure to set `GlanceBackend: file` when enabling NFS
+  ##
+  ## Whether to make Glance 'file' backend a NFS mount
+  # GlanceNfsEnabled: false
+  ## NFS share for image storage, e.g. '192.168.122.1:/export/glance'
+  ## (If using IPv6, use both double- and single-quotes,
+  ## e.g. "'[fdd0::1]:/export/glance'")
+  # GlanceNfsShare: ''
+  ## Mount options for the NFS image storage mount point
+  # GlanceNfsOptions: 'intr,context=system_u:object_r:glance_var_lib_t:s0'
 
 
   #### CEPH SETTINGS ####
index 3294fc0..cc979af 100644 (file)
@@ -44,6 +44,21 @@ parameters:
     type: string
     constraints:
     - allowed_values: ['swift', 'file', 'rbd']
+  GlanceNfsEnabled:
+    default: false
+    description: >
+      When using GlanceBackend 'file', mount NFS share for image storage.
+    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
   GlanceRbdPoolName:
     default: images
     type: string
@@ -92,6 +107,9 @@ outputs:
         glance::notify::rabbitmq::notification_driver: messagingv2
         glance::registry::db::database_db_max_retries: -1
         glance::registry::db::database_max_retries: -1
+        tripleo::profile::base::glance::api::glance_nfs_enabled: {get_param: GlanceNfsEnabled}
+        tripleo::glance::nfs_mount::share: {get_param: GlanceNfsShare}
+        tripleo::glance::nfs_mount::options: {get_param: GlanceNfsOptions}
       service_config_settings:
         keystone:
           glance::keystone::auth::public_url: {get_param: [EndpointMap, GlancePublic, uri]}