22161814 cinder can do 'stmfadm delete-lu' twice leaving volumes in error
authorQiang Strony Zhang <strony.zhang@oracle.com>
Thu, 19 Nov 2015 14:46:04 -0800
changeset 5112 8ba7598c0426
parent 5111 e68e059c3456
child 5113 d795801e09d0
22161814 cinder can do 'stmfadm delete-lu' twice leaving volumes in error
components/openstack/cinder/files/solaris/zfs.py
--- a/components/openstack/cinder/files/solaris/zfs.py	Thu Nov 19 14:13:43 2015 -0800
+++ b/components/openstack/cinder/files/solaris/zfs.py	Thu Nov 19 14:46:04 2015 -0800
@@ -608,12 +608,9 @@
         """
         luid = self._get_luid(volume)
 
-        # Remove the view entry
+        # Remove the LU
         if luid is not None:
-            view_lun = self._get_view_and_lun(luid)
-            if view_lun['view']:
-                self._stmf_execute('/usr/sbin/stmfadm', 'remove-view', '-l',
-                                   luid, view_lun['view'])
+            self._stmf_execute('/usr/sbin/stmfadm', 'delete-lu', luid)
 
         # Remove the target and its target group if they were created by
         # earlier versions of the volume driver
@@ -622,18 +619,12 @@
                                 volume['name'])
 
         if self._check_target(target_name, 'iSCSI'):
-            self._stmf_execute('/usr/sbin/stmfadm', 'offline-target',
-                               target_name)
             self._stmf_execute('/usr/sbin/itadm', 'delete-target', '-f',
                                target_name)
 
         if self._check_tg(target_group):
             self._stmf_execute('/usr/sbin/stmfadm', 'delete-tg', target_group)
 
-        # Remove the LU
-        if luid is not None:
-            self._stmf_execute('/usr/sbin/stmfadm', 'delete-lu', luid)
-
     def _get_iscsi_properties(self, volume):
         """Get iSCSI configuration