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 607091 - virt-install doesn't check for existing file before over-writing it as install image
Summary: virt-install doesn't check for existing file before over-writing it as instal...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-virtinst
Version: 6.1
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Cole Robinson
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-23 07:51 UTC by Jes Sorensen
Modified: 2011-06-10 03:40 UTC (History)
6 users (show)

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.
Clone Of:
Environment:
Last Closed: 2011-05-19 13:45:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0636 0 normal SHIPPED_LIVE python-virtinst bug fix and enhancement update 2011-05-18 17:55:48 UTC

Description Jes Sorensen 2010-06-23 07:51:56 UTC
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 Program Management 2010-06-23 08:23:13 UTC
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 Program Management 2010-07-15 14:55:29 UTC
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 07:08:14 UTC
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-08 00:04:52 UTC
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 22:09:24 UTC
Fix built in python-virtinst-0.500.5-1.el6

Comment 9 koka xiong 2011-01-19 06:07:15 UTC
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 10:11:06 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 12 Michael Hideo 2011-05-13 00:17:31 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:
* 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 21:44:53 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 @@
-* 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 13:45:31 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


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