Lee Yarwood has uploaded a new change for review.
Change subject: blockSD: Ensure active volumes are refreshed before use.
......................................................................
blockSD: Ensure active volumes are refreshed before use.
At present we trust that active LVs represent the current state of a
given LV. This may not be the case if the LV has been modified
(extended, recreated etc) by another host while the LV is active on
the current host.
This change forces active non-special LVs to be refresh before use.
Change-Id: If3058cded234500e01939e50b2485afebd7087a3
Signed-off-by: Lee Yarwood <lyarwood(a)redhat.com>
---
M vdsm/storage/blockSD.py
1 file changed, 11 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/87/21387/1
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index d27f331..7d296b7 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -1059,14 +1059,23 @@
def activateVolumes(self, imgUUID, volUUIDs):
"""
- Activate all the volumes belonging to the image.
+ Activate all the volumes belonging to the image. Refresh any active
+ volumes that belong to the image as long as they are not special.
- imgUUID: the image to be deactivated.
+ imgUUID: the image to be activated.
allVols: getAllVolumes result.
If the image is based on a template image it will be activated.
"""
+ toRefresh = [ vol for vol in volUUIDs if vol not in SPECIAL_LVS and
+ lvm.isLVActive(self.sdUUID, vol)]
lvm.activateLVs(self.sdUUID, volUUIDs)
+
+ if toRefresh:
+ log.warning("The following volumes are already active and will be"
+ " refreshed before use : %s", toRefresh)
+ lvm.refreshLVs(self.sdUUID, toRefresh)
+
vgDir = os.path.join("/dev", self.sdUUID)
return self.createImageLinks(vgDir, imgUUID, volUUIDs)
--
To view, visit
http://gerrit.ovirt.org/21387
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If3058cded234500e01939e50b2485afebd7087a3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Lee Yarwood <lyarwood(a)redhat.com>