[virt-clone] Refuses to create clone disk image

Bug #1188178 reported by TJ
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
virtinst (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

Ubuntu 13.04 Raring amd64

$ apt-cache policy virtinst
virtinst:
  Installed: 0.600.3-3ubuntu1
  Candidate: 0.600.3-3ubuntu1
  Version table:
 *** 0.600.3-3ubuntu1 0
        500 http://gb.archive.ubuntu.com/ubuntu/ raring/main amd64 Packages
        100 /var/lib/dpkg/status

virt-clone refuses to clone disk image:

$ virt-clone --connect qemu:///system --original=CentOS6-minimal --name=CentOS6-RT-dev --file=$(pwd)/CentOS6-RT-dev.vmdk
ERROR cannot stat file '/home/all/VirtualMachines/CentOS6-RT-dev.vmdk': No such file or directory

$ kvm-img create -f vmdk CentOS6-RT-dev.vmdk 6G
Formatting 'CentOS6-RT-dev.vmdk', fmt=vmdk size=6442450944 compat6=off

$ virt-clone --connect qemu:///system --original=CentOS6-minimal --name=CentOS6-RT-dev --file=$(pwd)/CentOS6-RT-dev.vmdk
ERROR This will overwrite the existing path '/home/all/VirtualMachines/CentOS6-RT-dev.vmdk' (Use --prompt or --force to override)

$ virt-clone --connect qemu:///system --original=CentOS6-minimal --name=CentOS6-RT-dev --file=$(pwd)/CentOS6-RT-dev.vmdk --force
ERROR Clone onto existing storage volume is not currently supported: '/home/all/VirtualMachines/CentOS6-RT-dev.vmdk'

$ virt-clone --connect qemu:///system --original=CentOS6-minimal --name=CentOS6-RT-dev --file=$(pwd)/CentOS6-RT-dev.vmdk --prompt
This will overwrite the existing path '/home/all/VirtualMachines/CentOS6-RT-dev.vmdk'
Do you really want to use this disk (yes or no)
yes
ERROR Clone onto existing storage volume is not currently supported: '/home/all/VirtualMachines/CentOS6-RT-dev.vmdk'

$ virt-clone --connect qemu:///system --original=CentOS6-minimal --name=CentOS6-RT-dev --auto-clone
ERROR cannot stat file '/home/all/VirtualMachines/CentOS6-RT-dev.vmdk': No such file or directory

Revision history for this message
caraconan (0-javi) wrote :

Hi there.

First of all thanks for the software.

Second I can confirm the issue. Steps to reproduce:

ii virtinst 0.600.4-1 all Programs to create and clone virtual machines

1. Stop/undefine a VM

2. Remove disk and log file

3. Try to clone an existing VM with the file deleted on step 2 as destination

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in virtinst (Ubuntu):
status: New → Confirmed
Revision history for this message
Alex Stellwag (astellwag) wrote :

Hi,

I can confirm the issue using current trusty builds.

After restarting libvirt-bin, everything was fine again.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

As I understand it, this only happens if the intended new clone's disk is the same as that of a recently deleted VM?

If that is not the case, then please let me know so we can raise priority.

Changed in virtinst (Ubuntu):
importance: Undecided → Low
Revision history for this message
Alexander Muthmann (e-launchpad-3) wrote :

Hi,

I can confirm this issue. To reproduce it, clone an vm to a new image, remove the image, undefine it and try to clone a new vm with the same name.

Revision history for this message
Alexander Muthmann (e-launchpad-3) wrote :

Sry, one more:

I fixed the issue by refreshing the storage pool manually:

virsh pool-list
virsh pool-refresh MY_POOL

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1188178] Re: [virt-clone] Refuses to create clone disk image

Quoting Alexander Muthmann (<email address hidden>):
> Hi,
>
> I can confirm this issue. To reproduce it, clone an vm to a new image,
> remove the image, undefine it and try to clone a new vm with the same
> name.

Can you please give the precise commands you used to reproduce?

Revision history for this message
Alexander Muthmann (e-launchpad-3) wrote :

# Create initial vm
virt-clone -o template -n test-vm --file=/vms/images/test-vm.img --mac=RANDOM
# delete vm
virsh undefine test-vm && rm /vms/images/test-vm.img
# try to recreate vm, this fails
virt-clone -o template -n test-vm --file=/vms/images/test-vm.img --mac=RANDOM
# Refresh storage pool
virsh pool-refresh virtimages
# try to recreate vm, this works now
virt-clone -o template -n test-vm --file=/vms/images/test-vm.img --mac=RANDOM

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.