Bug 676995

Summary: virt-install: using --vcpus with --check-cpu option will cause error
Product: Red Hat Enterprise Linux 6 Reporter: Nan Zhang <nzhang>
Component: python-virtinstAssignee: Cole Robinson <crobinso>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 6.1CC: dallan, dyuan, llim, mhideo, mjenner, syeghiay, xen-maint, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
The %d string format was being used in the --check-cpu error message causing an incorrect error message to display to the user. This fix uses the correct %s numeric format resulting in the correct error message to display.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 13:43:07 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:

Description Nan Zhang 2011-02-12 12:28:00 UTC
Description of problem:
Sat, 12 Feb 2011 07:03:48 DEBUG    Launched with command line:
/usr/sbin/virt-install -n demo1 --vcpus=1 --check-cpu -r 1024 --vnc -f /var/lib/libvirt/images/demo1.img -s 5 -l http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-6/6.0/Server/x86_64/os/ --noreboot --debug
Sat, 12 Feb 2011 07:03:48 DEBUG    Requesting libvirt URI default
Sat, 12 Feb 2011 07:03:48 DEBUG    Received libvirt URI qemu:///system
Sat, 12 Feb 2011 07:03:48 DEBUG    Requesting virt method 'default', hv type 'default'.
Sat, 12 Feb 2011 07:03:48 DEBUG    Received virt method 'hvm'
Sat, 12 Feb 2011 07:03:48 DEBUG    Hypervisor name is 'kvm'
Sat, 12 Feb 2011 07:03:48 ERROR    %d format: a number is required, not str
Sat, 12 Feb 2011 07:03:48 DEBUG    Traceback (most recent call last):
  File "/usr/sbin/virt-install", line 1274, in <module>
    sys.exit(main())
  File "/usr/sbin/virt-install", line 1259, in main
    guest = build_guest_instance(conn, options)
  File "/usr/sbin/virt-install", line 970, in build_guest_instance
    cli.get_vcpus(options.vcpus, options.check_cpu, guest)
  File "/usr/lib/python2.6/site-packages/virtinst/cli.py", line 733, in get_vcpus
    "but performance will be poor. ") % (vcpus, cpu_num)
TypeError: %d format: a number is required, not str

Version-Release number of selected component (if applicable):
python-virtinst-0.500.5-1.el6.noarch

How reproducible:
Always

Steps to Reproduce:
# virt-install -n demo1 --vcpus=1 --check-cpu -r 512 -f /var/lib/libvirt/images/demo1.img -s 5 -l http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-6/6.0/Server/x86_64/os/ --noreboot --debug
  
Actual results:
See detailed debug info.

Expected results:
Support to install with the 2 mixed options.

Additional info:

Comment 1 Brock Organ 2011-03-01 14:42:54 UTC
Reporter,

Could I please ask you to provide a priority assessment (set the priority field to one of urgent/high/medium/low) for the impact of this issue?  This will help us prioritize this issue with our other outstanding bugs for the current release cycle ...

Regards,

Brock

Comment 2 Cole Robinson 2011-03-02 21:22:58 UTC
Fixed upstream:

http://hg.fedorahosted.org/hg/python-virtinst/rev/cdfd4ebd2233

Comment 3 Cole Robinson 2011-03-10 16:38:00 UTC
Fixed in python-virtinst-0.500.5-2.el6

Comment 5 Nan Zhang 2011-03-16 04:58:03 UTC
I just set 1 virtual cpu that less than physical cpus, but still has error prompts, maybe need another patch.


# virt-install -n demo1 --vcpus=1 --check-cpu -r 512 -f /var/lib/libvirt/images/demo1.img -s 5 -l http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-6/6.0/Server/x86_64/os/ --noreboot --debug
Wed, 16 Mar 2011 12:44:03 DEBUG    Launched with command line:
/usr/sbin/virt-install -n demo1 --vcpus=1 --check-cpu -r 512 -f /var/lib/libvirt/images/demo1.img -s 5 -l http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-6/6.0/Server/x86_64/os/ --noreboot --debug
Wed, 16 Mar 2011 12:44:03 DEBUG    Requesting libvirt URI default
Wed, 16 Mar 2011 12:44:03 DEBUG    Received libvirt URI qemu:///system
Wed, 16 Mar 2011 12:44:03 DEBUG    Requesting virt method 'default', hv type 'default'.
Wed, 16 Mar 2011 12:44:03 DEBUG    Received virt method 'hvm'
Wed, 16 Mar 2011 12:44:03 DEBUG    Hypervisor name is 'kvm'
Wed, 16 Mar 2011 12:44:03 DEBUG    DISPLAY is set: graphics defaulting to VNC.
Wed, 16 Mar 2011 12:44:03 ERROR    You have asked for more virtual CPUs (1) than there are physical CPUs (2) on the host. This will work, but performance will be poor.  (Use --prompt or --force to override)

