1

I am on Ubuntu 17.04 server using KVM
I tried to clone a vm after stopping it... I actually could not do a shutdown, so I did a destroy.

visrh destroy origVM

Then I tried cloning using:

virt-clone --original origVM --name conleVM --file /var/lib/libvirt/images/cloneVM.img

and I got:

ERROR missing source information for device sdx

So I tried

virt-clone --original origVM --auto-clone

and I got:

ERROR Could not use path /dev/disk/by-id/.... for cloning don't know how to create storage path /dev/disk.by-id/.... Use libvirt APIs to manage the parent directory as a pool first.

I am thinking this is related to the fact that for origVM, I have dedicated 2 physical HDD from the host. I define these HDD in the xml by their disk/by-id number.

Could use guidance on how to deal with it.

Thomas
  • 4,225
  • 5
  • 23
  • 28
Fawzi Masri
  • 31
  • 1
  • 3

1 Answers1

0

It did have to do with the dedicated HDD for that vm. So i stopped the original vm.

    virsh destroy origVM

I backed up the xml for the origVM and edited it.

    vi /etc/lib/libvirt/qemu/origVM.xml

i removed the reference to the disk/by-id.

 <disk type='block' device='disk'>
    <driver name='qemu' type='raw'/>
    <source dev='/dev/disk/by-id/ata-ST10000DM0004-1ZC101_ZA2151FH'/>
    <target dev='sdy' bus='virtio'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x0f' function='0x0'/>
</disk>

i reran the virt-clone and let it do its thing.

    virt-clone --original origVM --name conleVM --file /var/lib/libvirt/images/cloneVM.img

After virt-clone completed, i copied the backed up the origVM.xml that had the dedicated disks. Then redefined the orig machine and then started it.

    virsh define /etc/libvirt/qemu/origVM.xml
    virsh start origVM
Fawzi Masri
  • 31
  • 1
  • 3