Skip to content

Add Python FD Plugin for OpenVZ container#908

Merged
sduehr merged 5 commits intobareos:masterfrom
benibr:plugin/openvz7
Nov 4, 2021
Merged

Add Python FD Plugin for OpenVZ container#908
sduehr merged 5 commits intobareos:masterfrom
benibr:plugin/openvz7

Conversation

@benibr
Copy link
Contributor

@benibr benibr commented Aug 11, 2021

This PR adds the Python FD Plugin for backing up and restoring full OpenVZ/Virtuozzo container and files within them via Bareos.
The Plugin is developed and maintained internally by SysEleven GmbH but a copy is pushed here for public access.
See README.md for details.

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

General
  • PR name is meaningful
  • Purpose of the PR is understood
  • Separate commit for this PR in the CHANGELOG.md, PR number referenced is same
  • Commit descriptions are understandable and well formatted
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
  • bareos-check-sources --since-merge does not report any problems
  • git status should not report modifications in the source tree after building and testing

@arogge
Copy link
Member

arogge commented Aug 12, 2021

Hi Beni!
Thank you very much for that huge contribution. That looks like a lot of effort has been put into this!
We'll need to review and test this, which which might take us some time (no OpenVZ/Virtuozzo know-how here yet) and we'll of course have to package the Plugin, so users will be able to install it.

Best Regards,
Andreas

Copy link
Member

@sduehr sduehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I can't test this plugin, but the code looks good so far. Some suggested changes would be nice.

* OpenVZ/virtuozzo 7 is used (CentOS 7 based)
* Bareos 20 is used with Python3 supported (Python2 might still work)
* container uses ploop image on default path
* container has only _one_ ploop image in use
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here it should be mentioned that the lockfile module must be installed using pip or package if the distribution provides it.

import subprocess
import bareosfd
import BareosFdPluginBaseclass
from lockfile import LockFile
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of README the locking is optional, but the plugin would thrown an exception here if the lockfile module is not installed. This exception could be handled, eg. the missing lockfile module could be ignored if the plugin option is not used, or otherwise notify the user by a human readable jobmessage that the lockfile modules must be installed. Have a look at https://github.com/bareos/bareos/blob/master/core/src/plugins/filed/python/ovirt/BareosFdPluginOvirt.py
for some example code.

Copy link
Member

@sduehr sduehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided to merge this PR with a little suggested change.
However, as this is only in contrib, we will not yet test or package this plugin.

Copy link
Member

@sduehr sduehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't notice that this is not in contrib, as we currently can't properly test and fully support this plugin, could you please move it to contrib/fd-plugins/openvz7?

@benibr
Copy link
Contributor Author

benibr commented Oct 29, 2021

sorry for the late response. super busy with my new job.
I moved the plugin to contrib

Benedikt Braunger and others added 5 commits November 4, 2021 19:26
Copy link
Member

@sduehr sduehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your contribution, looks good now.

@sduehr sduehr merged commit e519843 into bareos:master Nov 4, 2021
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.

3 participants