Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a command to flatten RBD PVC #222

Closed
satoru-takeuchi opened this issue Jan 11, 2024 · 8 comments · Fixed by #229
Closed

Add a command to flatten RBD PVC #222

satoru-takeuchi opened this issue Jan 11, 2024 · 8 comments · Fixed by #229
Assignees
Labels
enhancement New feature or request

Comments

@satoru-takeuchi
Copy link
Member

Is this a bug report or feature request?

  • Feature Request

What should the feature do:

Add a command to flatten RBD PVC.

What is use case behind this feature:

  • Increase the durability of RBD PVC
  • Prevent performance degradation of RBD PVC from other PVCs
  • Make it possible to mirror cloned RBD PVC

This feature will reduce the operation cost to flatten RBD PVC by hand like this.

  1. FInd the name of PV correspoinding to the target PVC.
  2. Get the volumeHandle file of the PV
  3. Get the name of the target RBD image from the volumeHandle field
  4. Flatten the target RBD image.

Related issues and discussions:
RBD Async: Failed to mirrored Cloned PVC created from another PVC (PVC-PVC Clone) in ceph-csi
RBD Async: Failed to mirrored Cloned PVC created from snapshot (PVC from snapshot) in ceph-csi
How to achieve mirrirong cloned PVCs in ceph-csi

@satoru-takeuchi satoru-takeuchi added the enhancement New feature or request label Jan 11, 2024
@satoru-takeuchi satoru-takeuchi self-assigned this Jan 11, 2024
@satoru-takeuchi
Copy link
Member Author

Please let me know if you have any comments. If there is no objection, I'll implement this feature.

@subhamkrai
Copy link
Collaborator

tagging @Madhu-1 @travisn @Rakshith-R

@Madhu-1
Copy link
Member

Madhu-1 commented Jan 11, 2024

Back from PTO and still catching up with things for now A side effect of doing this increases the storage consumption and breaks the chain of images.

Get the volumeHandle file of the PV
Get the name of the target RBD image from the volumeHandle field

RBD Image name and pool name might already be part of volumeAttributes we don't need to decode the volumeHandle

@satoru-takeuchi
Copy link
Member Author

A side effect of doing this increases the storage consumption

In my opinion, it would not be a big problem because admins explicitly flatten their image rather than implicitly being done by ceph-csi or Rook.

However, as I described in the discussion in ceph-csi, parent PVC's data will remain in the temporary rbd image after deleting the parent rbd image. This limitation should be documented, or the temporary rbd image should be removed on flattening.

and breaks the chain of images.

Do you have any concern about braking the chain? If I recall correctly, rbd image still remember its parent image after flattening.

RBD Image name and pool name might already be part of volumeAttributes we don't need to decode the volumeHandle

Indeed, thanks.

@Madhu-1
Copy link
Member

Madhu-1 commented Jan 12, 2024

A side effect of doing this increases the storage consumption

In my opinion, it would not be a big problem because admins explicitly flatten their image rather than implicitly being done by ceph-csi or Rook.

However, as I described in the discussion in ceph-csi, parent PVC's data will remain in the temporary rbd image after deleting the parent rbd image. This limitation should be documented, or the temporary rbd image should be removed on flattening.

the cleanup/steps to cleanup of the temporary image need to be handled properly as required.

and breaks the chain of images.

Do you have any concern about braking the chain? If I recall correctly, rbd image still remember its parent image after flattening.

Nothing we should be good

RBD Image name and pool name might already be part of volumeAttributes we don't need to decode the volumeHandle

Indeed, thanks.

@satoru-takeuchi
Copy link
Member Author

However, as I described in the discussion in ceph-csi, parent PVC's data will remain in the temporary rbd image after deleting the parent rbd image. This limitation should be documented, or the temporary rbd image should be removed on flattening.
the cleanup/steps to cleanup of the temporary image need to be handled properly as required.

Thank you for your reply.

One more question. It is OK to delete the temporary image from kubectl rook-ceph when flattening PVC-PVC clone image? Or should it be done by other ways? If I understand correctly, the temporary image is specific to the cloned PVC in PVC-PVC clone and is safe to be deleted here.

@Madhu-1
Copy link
Member

Madhu-1 commented Jan 15, 2024

