From 47805e22414479a1fd213efb6a638d605cafa002 Mon Sep 17 00:00:00 2001 From: liushi Date: Mon, 4 Jun 2018 14:23:14 +0800 Subject: [PATCH] Config for cephfs volume path prefix The cloud administrator needs to use the cephfs volume path prefix to layout multiple cephfs driver backends. When cephfs has multiple data pools, manila can configure `cephfs_volume_path_prefix` to store volume data in different cephfs directories of a ceph filesystem [1] for the different cephfs driver backends. Out of band of manila, the admin can set the pool layouts of these cephfs directories to store the volume data in different data pools of the ceph filesystem. This is helpful for planning different data storage to different ceph OSDs. [1] https://github.com/ceph/ceph/commit/d1a21b07ede#diff-8625369b924524f064e083e735bd34beR267 Change-Id: I19e3dd55f1fded339cb17222b3333c0c0f8835e9 Implements: blueprint cephfs-driver-configurable --- manila/share/drivers/cephfs/driver.py | 8 +++++++- .../config-for-cephfs-volume-prefix-67f2513f603cb614.yaml | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/config-for-cephfs-volume-prefix-67f2513f603cb614.yaml diff --git a/manila/share/drivers/cephfs/driver.py b/manila/share/drivers/cephfs/driver.py index 922e2a5558..cda4cd46bc 100644 --- a/manila/share/drivers/cephfs/driver.py +++ b/manila/share/drivers/cephfs/driver.py @@ -57,6 +57,10 @@ cephfs_opts = [ default="manila", help="The name of the ceph auth identity to use." ), + cfg.StrOpt('cephfs_volume_path_prefix', + default="/volumes", + help="The prefix of the cephfs volume path." + ), cfg.BoolOpt('cephfs_enable_snapshots', default=False, help="Whether to enable snapshots in this driver." @@ -180,8 +184,10 @@ class CephFSDriver(driver.ExecuteMixin, driver.GaneshaMixin, conf_path = self.configuration.safe_get('cephfs_conf_path') cluster_name = self.configuration.safe_get('cephfs_cluster_name') auth_id = self.configuration.safe_get('cephfs_auth_id') + volume_prefix = self.configuration.safe_get( + 'cephfs_volume_path_prefix') self._volume_client = ceph_volume_client.CephFSVolumeClient( - auth_id, conf_path, cluster_name) + auth_id, conf_path, cluster_name, volume_prefix=volume_prefix) LOG.info("[%(be)s}] Ceph client found, connecting...", {"be": self.backend_name}) if auth_id != CEPH_DEFAULT_AUTH_ID: diff --git a/releasenotes/notes/config-for-cephfs-volume-prefix-67f2513f603cb614.yaml b/releasenotes/notes/config-for-cephfs-volume-prefix-67f2513f603cb614.yaml new file mode 100644 index 0000000000..ac51623702 --- /dev/null +++ b/releasenotes/notes/config-for-cephfs-volume-prefix-67f2513f603cb614.yaml @@ -0,0 +1,4 @@ +--- +features: + - cephfs volume path prefix is now configurable in order to + enable support for multiple cephfs back ends.