Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 725080 - [RH Engineering 6.5 Feature] virt-manager should default CPU type to host's level for maximum performance
Summary: [RH Engineering 6.5 Feature] virt-manager should default CPU type to host's l...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-manager
Version: 6.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: beta
: 6.5
Assignee: Gunannan Ren
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 724866 725084 (view as bug list)
Depends On: 824989
Blocks: 896704 830946 833603 835616 840699 848463 853338 922719
TreeView+ depends on / blocked
 
Reported: 2011-07-22 18:58 UTC by Andrew Cathrow
Modified: 2015-09-28 02:20 UTC (History)
18 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
: 853338 922719 (view as bug list)
Environment:
Last Closed: 2013-06-24 14:09:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Andrew Cathrow 2011-07-22 18:58:17 UTC
We want to ensure that out-of-the-box without tuning KVM guests run at the optimum speed.

Currently we default to lowest (most compatible) option.

We should have either match the host (eg Nehalem, Westmere, etc) or another option would be the suggestion in bz 700272

Comment 1 Cole Robinson 2011-07-22 20:18:37 UTC
This isn't what Dor suggested in that thread. CCing him

AIUI he said a reasonable default would be to pick some baseline CPU (possibly 2 baseline CPUs, one Intel one AMD) that would give some performance improvements  over the default qemu64-whatever model, and at the same time be nothing too new + fancy so it's very likely our users all have HW that matches the feature flags. This way we get a performance boost, but in the majority of cases users can still migrate guests between their non-uniform hardware.

I'm not saying that's what needs to be done, just that's what Dor seemed to be recommending. For this case I would need input from KVM guys as to what exactly the default CPU model(s) should be.

But whether we use that idea or -cpu host or something else needs to be decided by virt-devel + PM + marketing + performance guys IMO

The main problem here is that any model we choose which isn't the default qemu model is probably going to cause migration issues for someone. Which means someone will eventually file a BZ my way. Before we make any change this stuff needs to be thoroughly documented:

- What the previous default was, why it was the default, its impact on migration and performance
- What the new default is, why it changed, its impact on migration and performace
- What if a migration that worked with a VM created on 6.1 doesn't work with a VM created on 6.2? What is the error the user will see? Are there solutions for this problem, and if so are they different depending on guest OS? How can they avoid this problem for future migrations?
- What do we support for migration? Machines must be same exact hw? same CPU vendor?

Maybe some/all of this is already available.

When all that info is in place, I have no problem changing the virt-manager default to whatever is decided. It's just that eventually the default change will cause migration issues for someone, and when they file a bug I want to be able to point them at the docs and close the bug (provided its not a _real_ bug :) )

Also, it will probably be a bit more work than just changing the default in virt-manager, we will need to provide some way for users to override the default if migration compatibility (or improved performance) is more important to them. Simplest way would be to allow users to manually choose what CPU model to use by default, more user friendly UI would probably be some prechosen list of CPU options that range from maximum migration compatibility (qemu64) to maximum performance (-cpu host). This doesn't need to be perfect for 6.2 as long as things are documented clearly.

Comment 2 Andrew Cathrow 2011-07-22 21:46:08 UTC
We should optimize for the most common case.
Right now that's a user who wants to run a VM locally in which case they will got sub-par performance from KVM.

If a user want to have migration there's more to do than match the CPU, they have to setup shared luns/clustered file systems, ensure they have consistent network topology, etc, etc. Checking the CPU level as part of that checklist is a very small price to pay for a smaller number of users who'll need it. 
Also the most common scenario for clustered VMs is to have a cluster of identical machines so the chances are selecting Nehalem as the cpu would work in the whole cluster.

I DON'T think we should use -cpu host, the suggested change in 700272 is different from the qemu-kvm "-cpu host" option. 

Answering your specific questions

- What the previous default was, why it was the default, its impact on
migration and performance

Previous default is qemu64 which basically lobotomizes a modern CPU to look like a pentium 4. Bad for performance but means that a virtual machine can migrate from a Core2Due from 2008 to a modern Westmere machine can still get the same poor performance.

- What the new default is, why it changed, its impact on migration and
performace

New default should be the maximum supported by the machine - either based on copying the CPU type or using the #700272 approach.
For migration it means that *IF* the user wants to migrate the VM then they'll need to either make sure the hosts are "compatible" or lower the cpu type.

- What if a migration that worked with a VM created on 6.1 doesn't work with a
VM created on 6.2? What is the error the user will see? Are there solutions for
this problem, and if so are they different depending on guest OS? How can they
avoid this problem for future migrations?

The CPU's won't match. Same kind of errors they'd get if they mismatched other resources.

- What do we support for migration? Machines must be same exact hw? same CPU
vendor?
 
No they'd have to be in the same family and of the same class or higher
eg. An Opteron G2 could migrate to a G3 but not to a G1
eg. An Intel Nehalem could migrate to a Westmere but not a core2Duo

Virt-Manager should 'just work' out of the box as fast as possible with little to no tuning.

