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