[Kimchi-devel] [PATCH 7/8] Clone virtual machines

Aline Manera alinefm at linux.vnet.ibm.com
Wed Nov 5 11:39:15 UTC 2014


On 11/04/2014 11:32 AM, Crístian Viana wrote:
> On 04-11-2014 09:07, Aline Manera wrote:
>> I've just thought about the case the disk is not in a pool.
>> For example, we allow user create a Template (and then a VM) using an 
>> Image file. That image file is not necessarily on a pool. ie, it is a 
>> volume from libvirt perspective.
>> So in that case the call vir_conn.storageVolLookupByPath(path) will 
>> raise an exception and stop the clone operation.
>> We need to have this scenario in mind and work with it properly.
>
> I did a quick test now: I created a template based on a local image on 
> my home dir (which is not a pool) and created a VM with that template. 
> After checking the VM storage settings, I see it has its disk on the 
> default storage pool (/var/lib/libvirt/images), so I guess it must 
> have been copied there to make sure the disk was in an existing pool.
>
> Can you try to reproduce this and make sure this is how it works? If 
> that's the case, then there's nothing to be done about this issue.

Thanks for checking!
Anyway, we support guests created outside Kimchi and they may have this 
situation too. We don't need to think about a fix right now,
but make sure your code will not raise an exception in this case.

Maybe a try/except block around:

+            vir_orig_vol = vir_conn.storageVolLookupByPath(path)
+            vir_pool = vir_orig_vol.storagePoolLookupByVolume()

would make the code better.




More information about the Kimchi-devel mailing list