Comment 3 Cole Robinson 2011-07-22 22:38:40 UTC
(In reply to comment #2)
> We should optimize for the most common case.
> Right now that's a user who wants to run a VM locally in which case they will
> got sub-par performance from KVM.
> 

Not sure if the implication here is that I was implying otherwise, because I wasn't trying to convince one way or the other. I'm just saying all the relevant people need to get together, agree on what our story is, and document the hell out of it.

Personally, I think it's pretty reasonable to tell people that if they want to use migration by default they need to a) have uniform hardware or b) plan ahead of time before installing their guests and set them up accordingly.

> If a user want to have migration there's more to do than match the CPU, they
> have to setup shared luns/clustered file systems, ensure they have consistent
> network topology, etc, etc. Checking the CPU level as part of that checklist is
> a very small price to pay for a smaller number of users who'll need it. 
> Also the most common scenario for clustered VMs is to have a cluster of
> identical machines so the chances are selecting Nehalem as the cpu would work
> in the whole cluster.
> 

There is a difference here though between the rest of migration config and a VMs CPU. You can always move storage and network config around transparently to a VM. But you CANT change the CPU after initial guest creation, correct? There's a big difference between "that won't work, move the disk image to shared storage" and 'that won't work, you will need to recreate the VM with a different CPU'

> I DON'T think we should use -cpu host, the suggested change in 700272 is
> different from the qemu-kvm "-cpu host" option. 
> 
> Answering your specific questions
<snip>

I appreciate the answers, but the motivation wasn't really my own edification. I was saying that's what our documentation would need to adequately cover if we are going to change the default. So things like detailed copies of error messages, etc. Your answers are a start but understandably the end user docs should be much more thorough. I'm pretty sure changing the default will piss off some release-note-ignoring user, so we need docs here for CYA at least.

Comment 4 Cole Robinson 2011-07-24 00:43:40 UTC
*** Bug 724866 has been marked as a duplicate of this bug. ***

Comment 5 Dave Allan 2011-07-25 02:56:49 UTC
(In reply to comment #2)
> I DON'T think we should use -cpu host, the suggested change in 700272 is
> different from the qemu-kvm "-cpu host" option. 

Agreed.  The 700272 approach should provide the highest performance on the host on which the guest was started as well as allowing libvirt to validate migration targets and fail the migration if the target host has an unsuitable CPU.  We must, of course, also provide a very concrete error message explaining what's wrong if the user attempts to migrate to a less capable CPU and we reject the migration for that reason.

> New default should be the maximum supported by the machine - either based on
> copying the CPU type or using the #700272 approach.
> For migration it means that *IF* the user wants to migrate the VM then they'll
> need to either make sure the hosts are "compatible" or lower the cpu type.

I agree with this logic.  IMO, it's a lot easier to throw an error saying, sorry, we can't migrate your VM to that nasty old box in the corner because it's got an ancient CPU than it is to try to ask users up front whether they want maximum performance or the broadest possible set of migration targets, although I could be convinced that it's possible to do UI presenting the user with that choice in a desirable way.

Comment 6 RHEL Program Management 2011-10-07 16:11:09 UTC
Since RHEL 6.2 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 7 Cole Robinson 2012-02-08 00:51:52 UTC
*** Bug 725084 has been marked as a duplicate of this bug. ***

Comment 10 RHEL Program Management 2012-07-10 07:46:19 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 11 RHEL Program Management 2012-07-11 01:56:11 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 14 Dave Allan 2012-09-04 17:41:59 UTC
Jiri, what's the domain XML to copy the host's capabilities?

Comment 15 Jiri Denemark 2012-09-06 09:45:36 UTC
The XML element which tells libvirt to use a CPU model as close as possible to
host CPU and which allows libvirt to check the CPU during migration is

    <cpu mode='host-model'/>

Comment 18 Larry Troan 2012-10-11 17:54:08 UTC
Dave Allan has commented that this request is more difficult than he'd initially scoped and has pushed it to 6.5 for consideration.

Comment 20 Martin Kletzander 2013-03-28 09:57:15 UTC
One thing occurred on my mind when reading this BZ.
How about letting the user decide with a simple radio button?

  Set CPU of the guest to maximize:
   (a) migration compatibility [default]
   (b) raw performance

There would be also help strings describing that for detailed CPU specification, the user can customize the configuration before install and what each of these options do.  (a) would be what virt-manager does till now, (b) would do the same as clicking the 'Copy host CPU specification' in the Processor settings.

Just my $0.02.

Comment 22 Gunannan Ren 2013-04-17 14:33:31 UTC
https://www.redhat.com/archives/virt-tools-list/2013-April/msg00178.html
The patches have been sent out

Comment 23 Gunannan Ren 2013-04-26 07:43:13 UTC
The 'host-passthrough' is not an option. libvirt 'taints' the VM when using this mode, so virt-manager is not going to place it on UI.

After a discussion in upstream
https://www.redhat.com/archives/virt-tools-list/2013-April/msg00207.html

the 'host-model' is not mature enough to be used in UI currently. The reverting patch has been sent out to revert the above patches.

So keep original, re-evaluate the possibility of change later.
Thanks for Cole, Martin and Jiri's suggestion.

Comment 24 Dave Allan 2013-06-24 14:09:47 UTC
(In reply to Gunannan Ren from comment #23)
> The 'host-passthrough' is not an option. libvirt 'taints' the VM when using
> this mode, so virt-manager is not going to place it on UI.
> 
> After a discussion in upstream
> https://www.redhat.com/archives/virt-tools-list/2013-April/msg00207.html
> 
> the 'host-model' is not mature enough to be used in UI currently. The
> reverting patch has been sent out to revert the above patches.
> 
> So keep original, re-evaluate the possibility of change later.
> Thanks for Cole, Martin and Jiri's suggestion.

Given that, I think that we should not change this behavior in RHEL6, but I agree that this is a useful RFE and should be continued upstream and in future RHEL versions.


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