ceph-csi/examples/rbd
Madhu Rajanna a0fd805a8b rbd: Add support for smart cloning
Added support for RBD PVC to PVC cloning, below
commands are executed to create a PVC-PVC clone from
RBD side.

* Check the depth(n) of the cloned image if n>=(hard limit -2)
or ((soft limit-2) Add a task to flatten the image and return
about (to avoid image leak) **Note** will try to flatten the
temp clone image in the chain if available
* Reserve the key and values in omap (this will help us to
avoid the leak as it's not reserved earlier as we have returned
ABORT (the request may not come back))
* Create a snapshot of rbd image
* Clone the snapshot (temp clone)
* Delete the snapshot
* Snapshot the temp clone
* Clone the snapshot (final clone)
* Delete the snapshot

```bash
1) check the image depth of the parent image if flatten required
add a task to flatten image and return ABORT to avoid leak
(hardlimit-2 and softlimit-2 check will be done)
2) Reserve omap keys
2) rbd snap create <RBD image for src k8s volume>@<random snap name>
3) rbd clone --rbd-default-clone-format 2 --image-feature
layering,deep-flatten <RBD image for src k8s volume>@<random snap>
<RBD image for temporary snap image>
4) rbd snap rm <RBD image for src k8s volume>@<random snap name>
5) rbd snap create <cloned RBD image created in snapshot process>@<random snap name>
6) rbd clone --rbd-default-clone-format 2 --image-feature <k8s dst vol config>
 <RBD image for temporary snap image>@<random snap name> <RBD image for k8s dst vol>
7)rbd snap rm <RBD image for src k8s volume>@<random snap name>
```

* Delete temporary clone image created as part of clone(delete if present)
* Delete rbd image

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-07-10 14:02:12 +00:00
..
exec-bash.sh Fix static check for .sh files 2019-02-07 12:19:14 +00:00
logs.sh Fix static check for .sh files 2019-02-07 12:19:14 +00:00
plugin-deploy.sh refact: Remove Kubernetes 1.13.x support 2020-01-20 10:32:30 +00:00
plugin-teardown.sh refact: Remove Kubernetes 1.13.x support 2020-01-20 10:32:30 +00:00
pod-clone.yaml rbd: Add support for smart cloning 2020-07-10 14:02:12 +00:00
pod-restore.yaml Make deployment artifacts with a consistent name pattern. 2019-05-07 14:54:53 +00:00
pod.yaml Make deployment artifacts with a consistent name pattern. 2019-05-07 14:54:53 +00:00
pvc-clone.yaml rbd: Add support for smart cloning 2020-07-10 14:02:12 +00:00
pvc-restore.yaml rbd supports ReadWriteMany for block mode 2019-06-18 04:41:01 +00:00
pvc.yaml Make deployment artifacts with a consistent name pattern. 2019-05-07 14:54:53 +00:00
raw-block-pod.yaml examples/rbd-block: use a container image that is supported 2020-01-21 13:30:45 +00:00
raw-block-pvc.yaml Make deployment artifacts with a consistent name pattern. 2019-05-07 14:54:53 +00:00
secret.yaml Adds PVC encryption with LUKS 2019-12-16 08:12:44 +00:00
snapshot.yaml Snapshot: Template changes for snapshot beta 2020-05-15 08:19:32 +00:00
snapshotclass.yaml doc: make sure configmap object referred or documented correctly 2020-06-10 11:33:10 +00:00
storageclass.yaml doc: make sure configmap object referred or documented correctly 2020-06-10 11:33:10 +00:00