Bug 598170 - virt-install: unfriendly errors for install url in interactive mode
virt-install: unfriendly errors for install url in interactive mode
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-virtinst (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Cole Robinson
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-31 12:20 EDT by Michael S. Tsirkin
Modified: 2011-05-19 09:45 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
virt-install would give the user an unclear error message and exit when given an invalid location to the installation tree. This forced the user to re-enter the installation command. This fix gives the user the appropriate error message and then prompts them for the valid location so the user does not have to re-enter the entire command.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-19 09:45:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael S. Tsirkin 2010-05-31 12:20:58 EDT
Description of problem:
trying to install a guest with --prompt,
when virt-manager is unhappy about url given,
it will exit with a traceback and without
much in the way of explanation.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
 
1. [root@virtlab16 mst]# virt-install --prompt
What is the name of your virtual machine? mst1
 How much RAM should be allocated (in megabytes)? 2000
 What would you like to use as the disk (file path)? /home/mst/vmgr.qcow2
 How large would you like the disk (/home/mst/vmgr.qcow2) to be (in gigabytes)? 100
 What is the install CD-ROM/ISO or URL? http://download.devel.redhat.com/rel-eng/latest-RHEL6.0/6/Server/x86_64/os/images/boot.iso
 

Starting install...
ERROR    Invalid install location: Opening URL http://download.devel.redhat.com/rel-eng/latest-RHEL6.0/6/Server/x86_64/os/images/boot.iso failed.
Domain installation does not appear to have been
 successful.  If it was, you can restart your domain
 by running 'virsh start mst1'; otherwise, please
 restart your installation.
ERROR    Invalid install location: Opening URL http://download.devel.redhat.com/rel-eng/latest-RHEL6.0/6/Server/x86_64/os/images/boot.iso failed.
Traceback (most recent call last):
  File "/usr/sbin/virt-install", line 1054, in <module>
    main()
  File "/usr/sbin/virt-install", line 936, in main
    start_time, guest.start_install)
  File "/usr/sbin/virt-install", line 978, in do_install
    dom = install_func(conscb, progresscb, wait=(not wait))
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 970, in start_install
    self._prepare_install(meter)
  File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 768, in _prepare_install
    meter = meter)
  File "/usr/lib/python2.6/site-packages/virtinst/DistroInstaller.py", line 252, in prepare
    self._prepare_kernel_and_initrd(guest, distro, meter)
  File "/usr/lib/python2.6/site-packages/virtinst/DistroInstaller.py", line 194, in _prepare_kernel_and_initrd
    type=self.os_type, distro=distro)
  File "/usr/lib/python2.6/site-packages/virtinst/OSDistro.py", line 144, in acquireKernel
    scratchdir, type, distro)
  File "/usr/lib/python2.6/site-packages/virtinst/OSDistro.py", line 119, in _acquireMedia
    raise ValueError, _("Invalid install location: ") + str(e)
ValueError: Invalid install location: Opening URL http://download.devel.redhat.com/rel-eng/latest-RHEL6.0/6/Server/x86_64/os/images/boot.iso failed.

2. verify wget has no trouble opening the URL:
# wget http://download.devel.redhat.com/rel-eng/latest-RHEL6.0/6/Server/x86_64/os/images/boot.iso
--2010-05-31 12:09:44--  http://download.devel.redhat.com/rel-eng/latest-RHEL6.0/6/Server/x86_64/os/images/boot.iso
Resolving download.devel.redhat.com... 10.10.36.199
Connecting to download.devel.redhat.com|10.10.36.199|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 195035136 (186M) [application/octet-stream]
Saving to: “boot.iso.1”

 3% [=>                                                              ] 6,361,212   3.35M/s              ^


Actual results:

On error, exits immediately, so I have to rerun and retype
all input. Error 'URL could not  be opened' does not tell me
what it is looking for. Dumps traceback which is just confusing.

Expected results:
Should prompt to correct the URL, not exit.
Error message should tell me what is wrong.
User does not need to see internal traceback.

Additional info:
Comment 1 RHEL Product and Program Management 2010-05-31 12:35:48 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.
Comment 2 RHEL Product and Program Management 2010-07-15 10:07:14 EDT
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release. It has
been denied for the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **
Comment 3 Cole Robinson 2010-08-23 15:35:45 EDT
Thanks for the report, we no longer show a traceback for most error messages:

http://hg.fedorahosted.org/hg/python-virtinst/rev/1ce01e8c1ea4

Also, improve the URL error: 

http://hg.fedorahosted.org/hg/python-virtinst/rev/720c89205e84

the problem was that we expect the location to be a directory, so the error was odd. Now you'll get a message like 'the location must be the root directory of an install tree'

--prompt still doesn't validate the URL up front though, so that's still a TODO.
Comment 5 Cole Robinson 2010-12-07 19:02:54 EST
Fixed upstream:

http://hg.fedorahosted.org/hg/python-virtinst/rev/9ef709fe07e2

$ ./virt-install --connect test:///default --prompt --name foo --ram 64 --hvm --nodisks
What is the install CD-ROM/ISO or URL? 
http://ajjdjajdj.com
ERROR    Invalid install location: Opening URL http://ajjdjajdj.com failed.
What is the install CD-ROM/ISO or URL?
Comment 6 Cole Robinson 2011-01-14 17:09:14 EST
Fix built in python-virtinst-0.500.5-1.el6
Comment 8 koka xiong 2011-01-19 00:50:59 EST
Verified with python-virtinst-0.500.5-1.el6
1.virt-install --connect test:///default --prompt --name foo --ram 64 --hvm --nodisks
What is the install CD-ROM/ISO or URL? 
http://addd.com
ERROR    Invalid install location: Opening URL http://addd.com failed.
2.virt-install --prompt
What is the name of your virtual machine? 
da
How much RAM should be allocated (in megabytes)? 
1024
What would you like to use as the disk (file path)? 
/var/lib/libvirt/images/test.img
How large would you like the disk (/var/lib/libvirt/images/test.img) to be (in gigabytes)? 
1   
What is the install CD-ROM/ISO or URL? 
http://ddddfdfdfd
ERROR    Invalid install location: Opening URL http://ddddfdfdfd failed.
What is the install CD-ROM/ISO or URL? 
3.http://download.devel.redhat.com/rel-eng/latest-RHEL6.0/6/Server/x86_64/os/images/boot.iso
ERROR    Could not find an installable distribution at 'http://download.devel.redhat.com/rel-eng/latest-RHEL6.0/6/Server/x86_64/os/images/boot.iso'
The location must be the root directory of an install tree.

Verification is passed.
Comment 9 zhe peng 2011-04-15 05:59:38 EDT
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-12 20:02:23 EDT
    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 would give the user an unclear error message and exit when given an invalid location to the installation tree. This forced the user to re-enter the installation command. This fix gives the user the appropriate error message and then prompts them for the valid location so the user does not have to re-enter the entire command. (BZ#598170)
Comment 12 Michael Hideo 2011-05-16 17:45:10 EDT
    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 would give the user an unclear error message and exit when given an invalid location to the installation tree. This forced the user to re-enter the installation command. This fix gives the user the appropriate error message and then prompts them for the valid location so the user does not have to re-enter the entire command. (BZ#598170)+virt-install would give the user an unclear error message and exit when given an invalid location to the installation tree. This forced the user to re-enter the installation command. This fix gives the user the appropriate error message and then prompts them for the valid location so the user does not have to re-enter the entire command.
Comment 13 errata-xmlrpc 2011-05-19 09:45:29 EDT
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

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