diff --git a/src/config.yaml b/src/config.yaml index 33b234d..be5d58f 100644 --- a/src/config.yaml +++ b/src/config.yaml @@ -3,11 +3,6 @@ "type": "string" "default": "cinder_netapp" "description": "Service name to present to Cinder" - "cluster-cinder-volume": - "type": "boolean" - "default": !!bool "false" - "description": | - Whether to handle all cinder-volume services as a cluster. "netapp-storage-family": "type": "string" "default": "ontap_cluster" diff --git a/src/lib/charm/openstack/cinder_netapp.py b/src/lib/charm/openstack/cinder_netapp.py index c8318ff..9b9fbb2 100644 --- a/src/lib/charm/openstack/cinder_netapp.py +++ b/src/lib/charm/openstack/cinder_netapp.py @@ -26,9 +26,7 @@ class CinderNetAppCharm( release = 'ocata' packages = [] release_pkg = 'cinder-common' - # iscsi is stateful, fibre channel can be either stateful or stateless, - # nfs is stateless. Regardless, the driver may not cope well with - # cinder-volume service clustering, so let's allow it to be configurable + # The cinder-netapp driver currently does not support ACTIVE-ACTIVE stateless = False # Specify any config that the user *must* set. mandatory_config = [ @@ -39,12 +37,6 @@ class CinderNetAppCharm( cget = self.config.get service = cget('volume-backend-name') - # Regardless of stateless or stateful what we really want is whether - # to configure cinder volume services as a cluster. This can be done - # in different ways and for different reasons, ideally this - # variable passed through relation should be renamed. - self.stateless = cget('cluster-cinder-volume') - volumedriver = 'cinder.volume.drivers.netapp.common.NetAppDriver' driver_options_extension = [] driver_transport = [] @@ -76,9 +68,11 @@ class CinderNetAppCharm( ('nfs_shares_config', cget('netapp-nfs-shares-config'))] if cget('netapp-storage-protocol') in ("iscsi", "fc"): - lun_space_reservation = cget( - 'netapp-lun-space-reservation') - lun_space_reservation = 'enabled' if lun_space_reservation is True else 'disabled' + lun_space_reservation = cget('netapp-lun-space-reservation') + if lun_space_reservation is True: + lun_space_reservation = 'enabled' + else: + lun_space_reservation = 'disabled' driver_options_extension += [ ('netapp_pool_name_search_pattern', cget( 'netapp-pool-name-search-pattern')), diff --git a/unit_tests/test_lib_charm_openstack_cinder_netapp.py b/unit_tests/test_lib_charm_openstack_cinder_netapp.py index fc3ae01..3391585 100644 --- a/unit_tests/test_lib_charm_openstack_cinder_netapp.py +++ b/unit_tests/test_lib_charm_openstack_cinder_netapp.py @@ -49,11 +49,6 @@ class TestCinderNetAppCharm(test_utils.PatchHelper): self.assertEqual(config.get('volume_driver'), 'cinder.volume.drivers.netapp.common.NetAppDriver') - def test_cinder_cluster_config(self): - charm = self._patch_config_and_charm({'cluster-cinder-volume': True}) - charm.cinder_configuration() - self.assertTrue(charm.stateless) - def test_cinder_https(self): charm = self._patch_config_and_charm({'netapp-server-port': 443}) config = charm.cinder_configuration() @@ -91,9 +86,9 @@ class TestCinderNetAppCharm(test_utils.PatchHelper): charm = self._patch_config_and_charm(econfig) config = charm.cinder_configuration() self.assertIn(('netapp_pool_name_search_pattern', - econfig['netapp-pool-name-search-pattern']), config) + econfig['netapp-pool-name-search-pattern']), config) self.assertIn(('netapp_lun_space_reservation', - 'enabled'), config) + 'enabled'), config) def test_cinder_fc_options(self): econfig = {'netapp-pool-name-search-pattern': 'foo.*bar', @@ -102,9 +97,9 @@ class TestCinderNetAppCharm(test_utils.PatchHelper): charm = self._patch_config_and_charm(econfig) config = charm.cinder_configuration() self.assertIn(('netapp_pool_name_search_pattern', - econfig['netapp-pool-name-search-pattern']), config) + econfig['netapp-pool-name-search-pattern']), config) self.assertIn(('netapp_lun_space_reservation', - 'enabled'), config) + 'enabled'), config) def test_cinder_iscsi_fc_options_not_included(self): econfig = {'netapp-pool-name-search-pattern': 'foo.*bar',