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

Volume Policy - miss match behavior with Velero for SnapshotVolume #7782

Closed
Lyndon-Li opened this issue May 8, 2024 · 5 comments
Closed
Assignees
Milestone

Comments

@Lyndon-Li
Copy link
Contributor

Lyndon-Li commented May 8, 2024

For --snapshot-volume flag, if it is not set, Velero's existing behavior treat SnapshotVolume as true, that is, volumes are backed up by CSI snapshot (data movement) or native snapshot; However, for volume policy, if the flag is not set, it disable the snapshot action even if the condition is met.

Steps:

  • Create a volume policy configuration with a snapshot action and a condition meeting a volume being backed up
  • Run a Velero backup using the volume policy but don't set --snapshot-volume flag explictily
  • [Result] The volume is still skipped by volume policy even though the condition is met
@Lyndon-Li
Copy link
Contributor Author

@shubham-pampattiwar
The issue is about a mismatching behavior to check --snapshot-volume flag by volume policy.

However, I discussed further with @reasonerjt for this issue, we think volume policy may not need to respect --snapshot-volume flag, since volume policy always take the preference, if the condition is met which means volume policy voting the snapshot action, the backup should go with snapshot action not matter how snapshot-volume is set.
So we may need to change the existing code of Velero where snapshot-volume is being checked.

@shubham-pampattiwar
Copy link
Collaborator

@Lyndon-Li I think not respecting snapshotVolmes as true may not be the best idea here. The CSI plugin depends on this value to perform snapshots:

if boolptr.IsSetToFalse(backup.Spec.SnapshotVolumes) {

@Lyndon-Li
Copy link
Contributor Author

@Lyndon-Li I think not respecting snapshotVolmes as true may not be the best idea here. The CSI plugin depends on this value to perform snapshots:

if boolptr.IsSetToFalse(backup.Spec.SnapshotVolumes) {

@shubham-pampattiwar Actually the idea we discussed yesterday is that once the volume policy chooses snapshot for a volume, any other places (including CSI plugin) should not check for the SnapshotVolumes again. This introduces more changes than the code for volume policy but it makes things more clear.

@shubham-pampattiwar
Copy link
Collaborator

Created a PR for this issue: #7786

@Lyndon-Li
Copy link
Contributor Author

Fixed by #7794

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

Successfully merging a pull request may close this issue.

2 participants