Change in vdsm[master]: hotplugDisk: Handle prepareVolumePath errors gracefully.

aaviram at redhat.com aaviram at redhat.com
Wed Mar 2 15:40:44 UTC 2016


Amit Aviram has uploaded a new change for review.

Change subject: hotplugDisk: Handle prepareVolumePath errors gracefully.
......................................................................

hotplugDisk: Handle prepareVolumePath errors gracefully.

While hotplugging a disk, a call is being made to prepareVolumePath
which prepares the image and builds a path to the volume.

Naturally, this flow can raise errors in some scenarios, e.g when the
storage is unreachable.

This patch makes hotplugDisk to handle errors thrown from prepareVolumePath
so that the user will recieve a hotplug related error, and logs the relevant
information from that error.

Related Bug-Url: https://bugzilla.redhat.com/1311465
Change-Id: Ic049f388eb25127864edf5931ddb3b21b67f2dff
Signed-off-by: Amit Aviram <aaviram at redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/66/54266/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index c12d50d..d126a9a 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -29,6 +29,7 @@
 import tempfile
 import threading
 import time
+import traceback
 import uuid
 import xml.etree.ElementTree as ET
 
@@ -2647,7 +2648,13 @@
             return response.error('migInProgress')
 
         diskParams = params.get('drive', {})
-        diskParams['path'] = self.cif.prepareVolumePath(diskParams)
+        try:
+            diskParams['path'] = self.cif.prepareVolumePath(diskParams)
+        except VolumeError as e:
+            self.log.error(traceback.format_exc())
+            return response.error(
+                'hotplugDisk',
+                "Preparing path during hotplug disk failed: %s" % e)
 
         if isVdsmImage(diskParams):
             self._normalizeVdsmImg(diskParams)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic049f388eb25127864edf5931ddb3b21b67f2dff
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amit Aviram <aaviram at redhat.com>


More information about the vdsm-patches mailing list