Skip to content

Commit 3a05d46

Browse files
committed
Release 2.2.RC1
1 parent 66066e7 commit 3a05d46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+4362
-221
lines changed

Cinder/Ocata/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
SNAPSHOT_TYPE = '27'
2727

2828
BLOCK_STORAGE_POOL_TYPE = '1'
29+
DORADO_V6_POOL_TYPE = '0'
2930
FILE_SYSTEM_POOL_TYPE = '2'
3031

3132
HOSTGROUP_PREFIX = 'OpenStack_HostGroup_'

Cinder/Ocata/huawei_conf.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def update_config_value(self):
8282
self._lun_write_type,
8383
self._lun_prefetch,
8484
self._storage_pools,
85+
self._force_delete_volume,
8586
self._iscsi_default_target_ip,
8687
self._iscsi_info,
8788
self._fc_info,
@@ -327,6 +328,20 @@ def _storage_pools(self, xml_root):
327328

328329
setattr(self.conf, 'storage_pools', list(pools))
329330

331+
def _force_delete_volume(self, xml_root):
332+
force_delete_volume = False
333+
text = xml_root.findtext('LUN/ForceDeleteVolume')
334+
if text:
335+
if text.lower().strip() in ('true', 'false'):
336+
if text.lower().strip() == 'true':
337+
force_delete_volume = True
338+
else:
339+
msg = _("ForceDeleteVolume configured error, "
340+
"ForceDeleteVolume is %s.") % text
341+
LOG.error(msg)
342+
raise exception.InvalidInput(reason=msg)
343+
setattr(self.conf, 'force_delete_volume', force_delete_volume)
344+
330345
def _iscsi_default_target_ip(self, xml_root):
331346
text = xml_root.findtext('iSCSI/DefaultTargetIP')
332347
target_ip = text.split() if text else []

Cinder/Ocata/huawei_driver.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -758,9 +758,9 @@ def _delete_volume(self, volume, lun_id=None):
758758
if not lun_id:
759759
return
760760

761-
lun_group_ids = self.client.get_lungroupids_by_lunid(lun_id)
762-
if lun_group_ids and len(lun_group_ids) == 1:
763-
self.client.remove_lun_from_lungroup(lun_group_ids[0], lun_id)
761+
huawei_utils.remove_lun_from_lungroup(
762+
self.client, lun_id,
763+
self.configuration.force_delete_volume)
764764

765765
self.client.delete_lun(lun_id)
766766

@@ -770,10 +770,9 @@ def _remove_remote_lun_from_lungroup(self, volume):
770770
if not rmt_lun_id:
771771
return
772772

773-
lun_group_ids = self.rmt_client.get_lungroupids_by_lunid(rmt_lun_id)
774-
if lun_group_ids and len(lun_group_ids) == 1:
775-
self.rmt_client.remove_lun_from_lungroup(
776-
lun_group_ids[0], rmt_lun_id)
773+
huawei_utils.remove_lun_from_lungroup(
774+
self.rmt_client, rmt_lun_id,
775+
self.configuration.force_delete_volume)
777776

778777
def delete_volume(self, volume):
779778
"""Delete a volume.
@@ -2614,9 +2613,10 @@ class HuaweiISCSIDriver(HuaweiBaseDriver, driver.ISCSIDriver):
26142613
Cgsnapshot support
26152614
2.0.8 - Backup snapshot optimal path support
26162615
2.0.9 - Support reporting disk type of pool
2616+
2.2.RC1 - Add force delete volume
26172617
"""
26182618

2619-
VERSION = "2.0.9"
2619+
VERSION = "2.2.RC1"
26202620

26212621
def __init__(self, *args, **kwargs):
26222622
super(HuaweiISCSIDriver, self).__init__(*args, **kwargs)
@@ -2822,17 +2822,14 @@ def _terminate_connection(self, volume, connector, local=True):
28222822
portgroup_id = None
28232823
view_id = None
28242824
left_lunnum = -1
2825-
portgroup = client.find_portgroup_info(
2826-
initiator_name, host_name)
28272825

