Daniel Erez has posted comments on this change.
Change subject: vm: Update LUN size when starting a vm
......................................................................
Patch Set 5:
(11 comments)
....................................................
Commit Message
Line 13: Hence, added the following information to disks stats for
Line 14: DirectLUN disks: truesize, apparentsize and lunGUID
Line 15: (the sizes values already exist but are zeroed).
Line 16: Using these values, the engine could keep the DB updated.
Line 17:
Done
Line 18: The following changes are introduced:
Line 19:
Line 20: * hsm:
Line 21: Added getDeviceSize for fetching LUN's device size
Line 17:
Line 18: The following changes are introduced:
Line 19:
Line 20: * hsm:
Line 21: Added getDeviceSize for fetching LUN's device size
Done
Line 22: using multipath -> getDeviceSize.
Line 23:
Line 24: * clientIF:
Line 25: For LUN devices, updated drive's truesize/apparentsize
Line 22: using multipath -> getDeviceSize.
Line 23:
Line 24: * clientIF:
Line 25: For LUN devices, updated drive's truesize/apparentsize
Line 26: using getDeviceSize method.
Done
Line 27:
Line 28: * vm:
Line 29: _getDiskStats -> in order to identify each LUN
Line 30: (e.g. on engine side), added 'lunGUID' to dStats
....................................................
File vdsm/clientIF.py
Line 263: res = self.irs.appropriateDevice(drive["GUID"], vmId)
Line 264: if res['status']['code']:
Line 265: raise vm.VolumeError(drive)
Line 266:
Line 267: # Update size for LUN volume
Done
Line 268: volSize = self.irs.getVolumeSize(drive["GUID"])
Line 269: drive["truesize"] = volSize['truesize']
Line 270: drive["apparentsize"] = volSize['apparentsize']
Line 271:
....................................................
File vdsm/storage/hsm.py
Line 2991: sdUUID=sdUUID).produceVolume(imgUUID=imgUUID,
Line 2992:
volUUID=volUUID).refreshVolume()
Line 2993:
Line 2994: @public
Line 2995: def getVolumeSize(self, *args):
getVolumeSize method is currently not documented in vdsmapi-schema.json.
Not sure I should introduce such change in the context of this patch.
Line 2996: if len(args) == 1:
Line 2997: return self._getLUVolumeSize(args[0])
Line 2998: else:
Line 2999: return self._getPDIVSize(args[0], args[1], args[2],
args[3])
Line 2991: sdUUID=sdUUID).produceVolume(imgUUID=imgUUID,
Line 2992:
volUUID=volUUID).refreshVolume()
Line 2993:
Line 2994: @public
Line 2995: def getVolumeSize(self, *args):
Not sure if I should introduce such change in this context, maybe preferable to
defer to another patch.
Line 2996: if len(args) == 1:
Line 2997: return self._getLUVolumeSize(args[0])
Line 2998: else:
Line 2999: return self._getPDIVSize(args[0], args[1], args[2],
args[3])
Line 2991: sdUUID=sdUUID).produceVolume(imgUUID=imgUUID,
Line 2992:
volUUID=volUUID).refreshVolume()
Line 2993:
Line 2994: @public
Line 2995: def getVolumeSize(self, *args):
Done
Line 2996: if len(args) == 1:
Line 2997: return self._getLUVolumeSize(args[0])
Line 2998: else:
Line 2999: return self._getPDIVSize(args[0], args[1], args[2],
args[3])
Line 2993:
Line 2994: @public
Line 2995: def getVolumeSize(self, *args):
Line 2996: if len(args) == 1:
Line 2997: return self._getLUVolumeSize(args[0])
Done
Line 2998: else:
Line 2999: return self._getPDIVSize(args[0], args[1], args[2],
args[3])
Line 3000:
Line 3001: def _getLUVolumeSize(self, devGUID, options=None):
Line 2995: def getVolumeSize(self, *args):
Line 2996: if len(args) == 1:
Line 2997: return self._getLUVolumeSize(args[0])
Line 2998: else:
Line 2999: return self._getPDIVSize(args[0], args[1], args[2],
args[3])
Done
Line 3000:
Line 3001: def _getLUVolumeSize(self, devGUID, options=None):
Line 3002: """
Line 3003: Gets the size of a LUN device volume.
Line 2997: return self._getLUVolumeSize(args[0])
Line 2998: else:
Line 2999: return self._getPDIVSize(args[0], args[1], args[2],
args[3])
Line 3000:
Line 3001: def _getLUVolumeSize(self, devGUID, options=None):
Done
Line 3002: """
Line 3003: Gets the size of a LUN device volume.
Line 3004:
Line 3005: :param devGUID: The LUN device GUID.
....................................................
File vdsm/vm.py
Line 632: dStats = {'truesize': str(vmDrive.truesize),
Line 633: 'apparentsize': str(vmDrive.apparentsize)}
Line 634: if isVdsmImage(vmDrive):
Line 635: dStats['imageID'] = vmDrive.imageID
Line 636: if vmDrive.GUID:
Currently, DirectLUN disks are returned from dStats with zeroed values; i.e.
'truesize'/'apparentsize': 0. Each disk is returned without any indication of
the LUN's GUID, whereas for images, we expose the 'imageID'. Hence, shouldn't
be any issue with adding this information.
Line 637: dStats['lunGUID'] = vmDrive.GUID
Line 638: dStats['readRate'] = ((eInfo[dName][1] -
sInfo[dName][1]) /
Line 639: sampleInterval)
Line 640: dStats['writeRate'] = ((eInfo[dName][3] -
sInfo[dName][3]) /
--
To view, visit http://gerrit.ovirt.org/22976
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I48b4343c6519fed366beec415c47226d4e3c8fef
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Eduardo <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches