Change in vdsm[master]: lvm: Update hsm.__processVGInfos() with lvm.getPV() new API

ishaby at redhat.com ishaby at redhat.com
Thu Mar 5 15:31:33 UTC 2015


Idan Shaby has uploaded a new change for review.

Change subject: lvm: Update hsm.__processVGInfos() with lvm.getPV() new API
......................................................................

lvm: Update hsm.__processVGInfos() with lvm.getPV() new API

In change I9932b044c (lvm: Raise an exception if missing physical
volume), we changed lvm.getPV() to raise an InaccessiblePhysDev
exception when the device is no longer in lvm's cache.

This patch updates hsm.__processVGInfos() to log a warning in such a
case since if we called lvm.getPV() with a device that is no longer in
lvm's cache, we still want to get the information for the other PVs.
That is, we don't want to stop hsm.__processVGInfos() operation.

Note that blovkSD.getMetaDataMapping() also calls lvm.getPV(), but in
contrast to hsm.__processVGInfos(), we don't want
blovkSD.getMetaDataMapping() to handle InaccessiblePhysDev because it's
a part of a scenario that creates a storage domain, and we want to fail
the whole operation in case that the PV is no longer in lvm's cache.

Change-Id: I583c0493093d2c9c8bca8713df8ee123c415de7f
Bug-Url: https://bugzilla.redhat.com/1048696
Signed-off-by: Idan Shaby <ishaby at redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/21/38421/1

diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index b92349c..bbc0f84 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3000,7 +3000,11 @@
                       vgType != dev["devtype"]):
                     vgType = multipath.DEV_MIXED
 
-                pvInfo = lvm.getPV(pv)
+                try:
+                    pvInfo = lvm.getPV(pv)
+                except se.InaccessiblePhysDev:
+                    self.log.error("PV %s no longer exists", pv)
+                    continue
                 vgInfo['pvlist'].append(self.__fillPVDict(dev, pvInfo, vgType))
 
             if vgType == multipath.DEV_FCP:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I583c0493093d2c9c8bca8713df8ee123c415de7f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Idan Shaby <ishaby at redhat.com>


More information about the vdsm-patches mailing list