2828-
if portgroup:
2829-
portgroup_id = client.get_tgt_port_group(portgroup)
28302826
host_id = huawei_utils.get_host_id(client, host_name)
28312827
if host_id:
28322828
mapping_view_name = constants.MAPPING_VIEW_PREFIX + host_id
28332829
view_id = client.find_mapping_view(mapping_view_name)
28342830
if view_id:
28352831
lungroup_id = client.find_lungroup_from_map(view_id)
2832+
portgroup_id = client.get_portgroup_by_view(view_id)
28362833

28372834
# Remove lun from lungroup.
28382835
if lun_id and lungroup_id:
@@ -2897,9 +2894,10 @@ class HuaweiFCDriver(HuaweiBaseDriver, driver.FibreChannelDriver):
28972894
Cgsnapshot support
28982895
2.0.8 - Backup snapshot optimal path support
28992896
2.0.9 - Support reporting disk type of pool
2897+
2.2.RC1 - Add force delete volume
29002898
"""
29012899

2902-
VERSION = "2.0.9"
2900+
VERSION = "2.2.RC1"
29032901

29042902
def __init__(self, *args, **kwargs):
29052903
super(HuaweiFCDriver, self).__init__(*args, **kwargs)

Cinder/Ocata/huawei_utils.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,3 +255,15 @@ def is_support_clone_pair(client):
255255
version_info = array_info['PRODUCTVERSION']
256256
if version_info >= constants.SUPPORT_CLONE_PAIR_VERSION:
257257
return True
258+
259+
260+
def remove_lun_from_lungroup(client, lun_id, force_delete_volume):
261+
lun_group_ids = client.get_lungroupids_by_lunid(lun_id)
262+
if lun_group_ids:
263+
if force_delete_volume:
264+
for lun_group_id in lun_group_ids:
265+
client.remove_lun_from_lungroup(lun_group_id, lun_id,
266+
constants.LUN_TYPE)
267+
elif len(lun_group_ids) == 1:
268+
client.remove_lun_from_lungroup(lun_group_ids[0], lun_id,
269+
constants.LUN_TYPE)

Cinder/Ocata/replication.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,8 @@ def _delete_pair(self, pair_id):
845845

846846
def _delete_rmt_lun(self, lun_id):
847847
if lun_id and self.rmt_client.check_lun_exist(lun_id):
848+
huawei_utils.remove_lun_from_lungroup(
849+
self.rmt_client, lun_id, self.conf.force_delete_volume)
848850
self.rmt_client.delete_lun(lun_id)
849851

850852
def delete_replica(self, volume, replication_driver_data=None):

Cinder/Ocata/rest_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,8 @@ def check_storage_pools(self):
13891389
s_pools = []
13901390
for pool in result:
13911391
if 'USAGETYPE' in pool:
1392-
if pool['USAGETYPE'] == constants.BLOCK_STORAGE_POOL_TYPE:
1392+
if pool['USAGETYPE'] in (constants.BLOCK_STORAGE_POOL_TYPE,
1393+
constants.DORADO_V6_POOL_TYPE):
13931394
s_pools.append(pool['NAME'])
13941395
else:
13951396
s_pools.append(pool['NAME'])

Cinder/Pike/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
SNAPSHOT_TYPE = '27'
2727

2828
BLOCK_STORAGE_POOL_TYPE = '1'
29+
DORADO_V6_POOL_TYPE = '0'
2930
FILE_SYSTEM_POOL_TYPE = '2'
3031

3132
HOSTGROUP_PREFIX = 'OpenStack_HostGroup_'

Cinder/Pike/huawei_conf.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def update_config_value(self):
8282
self._lun_write_type,
8383
self._lun_prefetch,
8484
self._storage_pools,
85+
self._force_delete_volume,
8586
self._iscsi_default_target_ip,
8687
self._iscsi_info,
8788
self._fc_info,
@@ -327,6 +328,20 @@ def _storage_pools(self, xml_root):
327328

328329
setattr(self.conf, 'storage_pools', list(pools))
329330

331+
def _force_delete_volume(self, xml_root):
332+
force_delete_volume = False
333+
text = xml_root.findtext('LUN/ForceDeleteVolume')
334+
if text:
335+
if text.lower().strip() in ('true', 'false'):
336+
if text.lower().strip() == 'true':
337+
force_delete_volume = True
338+
else:
339+
msg = _("ForceDeleteVolume configured error, "
340+
"ForceDeleteVolume is %s.") % text
341+
LOG.error(msg)
342+
raise exception.InvalidInput(reason=msg)
343+
setattr(self.conf, 'force_delete_volume', force_delete_volume)
344+
330345
def _iscsi_default_target_ip(self, xml_root):
331346
text = xml_root.findtext('iSCSI/DefaultTargetIP')
332347
target_ip = text.split() if text else []

Cinder/Pike/huawei_driver.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -757,9 +757,9 @@ def _delete_volume(self, volume, lun_id=None):
757757
if not lun_id:
758758
return
759759

760-
lun_group_ids = self.client.get_lungroupids_by_lunid(lun_id)
761-
if lun_group_ids and len(lun_group_ids) == 1:
762-
self.client.remove_lun_from_lungroup(lun_group_ids[0], lun_id)
760+
huawei_utils.remove_lun_from_lungroup(
761+
self.client, lun_id,
762+
self.configuration.force_delete_volume)
763763

764764
self.client.delete_lun(lun_id)
765765

@@ -769,10 +769,9 @@ def _remove_remote_lun_from_lungroup(self, volume):
769769
if not rmt_lun_id:
770770
return
771771

772-
lun_group_ids = self.rmt_client.get_lungroupids_by_lunid(rmt_lun_id)
773-
if lun_group_ids and len(lun_group_ids) == 1:
774-
self.rmt_client.remove_lun_from_lungroup(
775-
lun_group_ids[0], rmt_lun_id)
772+
huawei_utils.remove_lun_from_lungroup(
773+
self.rmt_client, rmt_lun_id,
774+
self.configuration.force_delete_volume)
776775

777776
def delete_volume(self, volume):
778777
"""Delete a volume.
@@ -2623,9 +2622,10 @@ class HuaweiISCSIDriver(HuaweiBaseDriver, driver.ISCSIDriver):
26232622
Cgsnapshot support
26242623
2.0.8 - Backup snapshot optimal path support
26252624
2.0.9 - Support reporting disk type of pool
2625+
2.2.RC1 - Add force delete volume
26262626
"""
26272627

2628-
VERSION = "2.0.9"
2628+
VERSION = "2.2.RC1"
26292629

26302630
def __init__(self, *args, **kwargs):
26312631
super(HuaweiISCSIDriver, self).__init__(*args, **kwargs)
@@ -2838,17 +2838,14 @@ def _terminate_connection(self, volume, connector, local=True):
28382838
portgroup_id = None
28392839
view_id = None
28402840
left_lunnum = -1
2841-
portgroup = client.find_portgroup_info(
2842-
initiator_name, host_name)
28432841

2844-
if portgroup:
2845-
portgroup_id = client.get_tgt_port_group(portgroup)
28462842
host_id = huawei_utils.get_host_id(client, host_name)
28472843
if host_id:
28482844
mapping_view_name = constants.MAPPING_VIEW_PREFIX + host_id
28492845
view_id = client.find_mapping_view(mapping_view_name)
28502846
if view_id:
28512847
lungroup_id = client.find_lungroup_from_map(view_id)
2848+
portgroup_id = client.get_portgroup_by_view(view_id)
28522849

28532850
# Remove lun from lungroup.
28542851
if lun_id and lungroup_id:
@@ -2913,9 +2910,10 @@ class HuaweiFCDriver(HuaweiBaseDriver, driver.FibreChannelDriver):
29132910
Cgsnapshot support
29142911
2.0.8 - Backup snapshot optimal path support
29152912
2.0.9 - Support reporting disk type of pool
2913+
2.2.RC1 - Add force delete volume
29162914
"""
29172915

2918-
VERSION = "2.0.9"
2916+
VERSION = "2.2.RC1"
29192917

29202918
def __init__(self, *args, **kwargs):
29212919
super(HuaweiFCDriver, self).__init__(*args, **kwargs)

Cinder/Pike/huawei_utils.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,3 +255,15 @@ def is_support_clone_pair(client):
255255
version_info = array_info['PRODUCTVERSION']
256256
if version_info >= constants.SUPPORT_CLONE_PAIR_VERSION:
257257
return True
258+
259+
260+
def remove_lun_from_lungroup(client, lun_id, force_delete_volume):
261+
lun_group_ids = client.get_lungroupids_by_lunid(lun_id)
262+
if lun_group_ids:
263+
if force_delete_volume:
264+
for lun_group_id in lun_group_ids:
265+
client.remove_lun_from_lungroup(lun_group_id, lun_id,
266+
constants.LUN_TYPE)
267+
elif len(lun_group_ids) == 1:
268+
client.remove_lun_from_lungroup(lun_group_ids[0], lun_id,
269+
constants.LUN_TYPE)

Cinder/Pike/replication.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,8 @@ def _delete_pair(self, pair_id):
841841

842842
def _delete_rmt_lun(self, lun_id):
843843
if lun_id and self.rmt_client.check_lun_exist(lun_id):
844+
huawei_utils.remove_lun_from_lungroup(
845+
self.rmt_client, lun_id, self.conf.force_delete_volume)
844846
self.rmt_client.delete_lun(lun_id)
845847

