Milan Zamazal has uploaded a new change for review.
Change subject: virt: Fetch only minimum VM stats during post-copy migration ......................................................................
virt: Fetch only minimum VM stats during post-copy migration
When a migration switches to post-copy mode, the VM starts running on the destination. Libvirt no longer provides actual stats on the source, with the exception of progress, which is still available on the source and only on the source.
This patch stops reporting stats other than progress during post-copy migration.
Change-Id: Iac3da08b0816e7a9a247969147c17b15518c7624 Signed-off-by: Milan Zamazal mzamazal@redhat.com Bug-Url: https://bugzilla.redhat.com/1354343 --- M vdsm/virt/migration.py M vdsm/virt/vm.py 2 files changed, 21 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/52/63552/8
diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py index 13f2155..63cdf8c 100644 --- a/vdsm/virt/migration.py +++ b/vdsm/virt/migration.py @@ -149,6 +149,11 @@ def hibernating(self): return self._mode == MODE_FILE
+ @property + def in_post_copy(self): + return (self._monitorThread is not None and + self._monitorThread.in_post_copy) + def getStat(self): """ Get the status of the migration. @@ -653,6 +658,10 @@ def enabled(self): return MonitorThread._MIGRATION_MONITOR_INTERVAL > 0
+ @property + def in_post_copy(self): + return self._in_post_copy + @utils.traceback() def run(self): if self.enabled: diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index e274388..f32d119 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -1198,10 +1198,15 @@ if self.lastStatus == vmstatus.DOWN: stats.update(self._getDownVmStats()) else: - stats.update(self._getConfigVmStats()) - stats.update(self._getRunningVmStats()) + if self.isMigrating() and self._migrationSourceThread.in_post_copy: + # Stats are on the destination during post-copy migration, + # except for migration progress, which is always on the source. + stats['migrationProgress'] = self._get_vm_migration_progress() + else: + stats.update(self._getConfigVmStats()) + stats.update(self._getRunningVmStats()) + stats.update(self._getGuestStats()) stats['status'] = self._getVmStatus() - stats.update(self._getGuestStats()) return stats
def _getDownVmStats(self): @@ -1255,7 +1260,7 @@ if 'pauseCode' in self.conf: stats['pauseCode'] = self.conf['pauseCode'] if self.isMigrating(): - stats['migrationProgress'] = self.migrateStatus()['progress'] + stats['migrationProgress'] = self._get_vm_migration_progress()
try: vm_sample = sampling.stats_cache.get(self.id) @@ -1346,6 +1351,9 @@ else: return self.lastStatus
+ def _get_vm_migration_progress(self): + return self.migrateStatus()['progress'] + def _getGraphicsStats(self): def getInfo(dev): return {
gerrit-hooks has posted comments on this change.
Change subject: virt: Fetch VM stats from the destination during post-copy migration ......................................................................
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.6', 'ovirt-4.0'])
gerrit-hooks has posted comments on this change.
Change subject: virt: Fetch only minimum VM stats during post-copy migration ......................................................................
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.6', 'ovirt-4.0'])
Francesco Romani has posted comments on this change.
Change subject: virt: Fetch only minimum VM stats during post-copy migration ......................................................................
Patch Set 8: Code-Review+2
gerrit-hooks has posted comments on this change.
Change subject: virt: Fetch only minimum VM stats during post-copy migration ......................................................................
Patch Set 9:
* Update Tracker::#1354343::OK, status: POST * Check Bug-Url::IGNORE, not relevant for branch: master * Check Public Bug::#1354343::OK, public bug * Check Product::IGNORE, not relevant for branch: master * Check TM::IGNORE, not relevant for branch: master * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Milan Zamazal has posted comments on this change.
Change subject: virt: Fetch only minimum VM stats during post-copy migration ......................................................................
Patch Set 9:
Simplified thanks to the refactorization in the initial patch.
Francesco Romani has posted comments on this change.
Change subject: virt: Fetch only minimum VM stats during post-copy migration ......................................................................
Patch Set 9: Code-Review+2
From Dan Kenigsberg danken@redhat.com:
Dan Kenigsberg has submitted this change and it was merged.
Change subject: virt: Fetch only minimum VM stats during post-copy migration ......................................................................
virt: Fetch only minimum VM stats during post-copy migration
When a migration switches to post-copy mode, the VM starts running on the destination. Libvirt no longer provides actual stats on the source, with the exception of progress, which is still available on the source and only on the source.
This patch stops reporting stats other than progress from libvirt during post-copy migration.
Change-Id: Iac3da08b0816e7a9a247969147c17b15518c7624 Signed-off-by: Milan Zamazal mzamazal@redhat.com Bug-Url: https://bugzilla.redhat.com/1354343 --- M vdsm/virt/vm.py 1 file changed, 11 insertions(+), 3 deletions(-)
Approvals: Jenkins CI: Passed CI tests Francesco Romani: Looks good to me, approved Milan Zamazal: Verified
vdsm-patches@lists.fedorahosted.org