Bug 607091 - virt-install doesn't check for existing file before over-writing it as install image
virt-install doesn't check for existing file before over-writing it as instal...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-virtinst (Show other bugs)
6.1
All Linux
low Severity medium
: rc
: ---
Assigned To: Cole Robinson
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-23 03:51 EDT by Jes Sorensen
Modified: 2011-06-09 23:40 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Unless the file image is already managed by libvirt, when a user specifies an existing file image with virt-install there is no warning displayed telling the user that the file will be overwritten. With this change the user is now prompted if the file already exists giving the user an opportunity to make any necessary corrections before overwriting the file image.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-19 09:45:31 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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0636 normal SHIPPED_LIVE python-virtinst bug fix and enhancement update 2011-05-18 13:55:48 EDT

  None (edit)
Description Jes Sorensen 2010-06-23 03:51:56 EDT
Description of problem:
When using virt-install and specifying an existing file image, you
get no warning that you are about to overwrite an existing file - unless
the file is an image already managed by libvirt.

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

How reproducible:
Every time - see below

Steps to Reproduce:
1. Install guest using virt-install
2. In virt-manager delete guest, but do not check the box to remove image
3. Install another guest using virt-install into the same file image
4. Or see example below.
  
Actual results:
virt-install happily launches the install onto the existing file. If it 
is an old previously installed image, for instance with XP that failed
after stage, it will boot it as it is in stage2 of the XP install rather
than start over again.

Expected results:


Additional info:
[root@batcave ~]# dd if=/dev/zero of=/var/lib/libvirt/images/arm2.img bs=1G count=10
10+0 records in
10+0 records out
10737418240 bytes (11 GB) copied, 169.341 s, 63.4 MB/s
[root@batcave ~]# virt-install --prompt --os-type=windows --os-variant=winxpWhat is the name of your virtual machine? blahblah
 How much RAM should be allocated (in megabytes)? 1024
 What would you like to use as the disk (file path)? /var/lib/libvirt/images/arm2.img
 What is the install CD-ROM/ISO or URL? /home/isos/en_windows_xp_professional_with_service_pack_3_x86_cd_x14-80428.iso
 

Starting install...
Creating domain...                                       |    0 B     00:00     
Domain installation still in progress. Waiting for installation to complete.
Comment 2 RHEL Product and Program Management 2010-06-23 04:23:13 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 3 RHEL Product and Program Management 2010-07-15 10:55:29 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 4 Jes Sorensen 2010-07-16 03:08:14 EDT
Since it didn't make the 6.0 cute, please make sure to fix this before 6.1.
It's a very annoying bug.

Thanks,
Jes
Comment 6 Cole Robinson 2010-12-07 19:04:52 EST
Fixed upstream:

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

$ ./virt-install --connect test:///default --prompt --name foo --ram 64 --pxe --hvm
What would you like to use as the disk (file path)? 
README
This will overwrite the existing path '/mnt/storage.bos/boston/crobinso/sandbox/upstream/python-virtinst/virtinst.upstream/README'
Do you really want to use this disk (yes or no) 
no
What would you like to use as the disk (file path)?
Comment 7 Cole Robinson 2011-01-14 17:09:24 EST
Fix built in python-virtinst-0.500.5-1.el6
Comment 9 koka xiong 2011-01-19 01:07:15 EST
Verified with python-virtinst-0.500.5-1.el6 passed.
1.virt-install --connect test:///default --prompt --name foo --ram 64 --pxe --hvm
2.What would you like to use as the disk (file path)? 
/var/lib/libvirt/images/rhel55-i386.img
This will overwrite the existing path '/var/lib/libvirt/images/rhel55-i386.img'
Do you really want to use this disk (yes or no) 
no
What would you like to use as the disk (file path)? 
So it will check the existing file before over-writing it.
Verification is passed.
Comment 10 zhe peng 2011-04-15 06:11:06 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 12 Michael Hideo 2011-05-12 20:17:31 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:
* Unless the file image is already managed by libvirt, when a user specifies an existing file image with virt-install there is no warning displayed telling the user that the file will be overwritten. With this change the user is now prompted if the file already exists giving the user an opportunity to make any necessary corrections before overwriting the file image. (BZ#607091)
Comment 13 Michael Hideo 2011-05-16 17:44:53 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 @@
-* Unless the file image is already managed by libvirt, when a user specifies an existing file image with virt-install there is no warning displayed telling the user that the file will be overwritten. With this change the user is now prompted if the file already exists giving the user an opportunity to make any necessary corrections before overwriting the file image. (BZ#607091)+Unless the file image is already managed by libvirt, when a user specifies an existing file image with virt-install there is no warning displayed telling the user that the file will be overwritten. With this change the user is now prompted if the file already exists giving the user an opportunity to make any necessary corrections before overwriting the file image.
Comment 14 errata-xmlrpc 2011-05-19 09:45:31 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.