846848
def delete_replica(self, volume, replication_driver_data=None):

Cinder/Pike/rest_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,8 @@ def check_storage_pools(self):
13841384
s_pools = []
13851385
for pool in result:
13861386
if 'USAGETYPE' in pool:
1387-
if pool['USAGETYPE'] == constants.BLOCK_STORAGE_POOL_TYPE:
1387+
if pool['USAGETYPE'] in (constants.BLOCK_STORAGE_POOL_TYPE,
1388+
constants.DORADO_V6_POOL_TYPE):
13881389
s_pools.append(pool['NAME'])
13891390
else:
13901391
s_pools.append(pool['NAME'])

Cinder/Queens/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
SNAPSHOT_TYPE = '27'
2727

2828
BLOCK_STORAGE_POOL_TYPE = '1'
29+
DORADO_V6_POOL_TYPE = '0'
2930
FILE_SYSTEM_POOL_TYPE = '2'
3031

3132
HOSTGROUP_PREFIX = 'OpenStack_HostGroup_'

Cinder/Queens/huawei_conf.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def update_config_value(self):
8282
self._lun_write_type,
8383
self._lun_prefetch,
8484
self._storage_pools,
85+
self._force_delete_volume,
8586
self._iscsi_default_target_ip,
8687
self._iscsi_info,
8788
self._fc_info,
@@ -327,6 +328,20 @@ def _storage_pools(self, xml_root):
327328

328329
setattr(self.conf, 'storage_pools', list(pools))
329330

331+
def _force_delete_volume(self, xml_root):
332+
force_delete_volume = False
333+
text = xml_root.findtext('LUN/ForceDeleteVolume')
334+
if text:
335+
if text.lower().strip() in ('true', 'false'):
336+
if text.lower().strip() == 'true':
337+
force_delete_volume = True
338+
else:
339+
msg = _("ForceDeleteVolume configured error, "
340+
"ForceDeleteVolume is %s.") % text
341+
LOG.error(msg)
342+
raise exception.InvalidInput(reason=msg)
343+
setattr(self.conf, 'force_delete_volume', force_delete_volume)
344+
330345
def _iscsi_default_target_ip(self, xml_root):
331346
text = xml_root.findtext('iSCSI/DefaultTargetIP')
332347
target_ip = text.split() if text else []

