Skip to content

Conversation

@kiwiflyer
Copy link
Contributor

Description

Windows has support for several paravirt features that it will use when running on Hyper-V, Microsoft's hypervisor. These features are called enlightenments. Many of the features are similar to paravirt functionality that exists with Linux on KVM (virtio, kvmclock, PV EOI, etc.)

Nowadays QEMU/KVM can also enable support for several Hyper-V enlightenments. When enabled, Windows VMs running on KVM will use many of the same paravirt optimizations they would use when running on Hyper-V.

A number of years ago, a PR was introduced that added a good portion of the code to enable this feature set, but it was never completed. This PR enables the existing features. The previous patch set detailed in #1013 also included the tests.

By selecting Windows PV, the enlightenment additions will be applied to the libvirt configuration. This is support on Windows Server 2008 and beyond, so all currently supported versions of Windows Server.

In our testing, we've seen benchmark improvements of around 20-25% running on Centos 7 hosts and it is also supported on Centos/RHEL 6.5 and later. Testing on Ubuntu would be appreciated.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

How Has This Been Tested?

We've tested this in a lab and QA environment. I'll post some screenshots related to the libvirt xml changes and also provide some performance metric information over the next 24 hours.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
    ##Testing:
  • I have added tests to cover my changes. (not required as the previous PR included the tests)
  • All relevant new and existing integration tests have passed.
  • A full integration testsuite with all test that can run on my environment has passed.

* features.addHyperVFeature(hyv);
* }
*/
//for rhel 6.5 and above, hyperv enlightenment feature is added
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @kiwiflyer!

Would you mind extracting the code 2105-2114 to a method, document it, and then create a unit test case?

This createVMFromSpec is too big already.

@borisstoyanov
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@borisstoyanov a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2326

@borisstoyanov
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

Copy link
Member

@GabrielBrascher GabrielBrascher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rafaelweingartner point (extract to a new method) seems fair to me. Code LGTM.
Thanks for the PR @kiwiflyer!

@blueorangutan
Copy link

Trillian test result (tid-3051)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 25545 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2870-t3051-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_multipleips_per_nic.py
Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 66 look OK, 3 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_nic_secondaryip_add_remove Error 32.63 test_multipleips_per_nic.py
test_03_vpc_privategw_restart_vpc_cleanup Failure 1143.81 test_privategw_acl.py
test_04_rvpc_network_garbage_collector_nics Failure 497.31 test_vpc_redundant.py

@kiwiflyer
Copy link
Contributor Author

Ok, thanks for the feedback guys. I'll refactor this when I have some time later this week.

Copy link
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@rohityadavcloud rohityadavcloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@kiwiflyer
Copy link
Contributor Author

libvirt XML when enabled -
windows_pv_with_hyperv_on_kvm

@kiwiflyer
Copy link
Contributor Author

libvirt XML when disabled -
non_windows_pv

}

protected void enlightenWindowsVm(VirtualMachineTO vmTO, FeaturesDef features) {
// If OS is Windows PV, then enable the features. Features supported on Windows 2008 and later
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nit - Fix indent of comment to match that of statements inside method.

@rohityadavcloud
Copy link
Member

@kiwiflyer can you see travis error and fix the checkstyle issue.

@rohityadavcloud
Copy link
Member

@kiwiflyer still the same error, please check your changes:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:check (cloudstack-checkstyle) on project cloud-plugin-hypervisor-kvm: Failed during checkstyle execution: There is 1 error reported by Checkstyle 8.7 with cloud-style.xml ruleset. -> [Help 1]

@kiwiflyer kiwiflyer closed this Oct 19, 2018
@kiwiflyer kiwiflyer reopened this Oct 19, 2018
@andrijapanic-dont-use-this-one

Simon, a question here (since we have been using this internally in production for 1.5+years, but never pushed upstream...)

Why don't implement this on all Windows* OS types, not just Windows PV - reason being, that, afaik, this is not related only to paravirtualization (Windows PV vs "regular" WIndows OS type in CloudStack), and the main reason for us was NOT the performance (which is there, as you described) - but mainly to avoid the very frequent BSOD with Windows 2008 with heavily loaded MSSQL servers and such.

I believe it makes sense to implement for all OS types matching "Windows*"

And we have been using this on Ubuntu 14.04 hosts all the time (means tested on Ubuntu, as you asked)

hv_relaxed vs. BSOD - slide 15:
https://www.linux-kvm.org/images/0/0a/2012-forum-kvm_hyperv.pdf

@kiwiflyer
Copy link
Contributor Author

@andrijapanic I'm open to changing it to use all Windows OS types. My mine reason for picking one was some backwards compatibility. At least in the KVM world, I'm unsure why we continue to maintain tons of different OS types/names, as running any OS without virtio is extremely painful in terms of performance.

@andrijapanic-dont-use-this-one

I agree on VirtIO stuff absolutely. It's just that, even with all FAQ and so on, still end-user sometimes continue to use specific a Windows OS type instead of Windows PV, so it makes sense to solve all Windows OS types with this nice patch.

As for future support of OS types inside ACS, that is a good point, but doesn't warrant not applying patch for all of Win OS types, in my opinion.

@rohityadavcloud
Copy link
Member

@kiwiflyer I'll proceed with merging as I agree that for sake of backward compatibility let's avoiding having the feature enabled by default for any windows guest. If we decide to make it available for all windows guests, please submit another PR separately. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants