Change in vdsm[master]: gluster: handle partition table corruption error

tjeyasin at redhat.com tjeyasin at redhat.com
Thu Jun 11 10:12:13 UTC 2015


Timothy Asir has uploaded a new change for review.

Change subject: gluster: handle partition table corruption error
......................................................................

gluster: handle partition table corruption error

Currently vdsm throws an exception if there is any corruption
in the partitition entry of any device and returns an error
for devices list and create brick. This path fixes this issue
by just loggin the issue and continue with remaining devices.

Change-Id: Iaeb3d42091b69f052ae93bbb114f9d3b9d158be4
Signed-off-by: Timothy Asir Jeyasingh <tjeyasin at redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1227781
---
M vdsm/gluster/storagedev.py
1 file changed, 17 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/10/42210/1

diff --git a/vdsm/gluster/storagedev.py b/vdsm/gluster/storagedev.py
index 583548b..8aac8ac 100644
--- a/vdsm/gluster/storagedev.py
+++ b/vdsm/gluster/storagedev.py
@@ -41,6 +41,7 @@
 
 
 log = logging.getLogger("Gluster")
+blivet.util.set_up_logging()
 _lvconvertCommandPath = utils.CommandPath("lvconvert",
                                           "/sbin/lvconvert",
                                           "/usr/sbin/lvconvert",)
@@ -110,7 +111,10 @@
 @makePublic
 def storageDevicesList():
     blivetEnv = blivet.Blivet()
-    blivetEnv.reset()
+    try:
+        blivetEnv.reset()
+    except blivet.errors.UnusableConfigurationError as e:
+        log.error("Error: %s" % e.message)
     return _parseDevices(blivetEnv.devices)
 
 
@@ -148,8 +152,10 @@
                 if rc:
                     raise ge.GlusterHostStorageDevicePVCreateFailedException(
                         dev.path, alignment, rc, out, err)
-
-            blivetEnv.reset()
+            try:
+                blivetEnv.reset()
+            except blivet.errors.UnusableConfigurationError as e:
+                log.error("Error: %s" % e.message)
             return _getDeviceList([dev.name for dev in deviceList])
 
         if alignment:
@@ -218,8 +224,10 @@
             if rc:
                 raise ge.GlusterHostStorageDeviceLVChangeFailedException(
                     vgPoolName, rc, out, err)
-
-            blivetEnv.reset()
+            try:
+                blivetEnv.reset()
+            except blivet.errors.UnusableConfigurationError as e:
+                log.error("Error: %s" % e.message)
             return blivetEnv.devicetree.getDeviceByName(poolLv.name)
 
     if os.path.ismount(mountPoint):
@@ -242,7 +250,10 @@
         chunkSize = DEFAULT_CHUNK_SIZE_KB
 
     blivetEnv = blivet.Blivet()
-    blivetEnv.reset()
+    try:
+        blivetEnv.reset()
+    except blivet.errors.UnusableConfigurationError as e:
+        log.error("Error: %s" % e.message)
 
     deviceList = _getDeviceList(devNameList)
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaeb3d42091b69f052ae93bbb114f9d3b9d158be4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Timothy Asir <tjeyasin at redhat.com>


More information about the vdsm-patches mailing list