Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions xtremio.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,12 +746,12 @@ def create_cgsnapshot(self, context, cgsnapshot, snapshots):
snapshots = objects.SnapshotList().get_all_for_cgsnapshot(
context, cgsnapshot['id'])

snap_model_update = []
for snapshot in snapshots:
snapshot.status = 'available'

snap_model_update.append({'id': snapshot.id, 'status': 'available'})
model_update = {'status': 'available'}

return model_update, snapshots
return model_update, snap_model_update

def delete_cgsnapshot(self, context, cgsnapshot, snapshots):
"""Deletes a cgsnapshot."""
Expand Down Expand Up @@ -925,6 +925,19 @@ def _get_iscsi_properties(self, lunmap):
'target_luns': [lunmap['lun']] * len(portals)}
return properties

def terminate_connection(self, volume, connector, **kwargs):
(super(XtremIOISCSIDriver, self)
.terminate_connection(volume, connector, **kwargs))
num_vols = (self.client
.num_of_mapped_volumes(self._get_ig_name(connector)))
if num_vols > 0:
return
else:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be simpler
if num_vols == 0:
...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but if we want to delete the initiator group, there is no other way but send the request to XMS.
It is not an error issue but how XtremIO driver should work.
By the way other storage vendor working like this, this is why I think that we should also work as so. Users maybe use multiple backend storage and keep all the storage have the same work will be friendly to user.

igName = self._get_ig_name(connector)
# delete the initiator group
self.client.req('initiator-groups', 'DELETE', name=igName, ver='v2')
LOG.debug('Deleted initiator group: %s', igName)

def _get_initiator_names(self, connector):
return [connector['initiator']]

Expand Down