Bug 592172

Summary: RFE: Add parameter to set guest machine type
Product: Red Hat Enterprise Linux 6 Reporter: zhanghaiyan <yoyzhang>
Component: python-virtinstAssignee: Cole Robinson <crobinso>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: berrange, dallan, ddumas, kxiong, llim, mhideo, syeghiay, xen-maint, zpeng
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
virt-install now includes the --machine option. This is useful for manually choosing the guest machine type to emulate.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 13:45:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 655920    

Description zhanghaiyan 2010-05-14 05:54:35 UTC
Description of problem:
virt-install doesn't provide any parameter to set guest machine type, which causes all guest xml config file use default value 'machine='rhel6.0.0'' 

Version-Release number of selected component (if applicable):
- kernel-2.6.32-25.el6.x86_64
- python-virtinst-0.500.3-2.el6.noarch
- qemu-kvm-0.12.1.2-2.53.el6.x86_64
- qemu-img-0.12.1.2-2.53.el6.x86_64
- libvirt-0.8.1-3.el6.x86_64


How reproducible:
Always

Steps to Reproduce:
1. # virt-install -n rhel55-i386 -r 2048 -l http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-5-Server/U5/i386/os/ -f /var/lib/libvirt/images/rhel55-i386.img
Starting install...
Retrieving file .treeinfo...                                                                                                          |  876 B     00:00 ... 
Retrieving file vmlinuz...                                                                                                            | 3.6 MB     00:00 ... 
Retrieving file initrd.img...                                                                                                         |  14 MB     00:00 ... 
Creating domain...  
2. # virsh dumpxml rhel55-i386
<domain type='kvm' id='2'>
  <name>rhel55-i386</name>
  <uuid>41fdcbb2-f6cf-cb03-e6c8-203e48cc0d9b</uuid>
  <memory>2097152</memory>
  <currentMemory>2097152</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='rhel6.0.0'>hvm</type>
................
  
Actual results:
Because no parameter to set guest machine type, rhel55 guest is defined as machine='rhel6.0.0' defautly. 

Expected results:
Provide parameter to set guest machine types, and give some value example:
# /usr/libexec/qemu-kvm -M ?
Supported machines are:
pc-0.12    Standard PC
pc-0.11    Standard PC, qemu 0.11
pc-0.10    Standard PC, qemu 0.10
isapc      ISA-only PC
pc         RHEL 6.0.0 PC (alias of rhel6.0.0)
rhel6.0.0  RHEL 6.0.0 PC (default)
rhel5.5.0  RHEL 5.5.0 PC
rhel5.4.4  RHEL 5.4.4 PC
rhel5.4.0  RHEL 5.4.0 PC

Additional info:
The same problem also appears when using python-virtinst to import a image to generate a guest

Comment 2 RHEL Program Management 2010-05-14 07:31:15 UTC
This feature request did not get resolved in time for Feature Freeze
for the current Red Hat Enterprise Linux release and has now been
denied. You may re-open your request by requesting your support
representative to propose it for the next release.

Comment 3 Daniel Berrangé 2010-05-14 09:53:36 UTC
Exposing it in virt-install is reasonable, but I think we should be wary of exposing machine type in the UI for virt-manager since I think it will seriously confuse users. With machine types like 'rhel-5.4.0', people will very likely think they should be making this match the OS version of their guest, when in fact this is refering to the host ABI & nothing todo with guest OS.

Comment 5 Cole Robinson 2010-06-22 14:36:46 UTC
Not sure why this is marked as 6.0, it's not hugely important IMO. Moving to 6.1

Comment 7 Cole Robinson 2010-12-07 15:00:59 UTC
--machine options added for virt-install:

http://hg.fedorahosted.org/hg/python-virtinst/rev/6d0e9e6adda1

Maybe for virt-manager we can only expose the machine type if using a non-intel arch.

Comment 8 Cole Robinson 2011-01-14 22:08:46 UTC
Fix built in python-virtinst-0.500.5-1.el6

Comment 10 koka xiong 2011-01-19 03:35:49 UTC
Verified with python-virtinst-0.500.5-1.el6
1.Run virt-install --help
 Virtualization Platform Options:
    --machine=MACHINE   The machine type to emulate
2.Run  virt-install -n rhel55-i386 -r 2048 -l http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-5-Server/U5/i386/os/ --disk path=/var/lib/libvirt/images/rhel55-i386.img,size=6 --machine=rhel5.5.0
3.virsh dump-xml rhel55-i386
<os>
    <type arch='x86_64' machine='rhel5.5.0'>hvm</type>
    <boot dev='hd'/>
  </os>

Verification is passed

Comment 11 zhe peng 2011-04-15 09:58:33 UTC
verified this bug with:
Linux localhost.localdomain 2.6.32-130.el6.x86_64 #1 SMP Tue Apr 5 19:58:31 EDT
2011 x86_64 x86_64 x86_64 GNU/Linux

python-virtinst-0.500.5-3.el6.noarch
libvirt-0.8.7-17.el6.x86_64

passed.

Comment 13 Michael Hideo 2011-05-16 04:28:35 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
* virt-install now includes the --machine option. This is useful for manually choosing the guest machine type to emulate. (BZ#592172)

Comment 14 Michael Hideo 2011-05-16 21:45:48 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-* virt-install now includes the --machine option. This is useful for manually choosing the guest machine type to emulate. (BZ#592172)+virt-install now includes the --machine option. This is useful for manually choosing the guest machine type to emulate.

Comment 15 errata-xmlrpc 2011-05-19 13:45:17 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0636.html