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

derez at redhat.com derez at redhat.com
Sun Feb 9 16:43:37 UTC 2014


Daniel Erez has posted comments on this change.

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


Patch Set 1:

(4 comments)

http://gerrit.ovirt.org/#/c/24235/1/vdsm/clientIF.py
File vdsm/clientIF.py:

Line 259:                 if not res["visible"][drive["GUID"]]:
Line 260:                     raise vm.VolumeError(drive)
Line 261: 
Line 262:                 res = self.irs.appropriateDevice(drive["GUID"], vmId)
Line 263:                 if res['status']['code']:
> This will raise KeyError now, since you are not returning standard status r
Seems fine, the status is probably generated by public api wrapper, after the change 'res' contains:
{'status': {'message': 'OK', 'code': 0}, 'truesize': '21474836480', 'apparentsize': '21474836480'}
Line 264:                     raise vm.VolumeError(drive)
Line 265: 
Line 266:                 # Update size for LUN volume
Line 267:                 drive["truesize"] = res['truesize']


http://gerrit.ovirt.org/#/c/24235/1/vdsm/storage/hsm.py
File vdsm/storage/hsm.py:

Line 3106:         utils.retry(partial(fileUtils.validateQemuReadable, devPath),
Line 3107:                     expectedException=OSError,
Line 3108:                     timeout=QEMU_READABLE_TIMEOUT)
Line 3109: 
Line 3110:         # Get the size of the logical unit volume.
> This comment does not add any information or value. The code is explaining 
Done
Line 3111:         size = str(multipath.getDeviceSize(devicemapper.getDmId(guid)))
Line 3112: 
Line 3113:         return dict(truesize=size, apparentsize=size)
Line 3114: 


Line 3109: 
Line 3110:         # Get the size of the logical unit volume.
Line 3111:         size = str(multipath.getDeviceSize(devicemapper.getDmId(guid)))
Line 3112: 
Line 3113:         return dict(truesize=size, apparentsize=size)
> The code calling this expect a standard xmlrpc reply:
It seems that the other methods return only data. iinm, the wrapper generates also for success. The return result after the change is:
{'status': {'message': 'OK', 'code': 0}, 'truesize': '21474836480', 'apparentsize': '21474836480'}
Line 3114: 
Line 3115:     @public
Line 3116:     def inappropriateDevices(self, thiefId):
Line 3117:         """


http://gerrit.ovirt.org/#/c/24235/1/vdsm/vm.py
File vdsm/vm.py:

Line 630:                 dStats = {'truesize': str(vmDrive.truesize),
Line 631:                           'apparentsize': str(vmDrive.apparentsize)}
Line 632:                 if isVdsmImage(vmDrive):
Line 633:                     dStats['imageID'] = vmDrive.imageID
Line 634:                 else:
> Is this always correct? all devices are either vdsmimage or have a GUID?
Currently, we have either of them. I.e. we have an imageID or a GUID. I can add a check for 'GUID' existence to be on the safe side but not sure it's necessary..
Line 635:                     dStats['lunGUID'] = vmDrive.GUID
Line 636:                 dStats['readRate'] = ((eInfo[dName][1] - sInfo[dName][1]) /
Line 637:                                       sampleInterval)
Line 638:                 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: comment
Gerrit-Change-Id: Ia4988212f7f96078e774d2a4e7b5cd1681383cb0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>
Gerrit-Reviewer: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list