How denisfoulon/xcpng-snapshot-manager works
XCP-ng Snapshot Manager is a one-shot snapshot lifecycle and compliance tool for XCP-ng environments accessed through Xen Orchestra. The main run collects infrastructure inventory, evaluates snapshot and Storage Repository policies, emits administrator-facing reports, optionally remediates expired snapshots, and verifies changes. Separate invocations can process scheduled snapshot requests or perform optional SR maintenance. The graph reflects the documented capabilities; unsampled implementation details are represented only where README or sampled call sites support them.
Main entry points: engine.py Execution engine · xo_provider.py XO provider · snapshot_scheduler.py Scheduled snapshots · snapshot_manager.py Command entry
Components 23
Execution
- Command entry
src/snapshot_manager.py - Configuration loader
src/core/config.py - Execution engine
src/core/engine.py
XO Inventory
- XO provider
src/providers/xo_provider.py - XO REST client
src/clients/xo_client.py - HTTP transport
src/clients/rest_client.py - Infrastructure inventory
src/core/models.py
Compliance
- Check discovery
src/core/discovery.py - Policy checks
src/checks
Lifecycle Operations
- Snapshot remediation
src/core/remediation.py - Post-change verification
src/core/engine.py - Scheduled snapshots
src/core/snapshot_scheduler.py - Snapshot request files
config/snapshot_requests - Request archives
config/snapshot_archives - SR maintenance
src/core/engine.py - Maintenance state
src/core/storage_maintenance.py
Reports
- Report serialization
src/reports/serialization.py - Console reports
src/reports/console.py - JSON report
src/reports/json_report.py - HTML report
src/reports/html_report.py - Report files
Other components
- Administrator
- Xen Orchestra
Connections 28
- Administrator → Command entry: runs command
- Command entry → Configuration loader: loads settings
- Command entry → Execution engine: starts run
- Execution engine → XO provider: collects inventory
- XO provider → XO REST client: requests data
- XO REST client → HTTP transport: sends requests
- HTTP transport → Xen Orchestra: calls API
- XO provider → Infrastructure inventory: builds inventory
- Execution engine → Check discovery: discovers checks
- Check discovery → Policy checks: selects checks
- Execution engine → Policy checks: evaluates inventory
- Execution engine → Report serialization: builds payload
- Execution engine → Console reports: displays results
- Execution engine → JSON report: writes JSON
- Execution engine → HTML report: writes HTML
- JSON report → Report files: writes report
- HTML report → Report files: writes report
- Execution engine → Snapshot remediation: selects candidates
- Execution engine → XO provider: deletes snapshots
- Execution engine → Post-change verification: checks changes
- Post-change verification → XO provider: refreshes inventory
- Execution engine → Scheduled snapshots: processes requests
- Scheduled snapshots → Snapshot request files: reads requests
- Scheduled snapshots → XO provider: creates snapshots
- Scheduled snapshots → Request archives: archives outcomes
- Execution engine → SR maintenance: runs when enabled
- SR maintenance → XO provider: scans repositories
- SR maintenance → Maintenance state: loads and saves state