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

The information of PV is lost if it's restored via podvolume path #6435

Closed
reasonerjt opened this issue Jun 29, 2023 · 3 comments · Fixed by #7504
Closed

The information of PV is lost if it's restored via podvolume path #6435

reasonerjt opened this issue Jun 29, 2023 · 3 comments · Fixed by #7504
Assignees
Labels
Milestone

Comments

@reasonerjt
Copy link
Contributor

If a workload's PV is patched so its reclaim policy is different from what is defined in the storageclass

k get sc
NAME            PROVISIONER             RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
gp2 (default)   kubernetes.io/aws-ebs   Delete          WaitForFirstConsumer   false                  167d

k patch pv pvc-xxxxx -p "{\"spec\":{\"persistentVolumeReclaimPolicy\":\"Retain\"}}"

Then if I use velero to backup the workload via podvolume and restore it, the new PV is created after the restore will have the reclaim policy of the storageclass, instead of the patched value.

@reasonerjt reasonerjt changed the title The reclaim policy of PV is lost if it's restored via podvolume path The information of PV is lost if it's restored via podvolume path Jun 29, 2023
@reasonerjt reasonerjt added backlog Area/CSI Related to Container Storage Interface support Needs investigation labels Jul 3, 2023
@pradeepkchaturvedi pradeepkchaturvedi added the 1.13-candidate issue/pr that should be considered to target v1.13 minor release label Aug 4, 2023
@reasonerjt reasonerjt added the Needs triage We need discussion to understand problem and decide the priority label Sep 6, 2023
@reasonerjt reasonerjt removed Needs triage We need discussion to understand problem and decide the priority 1.13-candidate issue/pr that should be considered to target v1.13 minor release labels Sep 6, 2023
@reasonerjt reasonerjt added this to the v1.13 milestone Sep 6, 2023
@reasonerjt
Copy link
Contributor Author

We should also handle the case when the PV is restored via CSI plugin with/without datamover involved.

@allenxu404
Copy link
Contributor

The design #7070 introduces a new structure called VolumeInfo which includes the following fields:

  • BackupMethod: this field indicates the method used to back up the PV.
  • PVCName: this field indicates the PV's corresponding PVC.
  • PVInfo: this field stores the PV's manifest.

By utilizing the VolumeInfo structure, we can effectively gather all the PVs which are not skipped (by checking the existance of its bound PVC), and are dynamically provided (by checking the field BackupMethod) during the restore. Subsequently, we can patch these new PVs with the manifest of the old PVs by utilizing the PVInfo field.

@reasonerjt
Copy link
Contributor Author

To make sure the PVs are patched in case both of with or without aync operations, we'll need to introduce a new phase of restore CR.
Per discussion we propose to defer this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
6 participants