Change in vdsm[master]: vm: split storage part from device normalization

fromani at redhat.com fromani at redhat.com
Thu Oct 30 14:35:44 UTC 2014


Francesco Romani has uploaded a new change for review.

Change subject: vm: split storage part from device normalization
......................................................................

vm: split storage part from device normalization

We learned the hard way multiple times in the past
that storage access is tricky, potentially slow
in the good case, blocking for long time or even
forever in the worst case.

For the sake of being careful, split out
the storage device normalization from the
regular device normalization.

The rest of device configuration setup
is fast and cheap, because it just rearrange
internal VDSM data structures, with no
need of external access whatsoever.

Change-Id: I32a6545d637b8d3866e353f7890d0d76691d66a0
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/clientIF.py
M vdsm/virt/vm.py
2 files changed, 10 insertions(+), 7 deletions(-)


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

diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index 24087c2..6bca4cc 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -457,9 +457,10 @@
                 try:
                     # Do not prepare volumes when system goes down
                     if self._enabled:
-                        devices = vmObj.setupDevicesConf(
-                            vmObj.conf.get('devices'))
-                        vmObj.preparePaths(devices[vm.DISK_DEVICES])
+                        drives = vmObj.setupDevicesConf(
+                            vmObj.conf.get('devices'))[vm.DISK_DEVICES]
+                        vmObj.normalizeStorageDevicesConf(drives)
+                        vmObj.preparePaths(drives)
                 except:
                     self.log.error("Vm %s recovery failed",
                                    vmId, exc_info=True)
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 9556484..6329166 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1420,8 +1420,11 @@
         # to all guests, we need to specifically request not to add it.
         self._normalizeBalloonDevice(devices[BALLOON_DEVICES])
 
+        return devices
+
+    def normalizeStorageDevicesConf(self, drives):
         # Normalize vdsm images
-        for drv in devices[DISK_DEVICES]:
+        for drv in drives:
             if isVdsmImage(drv):
                 try:
                     self._normalizeVdsmImg(drv)
@@ -1432,9 +1435,7 @@
                     if not self.recovering:
                         raise
 
-        self.normalizeDrivesIndices(devices[DISK_DEVICES])
-
-        return devices
+        self.normalizeDrivesIndices(drives)
 
     def _normalizeBalloonDevice(self, balloonDevices):
         EMPTY_BALLOON = {'type': BALLOON_DEVICES,
@@ -2640,6 +2641,7 @@
     def _run(self):
         self.log.info("VM wrapper has started")
         devices = self.setupDevicesConf(self.conf.get('devices'))
+        self.normalizeStorageDevicesConf(devices[DISK_DEVICES])
 
         # recovery flow note:
         # we do not start disk stats collection here since


-- 
To view, visit http://gerrit.ovirt.org/34666
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I32a6545d637b8d3866e353f7890d0d76691d66a0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list