However, as I described in the discussion in ceph-csi, parent PVC's data will remain in the temporary rbd image after deleting the parent rbd image. This limitation should be documented, or the temporary rbd image should be removed on flattening.
the cleanup/steps to cleanup of the temporary image need to be handled properly as required.

Thank you for your reply.

One more question. It is OK to delete the temporary image from kubectl rook-ceph when flattening PVC-PVC clone image? Or should it be done by other ways? If I understand correctly, the temporary image is specific to the cloned PVC in PVC-PVC clone and is safe to be deleted here.

@satoru-takeuchi it should be safe to delete it as it will not be used anymore. we introduced temporary image to avoid i/o performance issue when accessing the image mounted to the PVC because we never flattened the mapped image, we always wanted to flatten the temporary image. In this case as we are trying to flatten the actual rbd image we are move the temporary image to trash and add a task to remove it from trash.

@satoru-takeuchi
Copy link
Member Author

@Madhu-1 Thank you very much! I'll implement this feature with considering the result of this discussion.

we introduced temporary image to avoid i/o performance issue when accessing the image mounted to the PVC because we never flattened the mapped image, we always wanted to flatten the temporary image.

I finally understood why temporary image exists, haha.

satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue Jan 26, 2024
- Flatten an RBD image corrensponding to the target PVC
- Remove the corresponding temporary RBD image

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue Jan 26, 2024
- Flatten an RBD image corrensponding to the target PVC
- Remove the corresponding temporary RBD image

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue Feb 27, 2024
- Flatten an RBD image corrensponding to the target PVC
- Remove the corresponding temporary RBD image

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue Feb 27, 2024
- Flatten an RBD image corrensponding to the target PVC
- Remove the corresponding temporary RBD image

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue Feb 27, 2024
- Flatten an RBD image corrensponding to the target PVC
- Remove the corresponding temporary RBD image

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue Apr 10, 2024
- Flatten an RBD image corrensponding to the target PVC
- Remove the corresponding temporary RBD image

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue May 1, 2024
- Flatten an RBD image corrensponding to the target PVC
- Remove the corresponding temporary RBD image

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue May 1, 2024
- Flatten an RBD image corrensponding to the target PVC
- Remove the corresponding temporary RBD image

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue May 1, 2024
Add flatten-rbd-pvc command to accomplish the following things:

- Flatten an RBD image corrensponding to the target PVC.
- Remove the temporary RBD image too.

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue May 1, 2024
Add flatten-rbd-pvc command to accomplish the following things:

- Flatten an RBD image corrensponding to the target PVC.
- Remove the temporary RBD image too.

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue May 1, 2024
Add flatten-rbd-pvc command to accomplish the following things:

- Flatten an RBD image corrensponding to the target PVC.
- Remove the temporary RBD image too.

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue May 1, 2024
Add flatten-rbd-pvc command to accomplish the following things:

- Flatten an RBD image corrensponding to the target PVC.
- Remove the temporary RBD image too.

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue May 9, 2024
Add flatten-rbd-pvc command to accomplish the following things:

- Flatten an RBD image corrensponding to the target PVC.
- Remove the temporary RBD image too.

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue May 9, 2024
Add flatten-rbd-pvc command to accomplish the following things:

- Flatten an RBD image corrensponding to the target PVC.
- Remove the temporary RBD image too.

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue May 15, 2024
Add flatten-rbd-pvc command to accomplish the following things:

- Flatten an RBD image corrensponding to the target PVC.
- Remove the temporary RBD image too.

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue May 15, 2024
Add flatten-rbd-pvc command to accomplish the following things:

- Flatten an RBD image corrensponding to the target PVC.
- Remove the temporary RBD image too.

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue May 16, 2024
Add flatten-rbd-pvc command to accomplish the following things:

- Flatten an RBD image corrensponding to the target PVC.
- Remove the temporary RBD image too.

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
satoru-takeuchi added a commit to cybozu-go/kubectl-rook-ceph that referenced this issue May 22, 2024
Add flatten-rbd-pvc command to accomplish the following things:

- Flatten an RBD image corrensponding to the target PVC.
- Remove the temporary RBD image too.

Closes: rook#222

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants