Bug 1045805 - [RFE][nova]: No hpet option added for time drifting of windows guest os
Summary: [RFE][nova]: No hpet option added for time drifting of windows guest os
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-nova
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: Upstream M3
: 5.0 (RHEL 7)
Assignee: Solly Ross
QA Contact: Toure Dunnon
URL: https://blueprints.launchpad.net/nova...
Whiteboard: upstream_milestone_icehouse-3 upstrea...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-22 05:01 UTC by RHOS Integration
Modified: 2023-09-18 09:58 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
The High Precision Event Timer (HPET) is now disabled for instances created using the Libvirt driver. The use of this option was found to lead to clock drift in Windows guests when under heavy load.
Clone Of:
Environment:
Last Closed: 2014-07-08 15:27:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 63769 0 None MERGED Add hpet option for time drifting 2020-01-31 08:31:13 UTC
Red Hat Product Errata RHEA-2014:0853 0 normal SHIPPED_LIVE Red Hat Enterprise Linux OpenStack Platform Enhancement - Compute 2014-07-08 19:22:38 UTC

Description RHOS Integration 2013-12-22 05:01:01 UTC
Cloned from launchpad blueprint https://blueprints.launchpad.net/nova/+spec/add-no-hpet-option-into-guest-clock.

Description:

Since havana, the timezone of windows vm is localtime.
However, there is a time drifting when the windows vm is got overload.
We need to add --no-hpet option into libvirt xml configuration.

From this template,

<clock offset='utc'>
<timer name='pit' tickpolicy='delay'/>
<timer name='rtc' tickpolicy='catchup'/>
</clock>

To this template,

<clock offset='localtime'>
<timer name='rtc' tickpolicy='catchup' track='guest'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
</clock>

Specification URL (additional information):

None

Comment 2 Solly Ross 2014-02-07 20:14:27 UTC
Code has been reviewed upstream, should be committed shortly.

Comment 4 Omri Hochman 2014-04-03 09:12:51 UTC
Tested with IceHouse RDO: 
http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/epel-6/

Environment : 
--------------
 libvirt-0.10.2-29.el6_5.5.x86_64
 openstack-nova-2014.1-0.11.b3.el6.noarch


booting instances and checking it libvirt.xml: 
-----------------------------------------------
cat /var/lib/nova/instances/1b8291c6-d445-4d40-897d-e7dea11df6a0/libvirt.xml  | less

<clock offset="utc">
    <timer name="pit" tickpolicy="delay"/>
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="hpet" present="no"/>
  </clock>

Comment 6 Omri Hochman 2014-04-07 09:38:32 UTC
Can you check if that sufficient ? 
https://bugzilla.redhat.com/show_bug.cgi?id=1045805#c4

Comment 7 Alan Pevec 2014-04-07 11:45:57 UTC
Original description also adds track='guest' for rtc timer and this is not set in the actual libvirt xml.
If not present, hypervisor default applies, which is qemu -rtc clock=host [1] i.e. track='wall' [2] while track='guest' is mapped to qemu -rtc clock=vm


[1] http://git.qemu-project.org/?p=qemu.git;a=blob;f=vl.c#l3003
[2] http://libvirt.org/git/?p=libvirt.git;a=blob;f=src/qemu/qemu_command.c#l6552

Comment 8 Solly Ross 2014-04-08 15:12:21 UTC
@apevec: that part is not actually in the linked qemu discussion post [1], however.  Perhaps @danpb will know?

[1] http://www.redhat.com/archives/libvir-list/2010-June/msg00192.html

Comment 9 Daniel Berrangé 2014-04-08 15:16:24 UTC
The original XML in the blueprint/bug description was not correct. Since this bug was about disabling hpet, changing any other attribute on other timers was out of scope.

Comment 10 Solly Ross 2014-04-08 20:35:33 UTC
That's what I figured.  Looks like we're all set here, then.

Comment 11 Omri Hochman 2014-04-24 15:25:25 UTC
Can we test it by boot instance and check the libvirt.xml  ? If so according to    https://bugzilla.redhat.com/show_bug.cgi?id=1045805#c4   - this ticket can be  verified.

Comment 12 Solly Ross 2014-04-24 16:57:41 UTC
Yes, it should be sufficient to do a `virsh dumpxml` after booting an instance.  

If you want to be extra sure, you can check the qemu command line to make sure it got run with '--no-hpet'.

