summaryrefslogtreecommitdiff
path: root/glance_store/_drivers
diff options
context:
space:
mode:
authorRajat Dhasmana <rajatdhasmana@gmail.com>2020-02-22 16:30:26 +0000
committerRajat Dhasmana <rajatdhasmana@gmail.com>2020-03-27 13:49:05 +0000
commit1a656163c9d68520ab26035d350f2568cbfb881f (patch)
tree427544f7d82997f59bd05511cc3a254a126542d7 /glance_store/_drivers
parentae73287c7b4db8d5894f72d8a5b1b89b42697545 (diff)
downloadglance_store-1a656163c9d68520ab26035d350f2568cbfb881f.tar.gz
Add config for cinder mounting needs
This patch adds a config option 'mount_point_base' by which we can provide the mount point for *fs volumes. The different types of FS drivers will have separate directory for mounting their volumes, Eg: <mount_point_base>/nfs, <mount_point_base>/xyzfs etc. The default mount point for *fs volumes is /var/lib/glance/mnt/*fs. Closes-Bug: #1866966 Change-Id: I10b5ea4943ad9388ce1962eae9204b905c8ff24a
Diffstat (limited to 'glance_store/_drivers')
-rw-r--r--glance_store/_drivers/cinder.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/glance_store/_drivers/cinder.py b/glance_store/_drivers/cinder.py
index e8572b6..3350e39 100644
--- a/glance_store/_drivers/cinder.py
+++ b/glance_store/_drivers/cinder.py
@@ -333,6 +333,15 @@ Related options:
* cinder_enforce_multipath
"""),
+ cfg.StrOpt('cinder_mount_point_base',
+ default='/var/lib/glance/mnt',
+ help="""
+Directory where the NFS volume is mounted on the glance node.
+
+Possible values:
+
+* A string representing absolute path of mount point.
+"""),
]
@@ -531,9 +540,12 @@ class Store(glance_store.driver.Store):
self.conf, self.backend_group).cinder_use_multipath
enforce_multipath = getattr(
self.conf, self.backend_group).cinder_enforce_multipath
+ mount_point_base = getattr(
+ self.conf, self.backend_group).cinder_mount_point_base
else:
use_multipath = self.conf.glance_store.cinder_use_multipath
enforce_multipath = self.conf.glance_store.cinder_enforce_multipath
+ mount_point_base = self.conf.glance_store.cinder_mount_point_base
properties = connector.get_connector_properties(
root_helper, host, use_multipath, enforce_multipath)
@@ -548,6 +560,9 @@ class Store(glance_store.driver.Store):
try:
connection_info = volume.initialize_connection(volume, properties)
+ if connection_info['driver_volume_type'] == 'nfs':
+ connection_info['mount_point_base'] = os.path.join(
+ mount_point_base, 'nfs')
conn = connector.InitiatorConnector.factory(
connection_info['driver_volume_type'], root_helper,
conn=connection_info)