[NEW PATCH] formatStorageDomain removes the VG too. (via gerrit-bot)

Dan Kenigsberg danken at redhat.com
Mon Aug 8 12:50:42 UTC 2011


New patch submitted by Dan Kenigsberg (danken at redhat.com)

You can review this change at: http://gerrit.usersys.redhat.com/659

commit eca2de38cc8624747e48a9a8fdb4ee0cf85b6a44
Author: Eduardo Warszawski <ewarszaw at redhat.com>
Date:   Tue Jul 5 15:32:53 2011 +0300

    formatStorageDomain removes the VG too.
    
    When removing a SD the VG should be removed too (atomicity).
    Actually this is what RHEV-M does. Therefore the functions
    split is redundant.
    The removeVG function is marked as DEPRECATED (to be removed).
    The VG is removed in this version in order to minimize the
    chance to remain with a VG thats not belongs to a SD.
    
    Change-Id: Ie993abd2a812f1ecec127cc637794994591e48ea

diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 2b9f455..6986f71 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -685,8 +685,7 @@ class BlockStorageDomain(sd.StorageDomain):
             except se.CannotRemoveLogicalVolume, e:
                 cls.log.warning("Remove logical volume failed %s/%s %s", sdUUID, lv.name, str(e))
 
-        # Remove SD tag
-        lvm.replaceVGTag(sdUUID, STORAGE_DOMAIN_TAG, STORAGE_UNREADY_DOMAIN_TAG)
+        lvm.removeVG(sdUUID)
         return True
 
     def getInfo(self):
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 42d5a5c..0c3e783 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -847,17 +847,20 @@ class HSM:
 
     def public_removeVG(self, vgUUID, options = None):
         """
+        DEPRECATED: formatSD effectively removes the VG.
+
         Removes a volume group.
 
         :param vgUUID: The UUID of the VG you want removed.
         :type vgUUID: UUID
         :param options: ?
-
-        :raises: :exc:`storage_exception.VolumeGroupDoesNotExist` if no VG with this UUID exists.
         """
         vars.task.setDefaultException(se.VolumeGroupActionError("%s" % str(vgUUID)))
         #getSharedLock(connectionsResource...)
-        lvm.removeVGbyUUID(vgUUID)
+        try:
+            lvm.removeVGbyUUID(vgUUID)
+        except se.VolumeGroupDoesNotExist:
+            pass
 
 
     def public_getTaskStatus(self, taskID, spUUID=None, options = None):




More information about the vdsm-patches mailing list