Comment 13 Omri Hochman 2014-04-25 07:58:20 UTC
(In reply to Solly Ross from comment #12)
> Yes, it should be sufficient to do a `virsh dumpxml` after booting an
> instance.  
> 
> If you want to be extra sure, you can check the qemu command line to make
> sure it got run with '--no-hpet'.


Maybe I'm missing something , I don't see --no-hpet on the qemu command line ? 


Version:
--------
libvirt-0.10.2-29.el6_5.5.x86_64
openstack-nova-2014.1-0.11.b3.el6.noarch


ps -ef | grep qemu 
--------------------
qemu     28333     1  4 Apr01 ?        1-01:20:11 /usr/libexec/qemu-kvm -name instance-00000028 -S -M rhel6.5.0 -cpu SandyBridge,+pdpe1gb,+osxsave,+dca,+pcid,+pdcm,+xtpr,+tm2,+est,+smx,+vmx,+ds_cpl,+monitor,+dtes64,+pbe,+tm,+ht,+ss,+acpi,+ds,+vme -enable-kvm -m 2048 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 317f3ccf-01eb-4900-993d-db61d5b6484a -smbios type=1,manufacturer=Red Hat Inc.,product=OpenStack Nova,version=2014.1-0.11.b3.el6,serial=b94ddc48-ad22-f43a-a45f-7bfb6ea82174,uuid=317f3ccf-01eb-4900-993d-db61d5b6484a -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/instance-00000028.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -no-kvm-pit-reinjection -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/nova/instances/317f3ccf-01eb-4900-993d-db61d5b6484a/disk,if=none,id=drive-virtio-disk0,format=qcow2,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=25,id=hostnet0,vhost=on,vhostfd=28 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=fa:16:3e:a3:0c:7a,bus=pci.0,addr=0x3 -chardev file,id=charserial0,path=/var/lib/nova/instances/317f3ccf-01eb-4900-993d-db61d5b6484a/console.log -device isa-serial,chardev=charserial0,id=serial0 -chardev pty,id=charserial1 -device isa-serial,chardev=charserial1,id=serial1 -device usb-tablet,id=input0 -vnc 10.0.0.3:2 -k en-us -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5



[root@rhos-compute-node-03 ~]# cat /proc/28333/cmdline 
---------------------------------------------------------
/usr/libexec/qemu-kvm-nameinstance-00000028-S-Mrhel6.5.0-cpuSandyBridge,+pdpe1gb,+osxsave,+dca,+pcid,+pdcm,+xtpr,+tm2,+est,+smx,+vmx,+ds_cpl,+monitor,+dtes64,+pbe,+tm,+ht,+ss,+acpi,+ds,+vme-enable-kvm-m2048-realtimemlock=off-smp1,sockets=1,cores=1,threads=1-uuid317f3ccf-01eb-4900-993d-db61d5b6484a-smbiostype=1,manufacturer=Red Hat Inc.,product=OpenStack Nova,version=2014.1-0.11.b3.el6,serial=b94ddc48-ad22-f43a-a45f-7bfb6ea82174,uuid=317f3ccf-01eb-4900-993d-db61d5b6484a-nodefconfig-nodefaults-chardevsocket,id=charmonitor,path=/var/lib/libvirt/qemu/instance-00000028.monitor,server,nowait-monchardev=charmonitor,id=monitor,mode=control-rtcbase=utc,driftfix=slew-no-kvm-pit-reinjection-no-shutdown-devicepiix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2-drivefile=/var/lib/nova/instances/317f3ccf-01eb-4900-993d-db61d5b6484a/disk,if=none,id=drive-virtio-disk0,format=qcow2,cache=none-devicevirtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1-netdevtap,fd=25,id=hostnet0,vhost=on,vhostfd=28-devicevirtio-net-pci,netdev=hostnet0,id=net0,mac=fa:16:3e:a3:0c:7a,bus=pci.0,addr=0x3-chardevfile,id=charserial0,path=/var/lib/nova/instances/317f3ccf-01eb-4900-993d-db61d5b6484a/console.log-deviceisa-serial,chardev=charserial0,id=serial0-chardevpty,id=charserial1-deviceisa-serial,chardev=charserial1,id=serial1-deviceusb-tablet,id=input0-vnc10.0.0.3:2-ken-us-vgacirrus-devicevirtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5[root@rhos-compute-node-03 ~]# 


less /var/lib/nova/instances/317f3ccf-01eb-4900-993d-db61d5b6484a/libvirt.xml 
------------------------------------------------------------------------------

  </features>
  <clock offset="utc">
    <timer name="pit" tickpolicy="delay"/>
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="hpet" present="no"/>
  </clock>
  <cpu mode="host-model" match="

Comment 15 Daniel Berrangé 2014-05-01 15:59:15 UTC
Rather than just too focused on CLI args to QEMU, the more important thing is  whether /sys/devices/system/clocksource/clocksource0/available_clocksource contains 'hpet' according to the XML config. ie if hpet is disabled, it shouldn't show up as a clock source, and if enabled them it should show up

Comment 20 errata-xmlrpc 2014-07-08 15:27:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2014-0853.html


Note You need to log in before you can comment on or make changes to this bug.