summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2023-02-17 20:28:55 +0000
committerGerrit Code Review <review@openstack.org>2023-02-17 20:28:55 +0000
commit2106da4055233353870b31bb1847c9f62b0f3774 (patch)
tree779e50ccb64249db738f242f5448ef4681edde0b
parent66b940b66181b2695b0475eb5c768436abaa7e1c (diff)
parent8c3822c92190dfbfd3a6abc6a81b1f203d4587ac (diff)
downloadcinder-2106da4055233353870b31bb1847c9f62b0f3774.tar.gz
Merge "DEMC: Add support for trim/discard" into stable/yoga
-rw-r--r--cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_fc.py1
-rw-r--r--cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_iscsi.py2
-rw-r--r--cinder/volume/drivers/dell_emc/powerflex/driver.py14
-rw-r--r--cinder/volume/drivers/dell_emc/powermax/common.py1
-rw-r--r--cinder/volume/drivers/dell_emc/powermax/fc.py4
-rw-r--r--cinder/volume/drivers/dell_emc/powermax/iscsi.py4
-rw-r--r--cinder/volume/drivers/dell_emc/powerstore/adapter.py2
-rw-r--r--cinder/volume/drivers/dell_emc/powerstore/driver.py3
-rw-r--r--releasenotes/notes/demc-trim-bb2165f74a5703a6.yaml13
9 files changed, 39 insertions, 5 deletions
diff --git a/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_fc.py b/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_fc.py
index dd679034a..84ff92257 100644
--- a/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_fc.py
+++ b/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_fc.py
@@ -108,6 +108,7 @@ class PowerMaxFCTest(test.TestCase):
'data': {'target_lun': self.data.fc_device_info['hostlunid'],
'target_discovered': True,
'target_wwn': [],
+ 'discard': True,
'initiator_target_map': {}}}
data = self.driver.populate_data(self.data.fc_device_info,
self.data.test_volume,
diff --git a/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_iscsi.py b/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_iscsi.py
index 663a75100..5025e7610 100644
--- a/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_iscsi.py
+++ b/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_iscsi.py
@@ -155,6 +155,7 @@ class PowerMaxISCSITest(test.TestCase):
'target_iqn': ip_and_iqn[0]['iqn'].split(',')[0],
'target_portal': ip_and_iqn[0]['ip'] + ':3260',
'target_lun': host_lun_id,
+ 'discard': True,
'volume_id': self.data.test_volume.id}
iscsi_properties = self.driver.vmax_get_iscsi_properties(
self.data.array, vol, ip_and_iqn, True, host_lun_id, [], None)
@@ -271,6 +272,7 @@ class PowerMaxISCSITest(test.TestCase):
'target_iqn': ip_and_iqn[0]['iqn'].split(',')[0],
'target_portal': ip_and_iqn[0]['ip'] + ':3260',
'target_lun': host_lun_id,
+ 'discard': True,
'volume_id': self.data.test_volume.id}
iscsi_properties = self.driver.vmax_get_iscsi_properties(
self.data.array, self.data.test_volume, ip_and_iqn, True,
diff --git a/cinder/volume/drivers/dell_emc/powerflex/driver.py b/cinder/volume/drivers/dell_emc/powerflex/driver.py
index 7989af246..0dc06ee63 100644
--- a/cinder/volume/drivers/dell_emc/powerflex/driver.py
+++ b/cinder/volume/drivers/dell_emc/powerflex/driver.py
@@ -94,9 +94,10 @@ class PowerFlexDriver(driver.VolumeDriver):
3.5.5 - Rebrand VxFlex OS to PowerFlex.
3.5.6 - Fix for Bug #1897598 when volume can be migrated without
conversion of its type.
+ 3.5.7 - Report trim/discard support.
"""
- VERSION = "3.5.6"
+ VERSION = "3.5.7"
# ThirdPartySystems wiki
CI_WIKI_NAME = "DellEMC_PowerFlex_CI"
@@ -839,7 +840,14 @@ class PowerFlexDriver(driver.VolumeDriver):
self._get_client().remove_volume(snapshot.provider_id)
def initialize_connection(self, volume, connector, **kwargs):
- return self._initialize_connection(volume, connector, volume.size)
+ res = self._initialize_connection(volume, connector, volume.size)
+
+ # TODO: Should probably be enabled for SSDs as well
+ # It is recommended not to trim volumes that contain snapshots as the
+ # logical capacity may not shrink.
+ if self.provisioning_type == 'thin' and not len(volume.snapshots):
+ res['data']['discard'] = True
+ return res
def _initialize_connection(self, vol_or_snap, connector, vol_size):
"""Initialize connection and return connection info.
@@ -1026,6 +1034,8 @@ class PowerFlexDriver(driver.VolumeDriver):
"prov": backend_provisioned_capacity,
})
stats["pools"] = pools
+ # TODO: Should probably be enabled for SSDs as well
+ stats['sparse_copy_volume'] = self.provisioning_type == 'thin'
self._stats = stats
def _query_pool_stats(self, domain_name, pool_name):
diff --git a/cinder/volume/drivers/dell_emc/powermax/common.py b/cinder/volume/drivers/dell_emc/powermax/common.py
index 3e4543a1f..b8fbff5c6 100644
--- a/cinder/volume/drivers/dell_emc/powermax/common.py
+++ b/cinder/volume/drivers/dell_emc/powermax/common.py
@@ -1424,6 +1424,7 @@ class PowerMaxCommon(object):
'reserved_percentage': 0,
'replication_enabled': self.replication_enabled,
'replication_targets': self.replication_targets,
+ 'sparse_copy_volume': True,
'pools': pools}
return data
diff --git a/cinder/volume/drivers/dell_emc/powermax/fc.py b/cinder/volume/drivers/dell_emc/powermax/fc.py
index f477bd3e0..d7c9c41f4 100644
--- a/cinder/volume/drivers/dell_emc/powermax/fc.py
+++ b/cinder/volume/drivers/dell_emc/powermax/fc.py
@@ -130,9 +130,10 @@ class PowerMaxFCDriver(san.SanDriver, driver.FibreChannelDriver):
- Use of snap id instead of generation (bp powermax-snapset-ids)
- Support for Failover Abilities (bp/powermax-failover-abilities)
4.4.0 - Early check for status of port
+ 4.4.1 - Report trim/discard support
"""
- VERSION = "4.4.0"
+ VERSION = "4.4.1"
# ThirdPartySystems wiki
CI_WIKI_NAME = "DellEMC_PowerMAX_CI"
@@ -310,6 +311,7 @@ class PowerMaxFCDriver(san.SanDriver, driver.FibreChannelDriver):
'data': {'target_lun': device_number,
'target_discovered': True,
'target_wwn': target_wwns,
+ 'discard': True,
'initiator_target_map': init_targ_map}}
LOG.debug("Return FC data for zone addition: %(data)s.",
diff --git a/cinder/volume/drivers/dell_emc/powermax/iscsi.py b/cinder/volume/drivers/dell_emc/powermax/iscsi.py
index 21e9ab537..791b84a6d 100644
--- a/cinder/volume/drivers/dell_emc/powermax/iscsi.py
+++ b/cinder/volume/drivers/dell_emc/powermax/iscsi.py
@@ -136,9 +136,10 @@ class PowerMaxISCSIDriver(san.SanISCSIDriver):
- Use of snap id instead of generation (bp powermax-snapset-ids)
- Support for Failover Abilities (bp/powermax-failover-abilities)
4.4.0 - Early check for status of port
+ 4.4.1 - Report trim/discard support
"""
- VERSION = "4.4.0"
+ VERSION = "4.4.1"
# ThirdPartySystems wiki
CI_WIKI_NAME = "DellEMC_PowerMAX_CI"
@@ -421,6 +422,7 @@ class PowerMaxISCSIDriver(san.SanISCSIDriver):
properties['target_discovered'] = True
properties['target_lun'] = host_lun_id
properties['volume_id'] = volume.id
+ properties['discard'] = True
if self.configuration.safe_get('use_chap_auth'):
LOG.info("Chap authentication enabled.")
diff --git a/cinder/volume/drivers/dell_emc/powerstore/adapter.py b/cinder/volume/drivers/dell_emc/powerstore/adapter.py
index 343e12a2e..178f5f236 100644
--- a/cinder/volume/drivers/dell_emc/powerstore/adapter.py
+++ b/cinder/volume/drivers/dell_emc/powerstore/adapter.py
@@ -294,6 +294,7 @@ class CommonAdapter(object):
"compression_support": True,
"multiattach": True,
"consistent_group_snapshot_enabled": True,
+ "sparse_copy_volume": True,
}
backend_stats = self.client.get_metrics()
backend_total_capacity = utils.bytes_to_gib(
@@ -1056,6 +1057,7 @@ class FibreChannelAdapter(CommonAdapter):
"target_discovered": False,
"target_lun": volume_lun,
"target_wwn": target_wwns,
+ "discard": True,
}
}
diff --git a/cinder/volume/drivers/dell_emc/powerstore/driver.py b/cinder/volume/drivers/dell_emc/powerstore/driver.py
index 56eb18314..0a8367232 100644
--- a/cinder/volume/drivers/dell_emc/powerstore/driver.py
+++ b/cinder/volume/drivers/dell_emc/powerstore/driver.py
@@ -50,9 +50,10 @@ class PowerStoreDriver(driver.VolumeDriver):
1.1.2 - Fix iSCSI targets not being returned from the REST API call if
targets are used for multiple purposes
(iSCSI target, Replication target, etc.)
+ 1.1.3 - Report trim/discard support
"""
- VERSION = "1.1.2"
+ VERSION = "1.1.3"
VENDOR = "Dell EMC"
# ThirdPartySystems wiki page
diff --git a/releasenotes/notes/demc-trim-bb2165f74a5703a6.yaml b/releasenotes/notes/demc-trim-bb2165f74a5703a6.yaml
new file mode 100644
index 000000000..9f6807859
--- /dev/null
+++ b/releasenotes/notes/demc-trim-bb2165f74a5703a6.yaml
@@ -0,0 +1,13 @@
+---
+features:
+ - |
+ Dell EMC PowerStore driver: Report trimming/discard support to Nova and
+ Cinder.
+ - |
+ Dell EMC PowerMax driver: Report trimming/discard support to Nova and
+ Cinder.
+ - |
+ Dell EMC PowerFlex driver: Report trimming/discard support to Nova and
+ Cinder on thin volumes that don't have snapshots. Not doing trim on
+ volumes with snapshots is the vendor's recommendation, but can be overriden
+ with the ``report_discard_supported`` configuration option.