When cloning a VM with qcow2 disk, the cloned VM will have its disk defined as raw format in its config

Bug #953922 reported by Tuomas Jormola on 2012-03-13
This bug affects 7 people
Affects Status Importance Assigned to Milestone
virtinst (Ubuntu)
Marc Deslauriers

Bug Description


Precise users aren't able to use the virt-clone command, or the clone functionnality in virt-manager to create successful clones of VMs using qcow2 images, as the disk image format is not being transferred properly to the clone.

[Test Case]
1- Create VM with qcow2 disks
2- Clone VM with virt-manager
3- Inspect clone xml file to make sure qcow2 image format is set correctly

[Regression Potential]
This change is limited to the clone code path. If something breaks, it will be VM cloning.

I tried the cloning feature of virt-manager. First I created a VM with qcow2 disk and installed Ubuntu on it. Then I shutdown the VM and created a clone of it. The clone was successfully created, but the configuration of the disk is invalid. The disk type in the cloned VM is raw, not qcow2. The actual format of the cloned disk image is qcow2, only the config is wrong. After changing the type of the disk back to qcow2, the cloned VM can see the disk just fine.

Here's the libvirt XML config snippet for the disk on the VM to be cloned:
<disk type='file' device='disk'>
  <driver name='qemu' type='qcow2'/>
  <source file='/var/lib/libvirt/images/test.img'/>
  <target dev='vda' bus='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>

And the same config for the clone VM before fixing the type manually:
<disk type='file' device='disk'>
  <driver name='qemu' type='raw'/>
  <source file='/var/lib/libvirt/images/test-clone.img'/>
  <target dev='vda' bus='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: virt-manager 0.9.1-1ubuntu2
ProcVersionSignature: Ubuntu 3.2.0-18.29-generic 3.2.9
Uname: Linux 3.2.0-18-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 1.94.1-0ubuntu2
Architecture: amd64
Date: Tue Mar 13 12:54:01 2012
PackageArchitecture: all
SourcePackage: virt-manager
UpgradeStatus: No upgrade log present (probably fresh install)

Tuomas Jormola (tjormola) wrote :
Tuomas Jormola (tjormola) wrote :

Further investigated this issue and reported my findings and possible fixes to upstream.

Applying the patch https://bugzilla.redhat.com/attachment.cgi?id=569802 would fix this problem for virt-manager as reported in this bug entry.

affects: virt-manager (Ubuntu) → virtinst (Ubuntu)
affects: virt-manager → virtinst
Launchpad Janitor (janitor) wrote :

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

Changed in virtinst (Ubuntu):
status: New → Confirmed
Marc Deslauriers (mdeslaur) wrote :
Sebastien Douche (sdouche) wrote :

Hello everyone,
Can you make a new release out with the small patch already integrated upstream?


Changed in virtinst (Ubuntu Quantal):
status: Confirmed → Fix Released
Changed in virtinst (Ubuntu Precise):
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Marc Deslauriers (mdeslaur)
Marc Deslauriers (mdeslaur) wrote :

Package uploaded to -proposed, awaiting SRU team approval.

description: updated

Hello Tuomas, or anyone else affected,

Accepted virtinst into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/virtinst/0.600.1-1ubuntu3.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in virtinst (Ubuntu Precise):
status: Confirmed → Fix Committed
tags: added: verification-needed
Tuomas Jormola (tjormola) wrote :

Tested the version 0.600.1-1ubuntu3.2 and verified that cloning now works as supposed. Thanks!

tags: added: verification-done
removed: verification-needed

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package virtinst - 0.600.1-1ubuntu3.2

virtinst (0.600.1-1ubuntu3.2) precise-proposed; urgency=low

  * debian/patches/9006-fix-disk-cloning.patch: Also clone disk type when
    cloning a VM. (LP: #953922)
 -- Marc Deslauriers <email address hidden> Fri, 27 Jul 2012 11:13:04 -0400

Changed in virtinst (Ubuntu Precise):
status: Fix Committed → Fix Released
Alain Vernat (alain-vernat) wrote :
Download full text (11.2 KiB)

Upgrade to virtinst0.600.1-1ubuntu3.2 doesn't solve the problem.

# virt-clone -o ubuntu-1204-10G -n omcsvctst01d -f /data/instances/omcsvctst01d.img -d
[Fri, 09 Aug 2013 10:53:33 virt-clone 8084] DEBUG (cli:220) Launched with command line:
/usr/bin/virt-clone -o ubuntu-1204-10G -n omcsvctst01d -f /data/instances/omcsvctst01d.img -d
[Fri, 09 Aug 2013 10:53:33 virt-clone 8084] DEBUG (cli:326) Requesting libvirt URI default
[Fri, 09 Aug 2013 10:53:33 virt-clone 8084] DEBUG (cli:328) Received libvirt URI qemu:///system
[Fri, 09 Aug 2013 10:53:34 virt-clone 8084] DEBUG (CloneManager:399) Validating original guest parameters
[Fri, 09 Aug 2013 10:53:34 virt-clone 8084] DEBUG (CloneManager:408) Original XML:
<domain type='kvm'>
    <type arch='x86_64' machine='pc-1.0'>hvm</type>
    <boot dev='hd'/>
  <clock offset='utc'/>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/data/templates/ubuntu-1204-10G.img'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdc' bus='ide'/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    <interface type='bridge'>
      <mac address='52:54:00:04:c0:4a'/>
      <source bridge='br-828'/>
      <model type='virtio'/>
      <driver name='vhost' txmode='iothread' ioeventfd='on' event_idx='off'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    <serial type='pty'>
      <target port='0'/>
    <console type='pty'>
      <target type='serial' port='0'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes'/>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>

[Fri, 09 Aug 2013 10:53:36 virt-clone 8084] DEBUG (CloneManager:416) Original paths: ['/data/templates/ubuntu-1204-10G.img']
[Fri, 09 Aug 2013 10:53:36 virt-clone 8084] DEBUG (CloneManager:417) Original sizes: [10.0]
[Fri, 09 Aug 2013 10:53:38 virt-clone 8084] DEBUG (VirtualDisk:240) Path '/data/instances' is target for pool 'default'. Creating volume 'omcsvctst01d.img'.
[Fri, 09 Aug 2013 10:53:39 virt-clone 8084] DEBUG (VirtualDisk:240) Path '/data/i...

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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