Description of problem: [RFE]virt-p2v should check whether guest with same name exist on target first then transfer the disk Version-Release number of selected component (if applicable): virt-v2v-0.8.9-2.el6.x86_64 RHEL6.4-20121212.1-Server-i386-P2V.iso How reproducible: 100% Steps to Reproduce: 1.Use virt-p2v to convert a physical machine,on the virt-p2v client GUI,type the guest name which already exists on target host. 2.Click convert.The conversion will begin,after spending a lot of time to transfer the whole disk,error shows:virt-v2v: libvirt error code: 9, message: operation failed: domain 'demo-test' already exists with uuid 40bf1863-1740-539c-88df-032a62cef740 3.Use virt-v2v to convert a guest with the name which already exists on target,it checks the target and quits instead of transferring the disk. # virt-v2v -ic qemu+ssh://10.66.6.128/system -os default -b br0 test root.6.128's password: virt-v2v: Domain test already exists on the target. Actual results: As steps describe. Expected results: virt-p2v works as virt-v2v,check whether guest with same name exist on target first then transfer the disk. Additional info:
Yup. virt-v2v does this, virt-p2v should do it too.
This request was not resolved in time for the current release. Red Hat invites you to ask your support representative to propose this request, if still desired, for consideration in the next release of Red Hat Enterprise Linux.
Although the bug mentions virt-p2v, in fact it's the job of virt-v2v to check on the target for the guest with the same name. (virt-p2v uses virt-v2v, so hopefully that will solve the problem for virt-v2v too.) I have adjusted the summary accordingly.
Patch posted: https://www.redhat.com/archives/libguestfs/2015-May/msg00010.html
Upstream commits: e7833a5eea350ca3579d1f9e6702e116b45572fc badfc2e9b2a56fd5bac849a6edca4fec823abeea
This fix introduced a memory leak. The memory leak is fixed by: https://github.com/libguestfs/libguestfs/commit/85347e32e02a412b8b17100b7eb5d39d1e83b66d
Tested with: virt-v2v-1.28.1-1.38.el7.x86_64 libguestfs-1.28.1-1.38.el7.x86_64 1.Make sure on my host,there is guest named "esx6.0-win2008-x86_64" exist. # virsh list --all Id Name State ---------------------------------------------------- 36 win7-vcenter running - esx6.0-win2008-i386 shut off - esx6.0-win2008-x86_64 shut off - p2v-network-test shut off - rhel6.7-x64 shut off - rhel7.1-x64 shut off 2.Use virt-v2v to convert guest which already exist on the host. # virt-v2v -ic vpx://root.72.112/data/10.66.72.49/?no_verify=1 -os default -b virbr0 --password-file /tmp/passwd2 esx6.0-win2008-x86_64 [ 0.0] Opening the source -i libvirt -ic vpx://root.72.112/data/10.66.72.49/?no_verify=1 esx6.0-win2008-x86_64 [ 1.0] Creating an overlay to protect the source from being modified [ 2.0] Opening the overlay [ 14.0] Initializing the target -o libvirt -os default virt-v2v: error: a libvirt domain called 'esx6.0-win2008-x86_64' already exists on the target. If using virt-v2v directly, use the '-on' option to select a different name. If using virt-p2v, select a different 'Name' in the 'Target properties'. Or delete the existing domain on the target using the 'virsh undefine' command. If reporting bugs, run virt-v2v with debugging enabled and include the complete output: virt-v2v -v -x [...] There is error about guest already exists on the target before conversion. Tried about virt-p2v,the similar error showed and conversion didn't start. Refer to the above comments,move the bug to VERIFIED.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-2183.html