How to achieve mirrirong cloned PVCs #4360
Replies: 4 comments 4 replies
-
Snapshot in following lines refers to k8s snapshot -> a rbd image + rbd snap.
Regarding (a), cephcsi is a server agnostic of container orchestrator. It maybe simple for an operator or controller to do this but that is not in realm of cephcsi server. Incorporating (a) & (b) together, we definitely need to document the steps. We can also make use of https://github.com/rook/kubectl-rook-ceph to add an operation to flatten PVC to make it easier for users. Regarding (c), We never run flatten operation on a rbd image that a client can do io on at cephcsi. This is the least favorable one. Currently, We've discussed to add support for mirroring of VolumeSnapshot, several points are yet to be discussed.
Handling PVC-PVC clone is indeed complex because of the temporary image. For now, I think we can have logic to flatten this in rook-kubectl-plugin and handle proper mirroing flow of PVC-PVC clone in next releases. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the detailed explanation.
Does the ceph-csi team have enough resources to implement this? If you don't mind, I will do it because I need mirrirong PVC-PVC clone for my system. |
Beta Was this translation helpful? Give feedback.
-
@Rakshith-R Is it necessary to verify whether PVC is in use or not? I didn't found the limitation like flattening in-use RBD image is prohibited. |
Beta Was this translation helpful? Give feedback.
-
kubectl-rook-ceph v0.9.0 supports flattening RBD PVC.
@Rakshith-R Thank you for giving me many hints! |
Beta Was this translation helpful? Give feedback.
-
As shown in #2426 and #2427, it's impossible to mirror cloned PVC (RBD image) only by ceph-csi for now. Although all ancestor RBD images must also enable RBD mirroring, there is no way to do it in ceph-csi's layer. I'd like to discuss how to overcome this limitation.
One possible way is toggling the mirror settiong of ancestor RBD images according to the existence of VolumeReplication resource corresponding to cloned PVC. However, this logic will be hard to maintain and the major change will be necessary in the cloning logic.
I believe that providing the way to flatten PVC in ceph-csi layer is the nice solution. What do you think?
If the flattening is regarded as a reasonable solution, we have several options as follows:
a. Provide the way to flatten an arbitrary PVC explicitly (e.g. by adding an annotation) and write a document that this step is the prerequisite of mirroring cloned PVC.
b. Write a document that the manual flattening operation is necessary to mirror cloned PVC
c. Flatten a PVC automatically when the corresponding VolumeReplication is created.
IMO, (a) is the best solution. (b) is annoying for users to find the correct RBD image corresponding to the cloned PVC. (c) is OK as a perspective from only RBD mirror user. However, it's convenient for users to be able to flatten RBD images explicitly if they concern the data redundancy and/or performance.
One more thing. If we decide flattening as the solution, we should also consider how to handle the temporary RBD image.
If we delete the parent PVC after flattening the cloned PVC, the parent PVC's space is not freed. It's because the temporary RBD image is still alive.
We should delete the temporary RBD image on PVC-PVC clone case.
Beta Was this translation helpful? Give feedback.
All reactions