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

feat: add option --ignore-pools to exclude vms in pools from backup c… #60

Merged
merged 1 commit into from
Jun 30, 2024

Conversation

jdreffein
Copy link

With this PR I introduce the possibility of ignoring VMs or containers assigned to one or many pools.

Sometimes you may have some vms for testing or commissioning, that don't have to be backed up.

With the new option --ignore-pools one or more pools can be specified. All VMIDs in those pools will be removed from the list of VMIDs not configured in any backup job that are reported by the checked node (cluster/backup-info/not-backed-up), so only VMIDs not ignored by this option will be reported by the check.

The name of the pools are separated with a comma. So both of these examples are valid
--ignore-pools testpool
--ignore-pools test,implement

This option also provides a solution to use the backup check when VMs are backed up via api/vzdump and not scheduled backup jobs of the cluster.

@nbuchwitz nbuchwitz force-pushed the ignore_pools branch 2 times, most recently from da11d4d to 5ed4b26 Compare June 25, 2024 16:58
@nbuchwitz
Copy link
Owner

Thanks for your contribution! I really like the idea of ignoring complete pools and might extend this parameter to other checks where it makes sense. I took the liberty and pushed a fixup commit in order to simplify the lookup and follow the generel codying style. Feel free to squash with your commit and push the branch again. After that I can merge the PR.

@jdreffein
Copy link
Author

yes, i will do that tomorrow, was a long day.
sorry i didn't use black and ruff at first. maybe cause code is working here. just getting used to python.

@nbuchwitz
Copy link
Owner

No worries, especially if this was your first Python contribution. Have a nice evening!

@jdreffein
Copy link
Author

Thank you for your appreciation and linting/enhancing the contributed code.

The next contribution would be a check for cluster memory. But it has be to generalized first because it is currently customized to our environment.

@jdreffein
Copy link
Author

sorry, i got some things messed up with git. my latest commit should be the final working

@nbuchwitz
Copy link
Owner

You can use git commit --amend to edit the commit message and remove the fixups

@nbuchwitz nbuchwitz merged commit 322ab4a into nbuchwitz:main Jun 30, 2024
1 check passed
@nbuchwitz
Copy link
Owner

@jdreffein I've squashed the commit into one and merged it into main branch. Thanks for your contribution!

P.S: Greetings to Niclas!

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

Successfully merging this pull request may close these issues.

2 participants