The purpose of this tool is to easily manage Virtual Machines (VM) on a Hypervisor. This tool allows to:
- manage VM on a standalone server with KVM
- manage VM on a cluster with Pacemaker (running on top of KVM)
This tool takes as input VM image (qcow2) and configuration (libvirt XML file)
To run vm_manager on your machine for development, the following packages must be installed:
On Debian
sudo apt-get install python3 python3-libvirt python-rbd python3-flaskext.wtf
On Fedora/RHEL
sudo dnf install python3 python3-libvirt python3-rbd python3-flask-wtf
All theses dependencies are satisfied on a SEAPATH machine.
The test suite uses pytest and requires libvirt/QEMU to be available on the host.
pip install .[test]pytest tests/The cluster tests (test_vm_manager_cluster.py and
test_vm_manager_cmd_cluster.py) require a running Pacemaker/Ceph cluster.
To run only the standalone tests, exclude those files:
pytest tests/ \
--ignore=tests/test_vm_manager_cluster.py \
--ignore=tests/test_vm_manager_cmd_cluster.pyThis is what the CI workflow runs. Tests that exercise the cluster code
paths without touching a cluster (argparse, XML building, command
construction) still run here: tests/conftest.py registers stub rados
and rbd modules when the real Ceph bindings are absent, so vm_manager
starts in cluster mode. The stubs raise as soon as they are used, so a test
that reaches real Ceph code fails rather than passing against a fake. See
tests/ceph_stubs.py.
pytest tests/ --cov --cov-report=term-missing --cov-report=htmlBranch coverage is enabled by default (see [tool.coverage.run] in
pyproject.toml). The HTML report lands in htmlcov/. The CI workflow
publishes coverage.xml and htmlcov/ as a build artifact and prints a
summary table in the job summary.
The HTML documentation is generated with Sphinx.
pip install .[docs]sphinx-build -b html docs docs/_build/htmlThe generated documentation is available at docs/_build/html/index.html.
Alternatively, using cqfd (Docker-based build wrapper):
cqfd init
cqfd -b docs