Bug 616728

Summary: v2v leave orphan guest images on the pool once stopped by the user
Product: Red Hat Enterprise Linux 5 Reporter: Mohua Li <moli>
Component: virt-v2vAssignee: Matthew Booth <mbooth>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.6CC: cshao, fnadge, hbrock, kxiong, leiwang, mbooth, mkenneth, moli, mshao, rjones, rwu
Target Milestone: rcKeywords: RHELNAK
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: virt-v2v-0.6.3-4.el5 Doc Type: Bug Fix
Doc Text:
Previously, incomplete files and temporary data were left on disk if a user interrupted the conversion process with Ctrl+c. This update resolves this issue and no more temporary data is left.
Story Points: ---
Clone Of: 616720 Environment:
Last Closed: 2011-01-13 18:28:24 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: 616720    
Bug Blocks:    

Comment 1 RHEL Program Management 2010-09-05 07:57:45 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. 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 2 Matthew Booth 2010-09-06 09:45:11 UTC
This is already upstream.

Comment 3 RHEL Program Management 2010-09-06 09:56:56 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. 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 4 RHEL Program Management 2010-09-07 11:56:55 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. 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 6 koka xiong 2010-10-09 05:42:48 UTC
Verified with virt-v2v-0.6.3-2.el5,press Ctrl+C,the image still exists on the pool
1. Run virt-v2v -ic xen+ssh://10.66.72.123 -op koka win2k8-r2
2.Press Ctrl+C to cancel conversion
virt-v2v: Received signal INT. Exiting.
3.# ll -h
total 30G
-rw------- 1 root root  10G Oct  8 13:17 ESXi4_Linux_ESX4.0-RHEL5.5-i386_ESX4.0-RHEL5.5-i386
-rw------- 1 root root  10G Oct  8 15:49 rhel4u8-64b-pv-raw-intel.img
-rw------- 1 root root 7.9G Oct  8 15:11 rhel4u8-64b-pv-raw-intel-new.img
-rw------- 1 root root 9.8G Oct  9 13:35 win2008-R2.img
The image still exists on the pool

4.Run virt-v2v -ic xen+ssh://10.66.72.123 -op koka win2k8-r2 again
virt-v2v: WARNING: storage volume win2008-R2.img already exists on the target. NOT copying it again. Delete the volume and retry to copy again.
No operating system could be detected inside this disk image.

This may be because the file is not a disk image, or is not a virtual machine
image, or because the OS type is not understood by virt-inspector.

If you feel this is an error, please file a bug report including as much
information about the disk image as possible.

Comment 7 Matthew Booth 2010-10-11 10:51:16 UTC
virt-v2v was actually only cleaning up RHEV storage during unclean shutdown. This patch applies this to libvirt volumes too:

http://www.redhat.com/archives/libguestfs/2010-October/msg00019.html

Comment 8 Mohua Li 2010-10-15 06:03:15 UTC
the fix is not good, test this on virt-v2v-0.6.3-3.el5, here is the details,

/usr/bin/virt-v2v -ic esx://10.66.72.124/?no_verify=1 -op v2v ESX3.5-RHEL3.9-32b


--------------------
ESX3.5-RHEL3.9-32b
--------------------
virt-v2v: Received signal INT. Exiting.

[root@localhost libvirt]# cd /var/lib/libvirt/images/v2v

[root@localhost v2v]# ls -lrt
total 906148
-rw------- 1 root root 10737418240 Oct 15 13:58 ESXi35U4_Linux_ESX35-RHEL3U9-i386_ESX35-RHEL3U9-i386
[root@localhost v2v]# date
Fri Oct 15 14:08:57 CST 2010


[root@localhost v2v]# virsh vol-list  v2v
Name                 Path                                    
-----------------------------------------
ESXi35U4_Linux_ESX35-RHEL3U9-i386_ESX35-RHEL3U9-i386 /var/lib/libvirt/images/v2v/ESXi35U4_Linux_ESX35-RHEL3U9-i386_ESX35-RHEL3U9-i386

Comment 9 Matthew Booth 2010-10-15 08:22:48 UTC
At what stage did you do Ctrl-C? Was it during the transfer of the data, or during the conversion? This fix will only remove the volume if the transfer was interrupted.

Comment 10 Rita Wu 2010-10-15 10:16:13 UTC
(In reply to comment #9)
> At what stage did you do Ctrl-C? Was it during the transfer of the data, or
> during the conversion? This fix will only remove the volume if the transfer was
> interrupted.

During transfer of the data, for we press ctrl-c immediate after running v2v, but the image still left on the pool.

# virt-v2v -ic xen+ssh://10.66.72.123 rhel5u4-32b-hv-raw-intel -op default
virt-v2v: Received signal INT. Exiting.

# virsh vol-list --pool default
Name                 Path                                    
-----------------------------------------
rhel5u4-32b-hv-raw-intel.img /var/lib/libvirt/images/rhel5u4-32b-hv-raw-intel.img

Comment 11 Mohua Li 2010-10-21 02:54:37 UTC
test on virt-v2v-0.6.3-4.el5, during transfer, press ctrl+c, won't left anything on the pool, so it's fixed,

--------------------
ESX3.5-RHEL3.9-32b
--------------------
virt-v2v: Received signal INT. Exiting.

[root@localhost libvirt]# 
[root@localhost libvirt]# 
[root@localhost libvirt]# virsh vol-list v2vshao
Name                 Path                                    
-----------------------------------------

going to change to verified,

Comment 12 Florian Nadge 2011-01-12 17:25:06 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:
Previously, incomplete files and temporary data were left on disk if a user interrupted the conversion process with Ctrl+c. This update resolves this issue and no more temporary data is left.

Comment 14 errata-xmlrpc 2011-01-13 18:28:24 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-0147.html