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!
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 le-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.
* if snapshot has > some-configurab
* create copy-on-write clone if snapshot
* et voila!