Change in vdsm[master]: vm: Update LUN size when starting a vm

derez at redhat.com derez at redhat.com
Sun Feb 9 12:31:43 UTC 2014


Daniel Erez has uploaded a new change for review.

Change subject: vm: Update LUN size when starting a vm
......................................................................

vm: Update LUN size when starting a vm

In order to handle resize of DirectLUN disks
(i.e. when a LUN volume is extended by user),
relevant data should be retrieved when invoking getVmStats.

Hence, added the following information to disks stats for
DirectLUN disks: truesize, apparentsize and lunGUID
(the sizes values already exist but are zeroed).
Using these values, the engine could keep the DB updated.

The following changes are introduced:
* hsm:
  appropriateDevice method now fetches LUN's device size
  using 'multipath -> getDeviceSize'.
* clientIF:
  For LUN devices, updated drive's truesize/apparentsize
  using hsm's getVolumeSize method.
* vm:
  _getDiskStats -> in order to identify each LUN
  (e.g. on engine side), added 'lunGUID' to dStats
  when vmDrive.GUID exists (applicable for DirectLUN disks).

Change-Id: Ia4988212f7f96078e774d2a4e7b5cd1681383cb0
Bug-Url: https://bugzilla.redhat.com/1026868
Signed-off-by: Daniel Erez <derez at redhat.com>
---
M vdsm/clientIF.py
M vdsm/storage/hsm.py
M vdsm/vm.py
3 files changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/35/24235/1

diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index 894a5d7..d0095e4 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -263,6 +263,10 @@
                 if res['status']['code']:
                     raise vm.VolumeError(drive)
 
+                # Update size for LUN volume
+                drive["truesize"] = res['truesize']
+                drive["apparentsize"] = res['apparentsize']
+
                 volPath = os.path.join("/dev/mapper", drive["GUID"])
 
             # UUID drive format
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 53c9dd0..15485e2 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3107,6 +3107,11 @@
                     expectedException=OSError,
                     timeout=QEMU_READABLE_TIMEOUT)
 
+        # Get the size of the logical unit volume.
+        size = str(multipath.getDeviceSize(devicemapper.getDmId(guid)))
+
+        return dict(truesize=size, apparentsize=size)
+
     @public
     def inappropriateDevices(self, thiefId):
         """
diff --git a/vdsm/vm.py b/vdsm/vm.py
index aae8bd6..295814e 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -631,6 +631,8 @@
                           'apparentsize': str(vmDrive.apparentsize)}
                 if isVdsmImage(vmDrive):
                     dStats['imageID'] = vmDrive.imageID
+                else:
+                    dStats['lunGUID'] = vmDrive.GUID
                 dStats['readRate'] = ((eInfo[dName][1] - sInfo[dName][1]) /
                                       sampleInterval)
                 dStats['writeRate'] = ((eInfo[dName][3] - sInfo[dName][3]) /


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4988212f7f96078e774d2a4e7b5cd1681383cb0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <derez at redhat.com>


More information about the vdsm-patches mailing list