Bug 1089079

Summary: RFE: Support virStorageVolCreateXMLFrom in the RBD Storage Driver
Product: [Community] Virtualization Tools Reporter: Solly Ross <sross>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: angdraug, crobinso, rbalakri, shyu
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-10 18:24:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Solly Ross 2014-04-17 20:40:37 UTC
Currently, the RBD storage driver does not support the virStorageVolCreateXMLFrom,
as the RBD storage backend does not implement a buildVolFrom method.

Having support for such a method would be advantageous in situations where one had an RBD-based storage pool, and wished to duplicate a volume in it, or wished to duplicate a volume from an existing pool into the RBD pool.

For cases when the transferring is done entirely within the RBD pool, librbd's `copy` function can be used.  Otherwise, librbd supports uploading image data via the `write` function.

Comment 1 Dmitry Borodaenko 2014-05-15 16:06:49 UTC
Even better, librbd's `clone` function can be used to avoid data copy altogether when creating an image in the same RBD pool. A further optimization would be to introspect snapshots chain in RBD and flatten the image if clone depth reaches a certain limit.

Comment 2 Cole Robinson 2016-04-10 18:24:34 UTC
This is upstream nowadays:

commit 0b15f92032725a7943df1f035b649f4e030953e7
Author: Wido den Hollander <wido@widodh.nl>
Date:   Wed Jan 27 11:20:09 2016 +0100

    rbd: Implement buildVolFrom using RBD cloning