Cinder/Queens/huawei_driver.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -757,9 +757,9 @@ def _delete_volume(self, volume, lun_id=None):
757757
if not lun_id:
758758
return
759759

760-
lun_group_ids = self.client.get_lungroupids_by_lunid(lun_id)
761-
if lun_group_ids and len(lun_group_ids) == 1:
762-
self.client.remove_lun_from_lungroup(lun_group_ids[0], lun_id)
760+
huawei_utils.remove_lun_from_lungroup(
761+
self.client, lun_id,
762+
self.configuration.force_delete_volume)
763763

764764
self.client.delete_lun(lun_id)
765765

@@ -769,10 +769,9 @@ def _remove_remote_lun_from_lungroup(self, volume):
769769
if not rmt_lun_id:
770770
return
771771

772-
lun_group_ids = self.rmt_client.get_lungroupids_by_lunid(rmt_lun_id)
773-
if lun_group_ids and len(lun_group_ids) == 1:
774-
self.rmt_client.remove_lun_from_lungroup(
775-
lun_group_ids[0], rmt_lun_id)
772+
huawei_utils.remove_lun_from_lungroup(
773+
self.rmt_client, rmt_lun_id,
774+
self.configuration.force_delete_volume)
776775

777776
def delete_volume(self, volume):
778777
"""Delete a volume.
@@ -2623,9 +2622,10 @@ class HuaweiISCSIDriver(HuaweiBaseDriver, driver.ISCSIDriver):
26232622
Cgsnapshot support
26242623
2.0.8 - Backup snapshot optimal path support
26252624
2.0.9 - Support reporting disk type of pool
2625+
2.2.RC1 - Add force delete volume
26262626
"""
26272627

2628-
VERSION = "2.0.9"
2628+
VERSION = "2.2.RC1"
26292629

26302630
def __init__(self, *args, **kwargs):
26312631
super(HuaweiISCSIDriver, self).__init__(*args, **kwargs)
@@ -2838,17 +2838,14 @@ def _terminate_connection(self, volume, connector, local=True):
28382838
portgroup_id = None
28392839
view_id = None
28402840
left_lunnum = -1
2841-
portgroup = client.find_portgroup_info(
2842-
initiator_name, host_name)
28432841

2844-
if portgroup:
2845-
portgroup_id = client.get_tgt_port_group(portgroup)
28462842
host_id = huawei_utils.get_host_id(client, host_name)
28472843
if host_id:
28482844
mapping_view_name = constants.MAPPING_VIEW_PREFIX + host_id
28492845
view_id = client.find_mapping_view(mapping_view_name)
28502846
if view_id:
28512847
lungroup_id = client.find_lungroup_from_map(view_id)
2848+
portgroup_id = client.get_portgroup_by_view(view_id)
28522849

28532850
# Remove lun from lungroup.
28542851
if lun_id and lungroup_id:
@@ -2913,9 +2910,10 @@ class HuaweiFCDriver(HuaweiBaseDriver, driver.FibreChannelDriver):
29132910
Cgsnapshot support
29142911
2.0.8 - Backup snapshot optimal path support
29152912
2.0.9 - Support reporting disk type of pool
2913+
2.2.RC1 - Add force delete volume
29162914
"""
29172915

2918-
VERSION = "2.0.9"
2916+
VERSION = "2.2.RC1"
29192917

29202918
def __init__(self, *args, **kwargs):
29212919
super(HuaweiFCDriver, self).__init__(*args, **kwargs)

0 commit comments

Comments
 (0)