oVirt Jenkins CI Server has posted comments on this change.
Change subject: [WIP] Java client
......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1889/ (2/2)
--
To view, visit http://gerrit.ovirt.org/13747
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1af69cee1aced5c28e48c0c07a1d155be2889036
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: [WIP] Java client
......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1940/ (1/2)
--
To view, visit http://gerrit.ovirt.org/13747
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I1af69cee1aced5c28e48c0c07a1d155be2889036
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Federico Simoncelli has uploaded a new change for review.
Change subject: vm: rename _updateDrive to updateDriveParameters
......................................................................
vm: rename _updateDrive to updateDriveParameters
As preparation for change I472c2931 the method _updateDrive is renamed
to updateDriveParameters to avoid confusion with updateDriveVolume.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=923964
Change-Id: Ic60f1e0bcd889dffba9003d413fa305f6102eccf
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/libvirtvm.py
1 file changed, 15 insertions(+), 15 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/13631/1
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index 607dedb..0ef529b 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -1970,28 +1970,28 @@
raise LookupError("No such drive: '%s'" % drive)
- def _updateDrive(self, drive):
+ def updateDriveParameters(self, driveParams):
"""Update the drive with the new volume information"""
- # Updating the drive object
- for device in self._devices[vm.DISK_DEVICES][:]:
- if device.name == drive["name"]:
- for k, v in drive.iteritems():
- setattr(device, k, v)
+ # Updating the vmDrive object
+ for vmDrive in self._devices[vm.DISK_DEVICES][:]:
+ if vmDrive.name == driveParams["name"]:
+ for k, v in driveParams.iteritems():
+ setattr(vmDrive, k, v)
break
else:
self.log.error("Unable to update the drive object for: %s",
- drive["name"])
+ driveParams["name"])
# Updating the VM configuration
- for device in self.conf["devices"][:]:
- if (device['type'] == vm.DISK_DEVICES and
- device.get("name") == drive["name"]):
- device.update(drive)
+ for vmDriveConfig in self.conf["devices"][:]:
+ if (vmDriveConfig['type'] == vm.DISK_DEVICES and
+ vmDriveConfig.get("name") == driveParams["name"]):
+ vmDriveConfig.update(driveParams)
break
else:
self.log.error("Unable to update the device configuration ",
- "for: %s", drive["name"])
+ "for: %s", driveParams["name"])
self.saveState()
@@ -2130,7 +2130,7 @@
else:
# Update the drive information
for drive in newDrives.values():
- self._updateDrive(drive)
+ self.updateDriveParameters(drive)
finally:
self.startDisksStatsCollection()
@@ -2356,7 +2356,7 @@
# Updating the destination disk device and name, the device is used by
# prepareVolumePath (required to fill the new information as the path)
- # and the name is used by _updateDrive.
+ # and the name is used by updateDriveParameters.
dstDiskCopy.update({'device': srcDrive.device, 'name': srcDrive.name})
dstDiskCopy['path'] = self.cif.prepareVolumePath(dstDiskCopy)
@@ -2397,7 +2397,7 @@
# There is nothing we can do at this point other than logging
self.log.error("Unable to teardown the previous chain: %s",
diskToTeardown, exc_info=True)
- self._updateDrive(dstDiskCopy) # Updating the drive structure
+ self.updateDriveParameters(dstDiskCopy)
finally:
self._delDiskReplica(srcDrive)
self.startDisksStatsCollection()
--
To view, visit http://gerrit.ovirt.org/13631
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic60f1e0bcd889dffba9003d413fa305f6102eccf
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Mark Wu has posted comments on this change.
Change subject: mom: add mom balloon functional tests for running vms
......................................................................
Patch Set 3: I would prefer that you didn't submit this
(3 inline comments)
....................................................
File tests/functional/Makefile.am
Line 26: xmlrpcTests.py \
Line 27: $(NULL)
Line 28:
Line 29: dist_vdsmfunctests_DATA = \
Line 30: 60_test_balloon_shrink.policy \
you should use tab instead of whitespace
Line 31: 70_test_balloon_grow.policy \
....................................................
File tests/functional/momTests.py
Line 75: except KeyError:
Line 76: pass
Line 77: return candidateStats
Line 78:
Line 79: def _prepareTarget(self, operation, vmsOldStats):
I suggest you merge _prepareTarget and _filterVmsStats into one function, return a list of 'vmId'. after you set policy, you can just check result of vm in this list. It could avoid the nested loop in line 111
Line 80: # Set the balloon target to max before shrink operation.
Line 81: # Set the balloon target to 0.9*max before grow operation.
Line 82: func = {"Shrink": lambda x: x, "Grow": lambda x: 0.9 * x}
Line 83: for vmOldStats in vmsOldStats:
Line 106: # Check the new balloon_cur in the proper range.
Line 107: lower_bound_func = {'Shrink': lambda x: floor(0.9 * x),
Line 108: 'Grow': lambda x: floor(0.99225 * x)}
Line 109: upper_bound_func = {'Shrink': lambda x: ceil(0.9025 * x),
Line 110: 'Grow': lambda x: ceil(x)}
it could be cleaner to define a namedtuple like this:
BalloonRatio = namedtuple('BalloonRatio', ['target', 'low', 'high')
shrinkRatio = BalloonRatio(1, 0.9, 0.9025)
growRatio = BalloonRatio(0.9, 0.99225, 1)
then you can use it in this way:
balloonCur >= balloonMax * shrinkRatio.low
balloonCur <= balloonMax * shrinkRatio.high
Line 111: for vmNewStats in vmsNewStats:
Line 112: for vmOldStats in vmsOldStats:
Line 113: if vmOldStats['vmId'] == vmNewStats['vmId']:
Line 114: balloonMax = vmOldStats['balloonInfo']['balloon_max']
--
To view, visit http://gerrit.ovirt.org/13156
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I922568233dc769d83e2fdffe1c24439d13d03d7e
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mei Liu <liumbj(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Mei Liu <liumbj(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: mom: add mom balloon functional tests for running vms
......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1883/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1934/ : SUCCESS
--
To view, visit http://gerrit.ovirt.org/13156
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I922568233dc769d83e2fdffe1c24439d13d03d7e
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mei Liu <liumbj(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Mei Liu <liumbj(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: mom: add mom balloon functional tests for running vms
......................................................................
Patch Set 3:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1883/ (2/2)
--
To view, visit http://gerrit.ovirt.org/13156
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I922568233dc769d83e2fdffe1c24439d13d03d7e
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mei Liu <liumbj(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Mei Liu <liumbj(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: mom: add mom balloon functional tests for running vms
......................................................................
Patch Set 3:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1934/ (1/2)
--
To view, visit http://gerrit.ovirt.org/13156
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I922568233dc769d83e2fdffe1c24439d13d03d7e
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mei Liu <liumbj(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Mei Liu <liumbj(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server