Comment 0 for bug 1209199

Revision history for this message
Edward Hope-Morley (hopem) wrote : use copy-on-write for rbd volume cloning

RBD volume cloning currently does a full copy. We could speed this up by creating a copy-on-write clone instead. This would require taking a snapshot of the volume first and then creating a copy-on-write clone. There are different ways we could implement this, especially in view of upcoming auto-flattening support, but for now I suggest we do it as follows:

* create discrete snapshot of volume if one does not already exist
* if snapshot has > some-configurable-number snapshots (detect with list_children()) we disallow the clone for performance degradation reasons and enforce a full copy as before - this can be disabled when auto-flattening comes in.
* create copy-on-write clone if snapshot
* et voila!