Add cinder discard in nimble driver

Change-Id: Ic4296d26be7db01c29ba4a4f47590cbef778ac48
This commit is contained in:
Ajitha Robert 2020-06-22 15:53:41 +05:30
parent 013035a038
commit c354d5bd04
3 changed files with 12 additions and 2 deletions

View File

@ -1153,6 +1153,7 @@ class NimbleDriverConnectionTestCase(NimbleDriverBaseTestCase):
'driver_volume_type': 'iscsi',
'data': {
'target_discovered': False,
'discard': True,
'volume_id': 12,
'target_iqn': '13',
'target_lun': 0,
@ -1186,6 +1187,7 @@ class NimbleDriverConnectionTestCase(NimbleDriverBaseTestCase):
'driver_volume_type': 'iscsi',
'data': {
'target_discovered': False,
'discard': True,
'volume_id': 12,
'target_iqns': ['group_target_name', 'group_target_name'],
'target_luns': [0, 0],
@ -1211,6 +1213,7 @@ class NimbleDriverConnectionTestCase(NimbleDriverBaseTestCase):
'driver_volume_type': 'iscsi',
'data': {
'target_discovered': False,
'discard': True,
'volume_id': 12,
'target_iqn': '13',
'target_lun': 0,
@ -1264,6 +1267,7 @@ class NimbleDriverConnectionTestCase(NimbleDriverBaseTestCase):
'data': {
'target_lun': 13,
'target_discovered': True,
'discard': True,
'target_wwn': ["1111111111111101"],
'initiator_target_map': {'1000000000000000':
['1111111111111101']}}}
@ -1291,6 +1295,7 @@ class NimbleDriverConnectionTestCase(NimbleDriverBaseTestCase):
'driver_volume_type': 'iscsi',
'data': {
'target_discovered': False,
'discard': True,
'target_lun': 0,
'volume_id': 12,
'target_iqn': '13',
@ -1325,6 +1330,7 @@ class NimbleDriverConnectionTestCase(NimbleDriverBaseTestCase):
'data': {
'target_lun': 13,
'target_discovered': True,
'discard': True,
'target_wwn': ["1111111111111101"],
'initiator_target_map': {'1000000000000000':
['1111111111111101']}}}

View File

@ -761,8 +761,7 @@ class NimbleISCSIDriver(NimbleBaseVolumeDriver, san.SanISCSIDriver):
{'grp': initiator_group_name, 'iname': initiator_name})
self.APIExecutor.add_acl(volume, initiator_group_name)
properties = {"driver_volume_type": "iscsi",
"data": {"target_discovered": False},
}
"data": {"target_discovered": False, "discard": True}}
properties['data']['volume_id'] = volume['id'] # used by xen currently
(iscsi_portal, iqn) = volume['provider_location'].split()
if self._get_gst_for_group() is not None:
@ -975,6 +974,7 @@ class NimbleFCDriver(NimbleBaseVolumeDriver, driver.FibreChannelDriver):
data = {'driver_volume_type': 'fibre_channel',
'data': {'target_lun': lun,
'target_discovered': True,
'discard': True,
'target_wwn': target_wwns,
'initiator_target_map': init_targ_map}}

View File

@ -0,0 +1,4 @@
---
features:
- |
Nimble driver now supports discard.