Thank you Justin. How could I forget "pool-refresh"!? I knew, that exists
some clean and easy solution :)
Jaromír.
Dne 30. září 2010 16:18 Justin Clift <jclift(a)redhat.com> napsal(a):
On 09/30/2010 11:25 PM, Jaromír Červenka wrote:
> Hello,
>
> is there any way, how to create storage volume from existing qcow2 image
> file? I have XML description for this new volume and image which was used
> without xml. But when I tried "vol-create" it automatically deleted this
> file and created new one.
>
Hi Jaromír,
If it helps, the way I normally do it is to copy the qcow2 image file into
a new pool, then refresh the pool.
When the pool is refreshed, it notices the new qcow2 file,
automatically creating the internal XML for it and making it available.
ie. (this is just my typing from memory, so you may need to tweak it)
$ sudo cp myimage.qcow2 /var/lib/libvirt/images
$ sudo virsh pool-refresh default
$ sudo virsh vol-list default
<a list of volumes in the pool should be shown, including the new one>
Does that achieve what you're after?
Regards and best wishes,
Justin Clift