Ala Hino has uploaded a new change for review.

Change subject: Live Merge: teardown volume on HSM after live merge
......................................................................

Live Merge: teardown volume on HSM after live merge

If a VM is running on HSM and live merge is performed, the LV isn't
deactivated because, the deactivation is done when deleting the volume.
However, deleting the volume is done on SPM and this means that the LV
is not deactivated on the HSM. In this patch, a logic to teardown the
volume added after live merge has completed.

Change-Id: Iec3b6adb50293d8c98f5d8726d668eb272d16549
Bug-Url: https://bugzilla.redhat.com/1377849
Signed-off-by: Ala Hino <ah...@redhat.com>
---
M vdsm/storage/blockSD.py
M vdsm/storage/sd.py
M vdsm/virt/vm.py
3 files changed, 17 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/01/64301/1

diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 8ac7433..a538581 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -811,6 +811,9 @@
                   sd.LEASE_BLOCKS)
         return clusterlock.Lease(volUUID, self.getLeasesFilePath(), offset)
 
+    def teardownVolume(self, volUUID):
+        lvm.deactivateLVs(self.sdUUID, [volUUID])
+
 
 class BlockStorageDomain(sd.StorageDomain):
     manifestClass = BlockStorageDomainManifest
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index b5b902e..29dcf53 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -525,6 +525,13 @@
         if preallocate is not None and preallocate not in sc.VOL_TYPE:
             raise se.IncorrectType(preallocate)
 
+    def teardownVolume(self, volUUID):
+        """
+        By default, this method does nothing. It is overriden in blockSD
+        to do the necessary cleaning.
+        """
+        pass
+
 
 class StorageDomain(object):
     log = logging.getLogger("storage.StorageDomain")
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 1d9a3d5..7004615 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -65,6 +65,7 @@
 from vdsm.virt.utils import isVdsmImage, cleanup_guest_socket
 from storage import outOfProcess as oop
 from storage import sd
+from storage.sdc import sdCache
 
 # local imports
 # In future those should be imported via ..
@@ -4763,6 +4764,10 @@
                                self.drive.imageID, baseVolUUID,
                                topVolInfo['capacity'])
 
+    def teardownVolume(self, volUUID):
+        dom_manifest = sdCache.produce_manifest(self.drive.domainID)
+        dom_manifest.teardownVolume(volUUID)
+
     @utils.traceback()
     def run(self):
         self.update_base_size()
@@ -4776,6 +4781,8 @@
         self.success = True
         self.vm.log.info("Synchronization completed (job %s)",
                          self.job['jobID'])
+        # teardown the merged volume
+        self.teardownVolume(self.job['topVolume'])
 
     def isSuccessful(self):
         """


-- 
To view, visit https://gerrit.ovirt.org/64301
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec3b6adb50293d8c98f5d8726d668eb272d16549
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ala Hino <ah...@redhat.com>
_______________________________________________
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org

Reply via email to