Skip to content

Commit

Permalink
Fix inability to delete volumes in error state for NetApp driver
Browse files Browse the repository at this point in the history
While using NetApp 7-mode storage box to create volumes, if the volume
is not created on the storage box (possibly due to wrong/missing
options in cinder.conf file), the volume goes in error state, and when
one tries to delete the volume, an exception was raised which made
the volume go in error_deleting state, which is unrecoverable. This
commit quiesces that exception, resulting in successful removal of the
volume entry from the volume table.

Fixes bug 1090167

Change-Id: I0a25b71ad03e7f7acf58df3952e074ff164b82ff
  • Loading branch information
rushiagr committed Mar 18, 2013
1 parent db0595a commit 8e702a1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cinder/tests/test_netapp.py
Expand Up @@ -972,6 +972,9 @@ def test_create_destroy(self):
self.VOLUME_TYPE, self.VOLUME_SIZE)
self.driver._remove_destroy(self.VOLUME_NAME, self.PROJECT_ID)

def test_destroy_uncreated_volume(self):
self.driver._remove_destroy('fake-nonexistent-volume', self.PROJECT_ID)

def test_map_unmap(self):
self.driver._discover_luns()
self.driver._provision(self.VOLUME_NAME, None, self.PROJECT_ID,
Expand Down
8 changes: 7 additions & 1 deletion cinder/volume/netapp.py
Expand Up @@ -434,7 +434,13 @@ def _remove_destroy(self, name, project):
Remove the LUN from the dataset and destroy the actual LUN on the
storage system.
"""
lun = self._lookup_lun_for_volume(name, project)
try:
lun = self._lookup_lun_for_volume(name, project)
except exception.VolumeBackendAPIException:
msg = _("No entry in LUN table for volume %s.")
LOG.info(msg % name)
return

member = self.client.factory.create('DatasetMemberParameter')
member.ObjectNameOrId = lun.id
members = self.client.factory.create('ArrayOfDatasetMemberParameter')
Expand Down

0 comments on commit 8e702a1

Please sign in to comment.