diff --git a/config.yaml b/config.yaml index 0020c46..7988659 100644 --- a/config.yaml +++ b/config.yaml @@ -1,8 +1,13 @@ options: volume-backend-name: type: string - default: cinder_solidfire - description: Service name to present to Cinder + description: | + Volume backend name for the backend. The default value is the + application name in the Juju model, e.g. "cinder-sf-mybackend" + if it's deployed as `juju deploy cinder-solidfire cinder-sf-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. san-ip: type: string default: !!null "" diff --git a/src/charm.py b/src/charm.py index 7526901..2ed5881 100755 --- a/src/charm.py +++ b/src/charm.py @@ -33,6 +33,9 @@ class CinderSolidfireCharm(CinderStoragePluginCharm): stateless = False active_active = False + mandatory_config = [ + 'san-ip', 'san-login', 'san-password'] + def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._stored.is_started = True @@ -43,9 +46,12 @@ class CinderSolidfireCharm(CinderStoragePluginCharm): sf_volume_prefix = str(uuid.uuid4()) if cget( 'volume-prefix') == "UUID" else cget('volume-prefix') + volume_backend_name = cget( + 'volume-backend-name') or self.framework.model.app.name raw_options = [ ('volume_driver', VOLUME_DRIVER), + ('volume_backend_name', volume_backend_name), ('san_ip', cget('san-ip')), ('san_login', cget('san-login')), ('san_password', cget('san-password')),