Browse Source

Merge "Add cinder discard in nimble driver"

changes/48/738148/1
Zuul 2 weeks ago
committed by Gerrit Code Review
parent
commit
51d2c7f9ec
3 changed files with 12 additions and 2 deletions
  1. +6
    -0
      cinder/tests/unit/volume/drivers/test_nimble.py
  2. +2
    -2
      cinder/volume/drivers/nimble.py
  3. +4
    -0
      releasenotes/notes/1884495-173f375dc5274fe6.yaml

+ 6
- 0
cinder/tests/unit/volume/drivers/test_nimble.py 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']}}}


+ 2
- 2
cinder/volume/drivers/nimble.py 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}}



+ 4
- 0
releasenotes/notes/1884495-173f375dc5274fe6.yaml View File

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

Loading…
Cancel
Save