Discussion:
[libvirt-users] Copy volume from one storage to another
Shashwat shagun
2018-08-08 15:22:43 UTC
Permalink
Hi,
I want to copy a volume from one to pool to another pool through libvirt golang api but I’m unaware of any such functions. Can anybody guide me a little bit here?

Best Regards,
Shashwat Shagun
***@shashwat.tech
Daniel P. Berrangé
2018-08-08 15:27:16 UTC
Permalink
Post by Shashwat shagun
Hi,
I want to copy a volume from one to pool to another pool through
libvirt golang api but I’m unaware of any such functions. Can
anybody guide me a little bit here?
The "StorageVol" interface in Go provides "Upload" and "Download" methods
that associate a "Stream" with the volumes.

So you'd call Download on the original vol, Upload on the target vol, and
read from one stream, and write to the other stream.

Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Vasiliy Tolstov
2018-08-08 16:08:09 UTC
Permalink
If two pools on the same nore I'm recommend to use createvolfromxml. In
this case libvirt do internal copy on the node via qemu-img.
Download/upload takes all data on node that runs client.
Post by Shashwat shagun
Hi,
I want to copy a volume from one to pool to another pool through libvirt
golang api but I’m unaware of any such functions. Can anybody guide me a
little bit here?
Best Regards,
Shashwat Shagun
_______________________________________________
libvirt-users mailing list
https://www.redhat.com/mailman/listinfo/libvirt-users
Loading...