Comment 6 Suzanne Logcher 2011-03-28 19:55:04 UTC
Since RHEL 6.1 External Beta has begun, and this bug remains 
unresolved, it has been rejected as it is not proposed as an 
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 2011-03-30 18:49:11 UTC
Should be fixed in python-virtinst-0.500.5-3.el6

Comment 8 zhe peng 2011-03-31 08:52:20 UTC
#rpm -qa|grep python-virtinst
python-virtinst-0.500.5-3.el6.noarch
#virt-install -n demo --vcpus=1 --check-cpu -r 1024 --vnc -l http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-6/6.0/Server/x86_64/os/ --noreboot --debug
Thu, 31 Mar 2011 12:11:08 DEBUG    Launched with command line:
/usr/sbin/virt-install -n demo --vcpus=1 --check-cpu -r 1024 --vnc -f /tmp/test.img -s 5 -l http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-6/6.0/Server/x86_64/os/ --noreboot --debug
Thu, 31 Mar 2011 12:11:08 DEBUG    Requesting libvirt URI default
Thu, 31 Mar 2011 12:11:08 DEBUG    Received libvirt URI qemu:///system
Thu, 31 Mar 2011 12:11:08 DEBUG    Requesting virt method 'default', hv type 'default'.
Thu, 31 Mar 2011 12:11:08 DEBUG    Received virt method 'hvm'
Thu, 31 Mar 2011 12:11:08 DEBUG    Hypervisor name is 'kvm'
Thu, 31 Mar 2011 12:11:09 DEBUG    DistroInstaller location is a network source.
Thu, 31 Mar 2011 12:11:09 DEBUG    Attempting to detect distro:
Thu, 31 Mar 2011 12:11:09 DEBUG    Fetching URI: http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-6/6.0/Server/x86_64/os/.treeinfo
Thu, 31 Mar 2011 12:11:09 DEBUG    Saved file to /var/tmp/virtinst-.treeinfo.AKP8XX
Thu, 31 Mar 2011 12:11:09 DEBUG    Guest.has_install_phase: True

Starting install...
Thu, 31 Mar 2011 12:11:09 DEBUG    Attempting to detect distro:
Thu, 31 Mar 2011 12:11:09 DEBUG    Fetching URI: http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-6/6.0/Server/x86_64/os/.treeinfo
Thu, 31 Mar 2011 12:11:09 DEBUG    Saved file to /var/lib/libvirt/boot/virtinst-.treeinfo.Y270V8
Retrieving file .treeinfo...                             | 3.3 kB     00:00 ... 
Thu, 31 Mar 2011 12:11:09 DEBUG    Fetching URI: http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-6/6.0/Server/x86_64/os/images/pxeboot/vmlinuz
Thu, 31 Mar 2011 12:11:10 DEBUG    Saved file to /var/lib/libvirt/boot/virtinst-vmlinuz.4OPLId
Retrieving file vmlinuz...                               | 7.2 MB     00:00 ... 
Thu, 31 Mar 2011 12:11:10 DEBUG    Fetching URI: http://download.englab.nay.redhat.com/pub/rhel/released/RHEL-6/6.0/Server/x86_64/os/images/pxeboot/initrd.img
Thu, 31 Mar 2011 12:11:11 DEBUG    Saved file to /var/lib/libvirt/boot/virtinst-initrd.img.s_53GM
Retrieving file initrd.img...                            |  57 MB     00:01 ... 
Thu, 31 Mar 2011 12:11:11 DEBUG    Auto detected OS type as: linux
Thu, 31 Mar 2011 12:11:11 DEBUG    Auto detected OS variant as: rhel6
Creating storage file test.img                           | 5.0 GB     00:00     
Thu, 31 Mar 2011 12:11:11 DEBUG    Generated install XML: 
.........

Thu, 31 Mar 2011 12:11:11 DEBUG    Generated boot XML: 
.........
Creating domain...                                       |    0 B     00:00     
Thu, 31 Mar 2011 12:11:12 DEBUG    Started guest, connecting to console if requested
Thu, 31 Mar 2011 12:11:12 DEBUG    Launching console callback
connect : Connection refused
Thu, 31 Mar 2011 12:39:32 DEBUG    Removing /var/lib/libvirt/boot/virtinst-vmlinuz.4OPLId
Thu, 31 Mar 2011 12:39:32 DEBUG    Removing /var/lib/libvirt/boot/virtinst-initrd.img.s_53GM
Domain creation completed. You can restart your domain by running:
  virsh --connect qemu:///system start demo

no error occur,the bug fixed,change to Verified

Comment 9 zhe peng 2011-04-15 09:53:54 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 11 Michael Hideo 2011-05-16 23:48:15 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:
The %d string format was being used in the --check-cpu error message causing an incorrect error message to display to the user. This fix uses the correct %s numeric format resulting in the correct error message to display.

Comment 12 errata-xmlrpc 2011-05-19 13:43:07 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