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
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,
Remove the LUN from the dataset and destroy the actual LUN and Qtree
on the storage system.
"""
- lun = self._lookup_lun_for_volume(name, project)
- lun_details = self._get_lun_details(lun.id)
+ try:
+ lun = self._lookup_lun_for_volume(name, project)
+ lun_details = self._get_lun_details(lun.id)
+ except exception.VolumeBackendAPIException:
+ msg = _("No entry in LUN table for volume %(name)s.")
+ LOG.debug(msg % locals())
+ return
+
member = self.client.factory.create('DatasetMemberParameter')
member.ObjectNameOrId = lun.id
members = self.client.factory.create('ArrayOfDatasetMemberParameter')