From 4e814009c761e7a164e72c8999b6f501053c14b8 Mon Sep 17 00:00:00 2001 From: Gustavo Sanchez Date: Tue, 25 Jan 2022 13:41:14 -0400 Subject: [PATCH] Add volume_backend_name to render in cinder.conf Change-Id: I7e8f0c19047a20a178f6d16017f3c424c856c918 --- config.yaml | 10 ++++++---- src/charm.py | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/config.yaml b/config.yaml index 9e201ae..ecba8c8 100644 --- a/config.yaml +++ b/config.yaml @@ -20,10 +20,12 @@ options: volume-backend-name: type: string description: | - A volume back-end name which is specified in the cinder.conf file. - This is also used while assigning a back-end name to the Nimble - volume type. - default: cinder_nimblestorage + Volume backend name for the backend. The default value is the + application name in the Juju model, e.g. "cinder-nimble-mybackend" + if it's deployed as `juju deploy cinder-nimble cinder-nimble-mybackend` + A common backend name can be set to multiple backends with the + same characters so that those can be treated as a single virtual + backend associated with a single volume type. use-multipath-for-image-xfer: type: boolean description: | diff --git a/src/charm.py b/src/charm.py index 868c6db..9d17d8b 100755 --- a/src/charm.py +++ b/src/charm.py @@ -46,9 +46,12 @@ class CinderNimblestorageCharm(CinderStoragePluginCharm): cget = charm_config.get volume_driver = cget('volume-driver') + volume_backend_name = cget( + 'volume-backend-name') or self.framework.model.app.name raw_options = [ ('volume_driver', VOLUME_DRIVERS[volume_driver]), + ('volume_backend_name', volume_backend_name), ('san_ip', cget('san-ip')), ('san_login', cget('san-login')), ('san_password', cget('san-password')),