Francesco Romani has uploaded a new change for review.
Change subject: vm: hyperv: make hw clock friendlier to windows ......................................................................
vm: hyperv: make hw clock friendlier to windows
This patch sets the local time as windows reportedly expect. According to libvirt docs:
" Most operating systems expect the hardware clock to be kept in UTC, and this is the default. Windows, however, expects it to be in so called 'localtime'." http://libvirt.org/formatdomain.html#elementsTime
This is the reccommended setting for windows and reportedly has stability benefits for live migrations.
The new setting is enabled on top of the hyperv optimizations, and is disabled by default for backward compatibility.
Change-Id: I84a8cfded683a42826b6dabb67b4a5eb456594d7 Bug-Url: https://bugzilla.redhat.com/1107835 Signed-off-by: Francesco Romani fromani@redhat.com --- M tests/vmTests.py M vdsm/virt/vm.py 2 files changed, 17 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/33/29233/1
diff --git a/tests/vmTests.py b/tests/vmTests.py index f435ada..7ee2eb8 100644 --- a/tests/vmTests.py +++ b/tests/vmTests.py @@ -379,6 +379,20 @@ domxml.appendClock() self.assertXML(domxml.dom, clockXML, 'clock')
+ def testHyperVClockXML(self): + clockXML = """ + <clock adjustment="-3600" offset="variable"> + <timer name="rtc" tickpolicy="catchup" track="guest"/> + <timer name="pit" tickpolicy="delay"/> + <timer name="hpet" present="no"/> + </clock>""" + conf = {'timeOffset': '-3600', 'hypervEnable': 'true'} + conf.update(self.conf) + domxml = vm._DomXML(conf, self.log, + caps.Architecture.X86_64) + domxml.appendClock() + self.assertXML(domxml.dom, clockXML, 'clock') + def testCpuXML(self): cpuXML = """ <cpu match="exact"> diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index 94e81b3..ec8ca12 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -721,7 +721,9 @@
m = XMLElement('clock', offset='variable', adjustment=str(self.conf.get('timeOffset', 0))) - m.appendChildWithArgs('timer', name='rtc', tickpolicy='catchup') + rtc = m.appendChildWithArgs('timer', name='rtc', tickpolicy='catchup') + if utils.tobool(self.conf.get('hypervEnable', 'false')): + rtc.setAttrs(track='guest') m.appendChildWithArgs('timer', name='pit', tickpolicy='delay')
if self.arch == caps.Architecture.X86_64:
Francesco Romani has posted comments on this change.
Change subject: vm: hyperv: make hw clock friendlier to windows ......................................................................
Patch Set 1: Verified+1
Verified on RHEL6.5 by forcing the support to ON, then running a VM and inspecting the generated XML.
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vm: hyperv: make hw clock friendlier to windows ......................................................................
Patch Set 1:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/9656/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/10441/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/1011/ : There was an infra issue, please contact infra@ovirt.org
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/10598/ : SUCCESS
Michal Skrivanek has posted comments on this change.
Change subject: vm: hyperv: make hw clock friendlier to windows ......................................................................
Patch Set 1: Code-Review-1
(1 comment)
http://gerrit.ovirt.org/#/c/29233/1/vdsm/virt/vm.py File vdsm/virt/vm.py:
Line 722: m = XMLElement('clock', offset='variable', Line 723: adjustment=str(self.conf.get('timeOffset', 0))) Line 724: rtc = m.appendChildWithArgs('timer', name='rtc', tickpolicy='catchup') Line 725: if utils.tobool(self.conf.get('hypervEnable', 'false')): Line 726: rtc.setAttrs(track='guest') track = guest? should be name= hypervclock Line 727: m.appendChildWithArgs('timer', name='pit', tickpolicy='delay') Line 728: Line 729: if self.arch == caps.Architecture.X86_64: Line 730: m.appendChildWithArgs('timer', name='hpet', present='no')
Francesco Romani has posted comments on this change.
Change subject: vm: hyperv: make hw clock friendlier to windows ......................................................................
Patch Set 1:
(1 comment)
http://gerrit.ovirt.org/#/c/29233/1/vdsm/virt/vm.py File vdsm/virt/vm.py:
Line 722: m = XMLElement('clock', offset='variable', Line 723: adjustment=str(self.conf.get('timeOffset', 0))) Line 724: rtc = m.appendChildWithArgs('timer', name='rtc', tickpolicy='catchup') Line 725: if utils.tobool(self.conf.get('hypervEnable', 'false')): Line 726: rtc.setAttrs(track='guest')
track = guest? should be name= hypervclock
The libvirt docs/support is quite murky here.
hypervclock is supported u/s starting from 1.2.2, and AFAIK RHEL 6.x is left out, as well as F19 and F20 without virt-preview. (and I'm not that sure anput RHEL7, need to check). Support in VDSM is added in http://gerrit.ovirt.org/#/c/29234/
Then bz1107835 comes into play. We have a reported way to improve stability which is safe to add, plays nice on RHEL 6 and fits nicely on our hyperv support, so I added in this patch.
The open question is if name=hypervclock behaves the same way of name=rtc track=guest. :( Line 727: m.appendChildWithArgs('timer', name='pit', tickpolicy='delay') Line 728: Line 729: if self.arch == caps.Architecture.X86_64: Line 730: m.appendChildWithArgs('timer', name='hpet', present='no')
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vm: hyperv: make hw clock friendlier to windows ......................................................................
Patch Set 2:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/9659/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/10444/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_virt_functional_tests_gerrit/1014/ : There was an infra issue, please contact infra@ovirt.org
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_created/10601/ : SUCCESS
Michal Skrivanek has posted comments on this change.
Change subject: vm: hyperv: make hw clock friendlier to windows ......................................................................
Patch Set 2: Code-Review+1
sorry, was confused
Vinzenz Feenstra has posted comments on this change.
Change subject: vm: hyperv: make hw clock friendlier to windows ......................................................................
Patch Set 2: Code-Review+1
Dan Kenigsberg has posted comments on this change.
Change subject: vm: hyperv: make hw clock friendlier to windows ......................................................................
Patch Set 2: Code-Review+2
raising score
Dan Kenigsberg has submitted this change and it was merged.
Change subject: vm: hyperv: make hw clock friendlier to windows ......................................................................
vm: hyperv: make hw clock friendlier to windows
This patch sets the local time as windows reportedly expect. According to libvirt docs:
" Most operating systems expect the hardware clock to be kept in UTC, and this is the default. Windows, however, expects it to be in so called 'localtime'." http://libvirt.org/formatdomain.html#elementsTime
This is the reccommended setting for windows and reportedly has stability benefits for live migrations.
The new setting is enabled on top of the hyperv optimizations, and is disabled by default for backward compatibility.
Change-Id: I84a8cfded683a42826b6dabb67b4a5eb456594d7 Bug-Url: https://bugzilla.redhat.com/1107835 Signed-off-by: Francesco Romani fromani@redhat.com Reviewed-on: http://gerrit.ovirt.org/29233 Reviewed-by: Michal Skrivanek michal.skrivanek@redhat.com Reviewed-by: Vinzenz Feenstra vfeenstr@redhat.com Reviewed-by: Dan Kenigsberg danken@redhat.com --- M tests/vmTests.py M vdsm/virt/vm.py 2 files changed, 17 insertions(+), 1 deletion(-)
Approvals: Vinzenz Feenstra: Looks good to me, but someone else must approve Dan Kenigsberg: Looks good to me, approved Francesco Romani: Verified Michal Skrivanek: Looks good to me, but someone else must approve
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vm: hyperv: make hw clock friendlier to windows ......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.org/job/vdsm_master_create-rpms_merged/1535/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_verify-error-codes_merged/5520/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit-tests_merged/3678/ : SUCCESS
vdsm-patches@lists.fedorahosted.org