Bug 835812

Summary: prompt clone keep failing if input an existing directory for disk path one time
Product: Red Hat Enterprise Linux 6 Reporter: tingting zheng <tzheng>
Component: python-virtinstAssignee: virt-mgr-maint
Status: CLOSED UPSTREAM QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 6.3CC: dallan, gkong, hyao, jwu, lcui, mzhan, yupzhang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-24 19:33:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description tingting zheng 2012-06-27 07:44:28 UTC
Description of problem:
When run virt-clone --prompt,input an existing directory when it prompts to input the file path for cloned disk,it will fail even you input the path afterwards.

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.295.el6.x86_64  
libvirt-0.9.10-21.el6.x86_64
kernel-2.6.32-279.el6.x86_64
python-virtinst-0.600.0-8.el6.noarch

How reproducible:
always

Steps to Reproduce:
1.Make sure there is a guest which is shutoff.
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 53    win                            running
 -     demo                           shut off

2.Run virt-clone --prompt:
# virt-clone --prompt
What is the name of the original virtual machine? 
demo
What is the name for the cloned virtual machine? 
new
What would you like to use as the cloned disk (file path) for '/var/lib/libvirt/images/rhel6-clone.img'? 
/root
ERROR    The path '/root' must be a file or a device, not a directory
What would you like to use as the cloned disk (file path) for '/var/lib/libvirt/images/rhel6-clone.img'? (Here,input the path)
/var/lib/libvirt/images/new.img
ERROR    Size must be specified for non existent volume path '/var/lib/libvirt/images/new.img'
What would you like to use as the cloned disk (file path) for '/var/lib/libvirt/images/rhel6-clone.img'? 

3.If I run virt-clone --prompt and the first time input the right path,it will be cloned successfully.
# virt-clone --prompt
What is the name of the original virtual machine? 
demo
What is the name for the cloned virtual machine? 
new
What would you like to use as the cloned disk (file path) for '/var/lib/libvirt/images/rhel6-clone.img'? 
/var/lib/libvirt/images/new.img
Allocating 'new.img'                                     | 8.0 GB     01:19     

Clone 'new' created successfully.


Actual results:
As Steps

Expected results:
After input the path for the cloned disk,it can be cloned successfully.


Additional info:
Error messages from log file:
[Wed, 27 Jun 2012 14:41:14 virt-clone 17006] ERROR (cli:733) The path '/root' must be a file or a device, not a directory
[Wed, 27 Jun 2012 14:41:22 virt-clone 17006] ERROR (cli:733) Size must be specified for non existent volume path '/var/lib/libvirt/images/new.img'

Comment 2 Cole Robinson 2012-07-08 22:23:34 UTC
Thanks for the report, fixed upstream:

http://git.fedorahosted.org/git?p=python-virtinst.git;a=commit;h=b578af585a92fb7680c0fec7fb3092f7c70ac989