EMC VMAX Create CG from CG Snapshot

This patch adds support for create CG from CG snapshot
in the VMAX driver.

implements blueprint emc-vmax-create-cg-from-cgsnapshot
Change-Id: Iab13167382ceebbc6eaa165c431c5a09796ce3e9
This commit is contained in:
Xing Yang
2015-08-13 09:15:33 -04:00
parent 5a47eecd0e
commit 93974f845d
5 changed files with 246 additions and 5 deletions

View File

@@ -2259,3 +2259,27 @@ class EMCVMAXUtils(object):
{'source': sourceDeviceId, 'storageSystem': storageSystem})
return foundSyncInstanceName
def get_volume_model_updates(
self, context, db, cgId, status='available'):
"""Update the volume model's status and return it.
:param context: the context
:param db: cinder database
:param cgId: cg id
:param status: string value reflects the status of the member volume
:returns: volume_model_updates - updated volumes
"""
volume_model_updates = []
volumes = db.volume_get_all_by_group(context, cgId)
LOG.info(_LI(
"Updating status for CG: %(id)s."),
{'id': cgId})
if volumes:
for volume in volumes:
volume_model_updates.append({'id': volume['id'],
'status': status})
else:
LOG.info(_LI("No volume found for CG: %(cg)s."),
{'cg': cgId})
return volume_model_updates