Change in vdsm[ovirt-3.6]: virt: vm: Update time on VM after resume

fromani at redhat.com fromani at redhat.com
Mon Dec 14 14:12:52 UTC 2015


Francesco Romani has submitted this change and it was merged.

Change subject: virt: vm: Update time on VM after resume
......................................................................


virt: vm: Update time on VM after resume

When a VM is resumed from suspension and/or migrated, its clock
continues from the time of suspension, i.e. it's delayed.  Even when NTP
is running on the VM, it may refuse to correct the time after a long
pause.  This needs to be fixed.

There was some discussion whether libvirt should be automatically
responsible for correcting the time inside its VM operations such as
virDomainResume, see the bug below.  The conclusion is that whatever the
right approach is, we currently have to handle the time correction
outside libvirt.

This change asks libvirt to correct the time after a VM is resumed.
It's not guaranteed that the call succeeds, e.g. it doesn't work without
QEMU guest agent running on the VM.  So the time may still be incorrect
after our effort but we shouldn't make the original VM operation fail
just because of that.

Note that the libvirt call currently waits for about 5 seconds before
giving up when qemu-guest-agent is not running in the guest.  That
should be harmless in theory as it doesn't make the VM non-operable, it
just delays finishing the requested operation.  But we want to be safe
so we update time just on resume after pausing, as requested in the bug
referenced below, which is the more important (possibly very long time
shifts) and more safe case.  We should handle migrations or situations
such as recovery after temporary suspension due to I/O errors as well,
but we are going to do that later, after discussing the delay issues
with libvirt developers.

Change-Id: Ieb583cd5d21e56d7730b0ba21d75ed93b9d34025
Bug-Url: https://bugzilla.redhat.com/1156194
Signed-off-by: Milan Zamazal <mzamazal at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/50426
Continuous-Integration: Jenkins CI
Reviewed-by: Michal Skrivanek <michal.skrivanek at redhat.com>
Reviewed-by: Francesco Romani <fromani at redhat.com>
---
M tests/vmTests.py
M tests/vmfakelib.py
M vdsm/virt/vm.py
3 files changed, 68 insertions(+), 0 deletions(-)

Approvals:
  Jenkins CI: Passed CI tests
  Francesco Romani: Looks good to me, approved
  Michal Skrivanek: Looks good to me, but someone else must approve
  Milan Zamazal: Verified



-- 
To view, visit https://gerrit.ovirt.org/50426
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ieb583cd5d21e56d7730b0ba21d75ed93b9d34025
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Milan Zamazal <mzamazal at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the vdsm-patches mailing list