More validation logic for VNX CG creation
In VNX array, compressed LUNs cannot be added into a Consistency Group. VNX Cinder Driver should check the volume types. If storagetype:provisioning=compressed is specified, VNX Cinder Driver should reject the CG creation operation. When parsing group['volume_type_id'], the trailing comma should be considered. Change-Id: Ie683935f8aa03f04e0c353bdebadc0f410ada08e Closes-Bug: #1421163
This commit is contained in:
parent
d2af7faf2d
commit
876e891a8b
|
@ -318,7 +318,7 @@ class EMCVNXCLIDriverTestData():
|
|||
'status': 'creating',
|
||||
'volume_type_id':
|
||||
'abc1-2320-9013-8813-8941-1374-8112-1231,'
|
||||
'19fdd0dd-03b3-4d7c-b541-f4df46f308c8'}
|
||||
'19fdd0dd-03b3-4d7c-b541-f4df46f308c8,'}
|
||||
|
||||
test_cgsnapshot = {
|
||||
'consistencygroup_id': 'consistencygroup_id',
|
||||
|
|
|
@ -2163,13 +2163,15 @@ class EMCVnxCliBase(object):
|
|||
|
||||
if group.get('volume_type_id') is not None:
|
||||
for id in group['volume_type_id'].split(","):
|
||||
provisioning, tiering = self._get_extra_spec_value(
|
||||
volume_types.get_volume_type_extra_specs(id))
|
||||
if provisioning == 'compressed':
|
||||
msg = _("Failed to create consistency group %s "
|
||||
"because VNX consistency group cannot "
|
||||
"accept compressed LUNs as members.") % group['id']
|
||||
raise exception.VolumeBackendAPIException(data=msg)
|
||||
if id:
|
||||
provisioning, tiering = self._get_extra_spec_value(
|
||||
volume_types.get_volume_type_extra_specs(id))
|
||||
if provisioning == 'compressed':
|
||||
msg = _("Failed to create consistency group %s "
|
||||
"because VNX consistency group cannot "
|
||||
"accept compressed LUNs as members."
|
||||
) % group['id']
|
||||
raise exception.VolumeBackendAPIException(data=msg)
|
||||
|
||||
def create_consistencygroup(self, context, group):
|
||||
"""Creates a consistency group."""
|
||||
|
|
Loading…
Reference in New Issue