Change in vdsm[master]: vm: move queryBlockJobs under services
Francesco Romani has uploaded a new change for review. Change subject: vm: move queryBlockJobs under services .. vm: move queryBlockJobs under services Vm/Block Jobs monitoring is a fundamental part of live merge support. However, to call this 'sampling' it is an hard sell. This patch moves the periodic monitoring of the VM block jobs under the services umbrella, with no intended changes in behaviour nor in the output. The only code changes are limited to the glue code needed to adapt from sampling to services framework. Change-Id: I2bba47881033af1b928195a94456f7130a7ac343 Signed-off-by: Francesco Romani --- M vdsm/virt/services.py M vdsm/virt/vm.py 2 files changed, 21 insertions(+), 23 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/95/37595/1 diff --git a/vdsm/virt/services.py b/vdsm/virt/services.py index 5bd4225..23ee2e3 100644 --- a/vdsm/virt/services.py +++ b/vdsm/virt/services.py @@ -58,7 +58,9 @@ _calls = [ RepeatingCall(UpdateVolumes(cif), - config.getint('irs', 'vol_size_sample_interval'))] + config.getint('irs', 'vol_size_sample_interval')), +RepeatingCall(SampleVmJobs(cif), + config.getint('vars', 'vm_sample_jobs_interval'))] for call in _calls: call.start() @@ -150,3 +152,13 @@ # Avoid queries from storage during recovery process for vmDrive in vmObj.getDiskDevices(): vmObj.updateDriveVolume(vmDrive) + + +class SampleVmJobs(object): +def __init__(self, cif): +self._cif = cif + +def __call__(self): +vms = self._cif.getVMs() +for vmId, vmObj in vms.iteritems(): +vmObj.updateVmJobs() diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index ddc852d..046549f 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -209,10 +209,6 @@ AdvancedStatsFunction( self._sampleBalloon, config.getint('vars', 'vm_sample_balloon_interval'), 1)) -self.sampleVmJobs = ( -AdvancedStatsFunction( -self._sampleVmJobs, -config.getint('vars', 'vm_sample_jobs_interval'), 1)) self.sampleVcpuPinning = ( AdvancedStatsFunction( self._sampleVcpuPinning, @@ -225,7 +221,7 @@ self.addStatsFunction( self.highWrite, self.sampleCpu, self.sampleDisk, self.sampleNet, self.sampleBalloon, -self.sampleVmJobs, self.sampleVcpuPinning, self.sampleCpuTune) +self.sampleVcpuPinning, self.sampleCpuTune) def _highWrite(self): if not self._vm.isDisksStatsCollectionEnabled(): @@ -357,9 +353,6 @@ """ infos = self._vm._dom.info() return infos[2] - -def _sampleVmJobs(self): -return self._vm.queryBlockJobs() def _sampleCpuTune(self): """ @@ -631,14 +624,6 @@ if vmNumaNodeRuntimeMap: stats['vNodeRuntimeInfo'] = vmNumaNodeRuntimeMap -def _getVmJobs(self, stats): -info = self.sampleVmJobs.getLastSample() -if info is not None: -# If we are unable to collect stats we must not return anything at -# all since an empty dictionary would be interpreted as vm jobs -# finishing. -stats['vmJobs'] = info - def get(self): stats = {} @@ -646,7 +631,6 @@ self._getNetworkStats(stats) self._getDiskStats(stats) self._getBalloonStats(stats) -self._getVmJobs(stats) self._getNumaStats(stats) self._getCpuTuneInfo(stats) self._getCpuCount(stats) @@ -872,6 +856,7 @@ self._liveMergeCleanupThreads = {} self._shutdownReason = None self._vcpuLimit = None +self._vmJobs = None def _get_lastStatus(self): # note that we don't use _statusLock here. One of the reasons is the @@ -1816,7 +1801,7 @@ stats[var] = decStats[var] elif type(decStats[var]) is not dict: stats[var] = utils.convertToStr(decStats[var]) -elif var in ('network', 'balloonInfo', 'vmJobs', +elif var in ('network', 'balloonInfo', 'vNodeRuntimeInfo'): stats[var] = decStats[var] else: @@ -1835,6 +1820,8 @@ stats['watchdogEvent'] = self._watchdogEvent if self._vcpuLimit: stats['vcpuUserLimit'] = self._vcpuLimit +if self._vmJobs: +stats['vmJobs'] = self._vmJobs return stats def _getVmStatus(self): @@ -4612,6 +4599,9 @@ return True return False +def updateVmJobs(self): +self._vmJobs = self.queryBlockJobs() + def queryBlockJobs(self): def startCleanup(job, drive, needPivot): t = LiveMergeCleanupThread(
Change in vdsm[master]: vm: move queryBlockJobs under services
oVirt Jenkins CI Server has posted comments on this change. Change subject: vm: move queryBlockJobs under services .. Patch Set 1: Build Failed http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/2331/ : There was an infra issue, please contact in...@ovirt.org http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/15487/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/14684/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/15656/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created_staging/462/ : FAILURE -- To view, visit http://gerrit.ovirt.org/37595 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bba47881033af1b928195a94456f7130a7ac343 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: move queryBlockJobs under services
oVirt Jenkins CI Server has posted comments on this change. Change subject: vm: move queryBlockJobs under services .. Patch Set 2: Build Failed http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/2342/ : There was an infra issue, please contact in...@ovirt.org http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/15535/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/14733/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/15704/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created_staging/511/ : FAILURE -- To view, visit http://gerrit.ovirt.org/37595 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bba47881033af1b928195a94456f7130a7ac343 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: move queryBlockJobs under services
oVirt Jenkins CI Server has posted comments on this change. Change subject: vm: move queryBlockJobs under services .. Patch Set 3: Build Failed http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/2355/ : There was an infra issue, please contact in...@ovirt.org http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/15557/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/14755/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/15726/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created_staging/533/ : FAILURE -- To view, visit http://gerrit.ovirt.org/37595 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bba47881033af1b928195a94456f7130a7ac343 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: move queryBlockJobs under services
Francesco Romani has posted comments on this change. Change subject: vm: move queryBlockJobs under services .. Patch Set 4: this version restore the trigger of Jobs collection, just to be safe(r). -- To view, visit http://gerrit.ovirt.org/37595 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bba47881033af1b928195a94456f7130a7ac343 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: move queryBlockJobs under services
oVirt Jenkins CI Server has posted comments on this change. Change subject: vm: move queryBlockJobs under services .. Patch Set 4: Build Failed http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/2399/ : There was an infra issue, please contact in...@ovirt.org http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/15715/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/14914/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/15884/ : FAILURE http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created_staging/691/ : FAILURE -- To view, visit http://gerrit.ovirt.org/37595 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bba47881033af1b928195a94456f7130a7ac343 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: move queryBlockJobs under services
oVirt Jenkins CI Server has posted comments on this change. Change subject: vm: move queryBlockJobs under services .. Patch Set 5: Build Failed http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/2416/ : There was an infra issue, please contact in...@ovirt.org http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/15749/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/14948/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/15919/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created_staging/725/ : FAILURE -- To view, visit http://gerrit.ovirt.org/37595 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bba47881033af1b928195a94456f7130a7ac343 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: move queryBlockJobs under services
automat...@ovirt.org has posted comments on this change. Change subject: vm: move queryBlockJobs under services .. Patch Set 4: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit http://gerrit.ovirt.org/37595 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bba47881033af1b928195a94456f7130a7ac343 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: move queryBlockJobs under services
automat...@ovirt.org has posted comments on this change. Change subject: vm: move queryBlockJobs under services .. Patch Set 5: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit http://gerrit.ovirt.org/37595 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bba47881033af1b928195a94456f7130a7ac343 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: move queryBlockJobs under services
automat...@ovirt.org has posted comments on this change. Change subject: vm: move queryBlockJobs under services .. Patch Set 1: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit http://gerrit.ovirt.org/37595 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bba47881033af1b928195a94456f7130a7ac343 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: move queryBlockJobs under services
automat...@ovirt.org has posted comments on this change. Change subject: vm: move queryBlockJobs under services .. Patch Set 2: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit http://gerrit.ovirt.org/37595 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bba47881033af1b928195a94456f7130a7ac343 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vm: move queryBlockJobs under services
automat...@ovirt.org has posted comments on this change. Change subject: vm: move queryBlockJobs under services .. Patch Set 3: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit http://gerrit.ovirt.org/37595 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bba47881033af1b928195a94456f7130a7ac343 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches