Add hyper-v timer enlightenments for windows guests

Bug #1400315 reported by Daniel Berrange
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Daniel Berrange

Bug Description

Back in Folsom we added some special timer settings to improve the reliability of guest time keeping and performance

  https://bugs.launchpad.net/nova/+bug/1011848

These were useful for both Windows and Linux guests, but since that time, KVM has gained support for a number of further tunables that specifically help Windows guests supporting Hyper-V enlightenments. Setting these for all windows guests will improve time keeping reliability and performance of windows guests. There is no harm to setting them with old windows versions which lack support for this, since they'll simply ignore the extra feature with no negative impact.

The recommended qemu configuration is from QEMU maintainers is:

   -cpu ...,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time

Which maps to the libvirt XML:

   <features>
     <hyperv>
       <relaxed state='on'/>
       <vapic state='on'/>
       <spinlocks state='on' retries='8191'/>
     </hyperv>
   <features/>

   <clock ...>
     <timer name='hypervclock' present='yes'/>
   </clock>

Though there are some version caveats here:
- relaxed state='on' libvirt 1.0.0+, qemu 1.1+
- vapic, spinlocks requires libvirt 1.1.0+, qemu 1.1+
- hypervclock requires libvirt 1.2.2+, qemu 2.0.0+

Changed in nova:
status: New → Confirmed
assignee: nobody → Daniel Berrange (berrange)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/140084

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: master
Review: https://review.openstack.org/140085

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: master
Review: https://review.openstack.org/140086

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: master
Review: https://review.openstack.org/140087

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: master
Review: https://review.openstack.org/140088

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/140089

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.openstack.org/140084
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b6a5b25335fc93bf605de19cd8531380535de666
Submitter: Jenkins
Branch: master

commit b6a5b25335fc93bf605de19cd8531380535de666
Author: Daniel P. Berrange <email address hidden>
Date: Thu Nov 20 12:24:35 2014 +0000

    libvirt: move setting of clock out into helper method

    Move clock settings will be added in the future, so it
    makes sense to have a separate helper method for all
    of them.

    Related-bug: #1400315
    Change-Id: I1662e2d1e2e729da873c14a0cc307e412c699320

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/140085
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=989eac8b748fd6a545198541afa672039e339f90
Submitter: Jenkins
Branch: master

commit 989eac8b748fd6a545198541afa672039e339f90
Author: Daniel P. Berrange <email address hidden>
Date: Thu Nov 20 12:24:55 2014 +0000

    libvirt: add support for hyperv timer source with windows guests

    The hyperv timer source enables Windows guests to keep accurate
    time, much like kvmclock does for Linux guests. It should be
    enabled for all windows guests, as it doesn't harm older windows
    versions which don't know about it.

    Related-bug: #1400315
    Change-Id: I6af05b4e8e0b2145733c0f301c04555da23b7da8

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/140086
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=3afdc2a2b0ba7c558d51a53096a97bf2ba3640ce
Submitter: Jenkins
Branch: master

commit 3afdc2a2b0ba7c558d51a53096a97bf2ba3640ce
Author: Daniel P. Berrange <email address hidden>
Date: Mon Dec 8 13:11:18 2014 +0000

    libvirt: change representation of guest features

    While the current acpi, apic & pae features are mere single elements,
    further feature will require complex data structures. The libvirt
    config class must thus change from using a simple string to represent
    a feature, to a full class

    Related-bug: #1400315
    Change-Id: Ia6fa2602dd7a9e7623abcfd46c8b57d3631372ef

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/140087
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=189b682ff3dcca38e5b19b52144c3eb4c9bbabbe
Submitter: Jenkins
Branch: master

commit 189b682ff3dcca38e5b19b52144c3eb4c9bbabbe
Author: Daniel P. Berrange <email address hidden>
Date: Mon Dec 8 13:49:01 2014 +0000

    libvirt: add support for configuring hyperv enlightenments in XML

    Extend the guest XML config classes to cope with the following
    hyperv enlightenments:

       <features>
         <hyperv>
           <relaxed state='on'/>
           <vapic state='on'/>
           <spinlocks state='on' retries='4095'/>
         </hyperv>
       <features/>

    Related-bug: #1400315
    Change-Id: Ieff2ae44bf90e09152a56859709707ccdf83cbc9

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/140088
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=31d91d9de312409850f29fcac7f142c3fe7c956f
Submitter: Jenkins
Branch: master

commit 31d91d9de312409850f29fcac7f142c3fe7c956f
Author: Daniel P. Berrange <email address hidden>
Date: Mon Dec 8 13:55:45 2014 +0000

    libvirt: move setting of guest features out into helper method

    Move guest features into a separate helper method, since there
    will be more complicated guest features to be set in the guest
    config in the future.

    Related-bug: #1400315
    Change-Id: Icf575ab1d6eb2a011c08efd998997d0d82aa15a6

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/140089
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=12cf893fd9bc787d2c5c6ef0a8ca0f81582ead8a
Submitter: Jenkins
Branch: master

commit 12cf893fd9bc787d2c5c6ef0a8ca0f81582ead8a
Author: Daniel P. Berrange <email address hidden>
Date: Mon Dec 8 14:30:06 2014 +0000

    libvirt: enable hyperv enlightenments for windows guests

    All windows guests (ie os_type=windows) now get the following
    enabled

           <features>
             <hyperv>
               <relaxed state='on'/>
               <vapic state='on'/>
               <spinlocks state='on' retries='8191'/>
             </hyperv>
           <features/>

    if running a new enough libvirt and QEMU

    Closes-bug: #1400315
    Change-Id: Icd0fe9bda6402d9bf7a4bab8077f0ce755703999

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-2 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.