Skip to content

Repository files navigation

ovirt-inventory

ovirt-inventory is a containerized inventory web app for oVirt/RHV estates. It stores oVirt Manager connection records, runs backend-triggered read-only collection through official oVirt Engine REST APIs, keeps inventory history, shows dashboard and VM inventory views, and exports inventory data.

Container Image

The multi-architecture image is published to GitHub Container Registry:

docker pull ghcr.io/dennis-au/ovirt_stocktake:latest

Supported platforms:

  • linux/amd64
  • linux/arm64

Release image:

docker pull ghcr.io/dennis-au/ovirt_stocktake:v0.1.33

Quick Start With Docker Compose

Docker Compose is the supported deployment. It starts ovirt-inventory with PostgreSQL, persistent storage for both application state and normalized inventory, and Capacity metrics collection enabled. The data stays in ./inventory_data and ./postgres_data beside compose.yaml, so it is straightforward to back up and restore.

./setup.sh

setup.sh creates .env, generates the PostgreSQL password, session secret, credential-encryption key, and an admin password with OpenSSL, and prints the configured admin password once. It will not overwrite an existing .env. Review or edit .env before starting the stack.

Start the stack:

docker compose pull
docker compose up -d

Open the app at http://localhost:3001. Compose does not publish PostgreSQL to the host. Keep OVIRT_INVENTORY_SECURE_COOKIES=false for direct HTTP access; set it to true behind an HTTPS reverse proxy.

./inventory_data stores SQLite-backed application state such as login sessions, encrypted Manager credentials, snapshots, and saved views. ./postgres_data stores normalized inventory and the separate Capacity metric samples. Stop the stack with docker compose down; it leaves both data folders intact. Delete either folder only when intentionally removing its persistent data.

To use a different published image, set OVIRT_INVENTORY_IMAGE in .env. For example, use ghcr.io/dennis-au/ovirt_stocktake:latest after reviewing the release you intend to run.

Downloadable Compose Bundle

Each GitHub release includes an ovirt-inventory-compose-v0.1.33.tar.gz deployment bundle containing compose.yaml, empty inventory_data/ and postgres_data/ folders, .env.example, setup.sh, and this README. Download, extract, generate the editable .env, then start the app:

curl -LO https://github.com/dennis-au/ovirt_stocktake/releases/download/v0.1.33/ovirt-inventory-compose-v0.1.33.tar.gz
tar -xzf ovirt-inventory-compose-v0.1.33.tar.gz
cd ovirt-inventory-compose-v0.1.33
./setup.sh
# Optionally edit .env, for example to change the host port.
docker compose pull
docker compose up -d

Runtime Configuration

Variable Purpose
OVIRT_INVENTORY_HOST_PORT Host port for Docker Compose. Defaults to 3001.
POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD PostgreSQL Compose service settings. POSTGRES_PASSWORD must be supplied.
OVIRT_INVENTORY_PORT HTTP port inside the container. Defaults to 3000.
OVIRT_INVENTORY_ENV_FILE Optional .env file path for non-Compose container deployments. Defaults to /data/.env in the container.
OVIRT_INVENTORY_DB_PATH SQLite database path. Defaults to /data/ovirt-inventory.sqlite.
OVIRT_INVENTORY_DATABASE_URL PostgreSQL connection URL for normalized inventory and Capacity metrics.
OVIRT_INVENTORY_DATABASE_SSL Require SSL for the PostgreSQL connection. Defaults to false.
OVIRT_INVENTORY_METRICS_BACKEND Set to postgres, timescale, or timescaledb to enable Capacity metrics collection. Compose sets this to postgres.
OVIRT_INVENTORY_METRICS_SYNC_MINUTES Initial Capacity metrics collection cadence. Defaults to 5; administrators can change it in Settings.
OVIRT_INVENTORY_COLLECTOR_ENABLED Deployment-level master switch for durable scheduled collection. Defaults to true; set to false to keep all schedules disabled.
OVIRT_INVENTORY_ENCRYPTION_KEY Required for encrypting saved oVirt Manager credentials.
OVIRT_INVENTORY_SESSION_SECRET Required session signing secret for app login.
OVIRT_INVENTORY_SECURE_COOKIES Set false for direct HTTP access, or true behind HTTPS. Defaults to true in production when unset.
OVIRT_INVENTORY_ADMIN_USERNAME Admin username. Defaults to admin.
OVIRT_INVENTORY_ADMIN_PASSWORD_HASH Admin password hash generated by the app tooling.
OVIRT_INVENTORY_ADMIN_PASSWORD Optional plaintext admin password fallback loaded from .env and hashed in memory at startup.
OVIRT_INVENTORY_OVIRT_ALLOW_INSECURE_TLS Global insecure TLS override. Keep false unless testing in a lab.
NODE_EXTRA_CA_CERTS Preferred way to trust private oVirt Manager CA certificates.

Prefer trusted CA certificates through NODE_EXTRA_CA_CERTS instead of insecure TLS. Do not put oVirt passwords, bearer tokens, or lab credentials in image tags, README examples, logs, or exports.

Capacity Metrics

Capacity uses collected oVirt VM and host statistics plus storage-domain utilization; it does not use browser-side dummy data. Capacity requires PostgreSQL and a supported metrics backend. The supplied Compose deployment enforces both requirements by connecting the app to its bundled PostgreSQL service, setting OVIRT_INVENTORY_METRICS_BACKEND=postgres, and enabling the collector. After configuring one or more Managers, run the first collection from the Managers page or wait for the configured OVIRT_INVENTORY_METRICS_SYNC_MINUTES cadence.

Settings

Admins can open Settings in the app to configure miscellaneous snapshot policy:

  • Inventory and Capacity metrics collection can each be enabled or disabled in Settings, with a user-configurable interval from 1 to 1440 minutes. The application reconciles PostgreSQL-owned schedule state every 30 seconds, then calls the same backend per-Manager collection services used by manual collection. Managers run sequentially; a failed scheduled collection is recorded once and skipped until its next configured interval.
  • Settings shows the most recent scheduler heartbeat and highlights a schedule whose next run is overdue. PostgreSQL dispatch runs have heartbeats and are recovered after a process interruption, without deleting known-good inventory.
  • OVIRT_INVENTORY_COLLECTOR_ENABLED=false remains a deployment-level master switch. Environment interval values only provide initial defaults until an administrator changes the values in Settings.
  • Snapshot data retention in days. Set 0 to keep snapshot history indefinitely. When set above 0, snapshots older than the retention window are pruned after settings are saved and after future collection runs.

Features

  • Authenticated operational dashboard for multiple oVirt Managers.
  • Encrypted oVirt Manager credential storage.
  • Manual backend collection using read-only oVirt Engine REST API calls.
  • Snapshot history with success, partial, and failed status visibility.
  • Cluster and VM inventory views.
  • CSV, PDF, JSON, and Excel-oriented export flows.
  • Multi-architecture container build using Docker Desktop Buildx or GitHub Actions Buildx.

Build Locally

npm ci
npm run typecheck
npm test
npm run build
npm run compose:config
npm run compose:bundle

Build a multi-arch container image:

docker buildx build \
  --platform linux/amd64,linux/arm64 \
  -t ghcr.io/dennis-au/ovirt_stocktake:latest \
  .

Push with Buildx:

docker buildx build \
  --platform linux/amd64,linux/arm64 \
  -t ghcr.io/dennis-au/ovirt_stocktake:latest \
  --push \
  .

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages