Modern Python CLI and SDK for OpenNebula
Project description
opennebula-cli
opennebula-cli is a CLI-first Python toolkit for OpenNebula 7.0.x.
It is built for operators, platform teams, CI/CD pipelines, and Python automation that need a modern interface to OpenNebula without giving up the familiar onevm-style workflows.
Why use it
- Canonical command tree for automation:
one <resource> <verb> - Compatibility shims for existing operator habits:
onevm,onehost,oneimage,onetemplate,onevnet,onedatastore,onecluster - Typed SDK for Python integrations under
opennebula_cli.sdk - Deterministic machine-readable output for scripts and pipelines
- Live-validated against a disposable OpenNebula CE
7.0.xdeployment before release
Install
Install the release that matches the OpenNebula compatibility line you want:
uv tool install opennebula-cli==7.0.1
Run it without installing permanently:
uvx --from opennebula-cli==7.0.1 one --help
For local development:
uv sync --group dev
uv run one --help
uv run onevm --help
Authenticate safely
Recommended for operators and CI:
mkdir -p "$HOME/.one"
chmod 700 "$HOME/.one"
printf 'oneadmin:super-secret-token\n' > "$HOME/.one/one_auth"
chmod 600 "$HOME/.one/one_auth"
export ONE_XMLRPC="https://opennebula.example.com/RPC2"
export ONE_AUTH="$HOME/.one/one_auth"
Avoid exporting raw user:secret values directly in shell history unless you are intentionally using literal: for a short-lived task.
Supported auth forms:
ONE_AUTH=/path/to/authfileONE_AUTH=file:/path/to/authfileONE_AUTH=literal:user:secretone --user oneadmin ...with a secure password prompt
Command model
Canonical commands:
one [GLOBAL OPTIONS] <resource> <verb> [RESOURCE ARGS] [RESOURCE OPTIONS]
Compatibility commands:
one<resource> [GLOBAL OPTIONS] <verb> [RESOURCE ARGS] [RESOURCE OPTIONS]
Examples:
one vm list
one --output json vm list
one --profile prod --no-pager template show 24
onevm list
onevm --output json list
onecluster --profile prod show 0
Global options such as --output, --profile, --endpoint, and --auth belong before the resource verb on the canonical CLI and before the verb on compatibility wrappers.
Quick examples
Human-readable operator output:
one vm list
one template show 24
onehost show 0
Machine-readable automation output:
one --output json vm list
one --output yaml template show 24
onevnet --output json list
CI/CD example:
VM_ID="$(
one --output json vm list \
| jq -r '.[] | select(.name == "build-runner") | .id'
)"
one --output json vm show "$VM_ID"
New in 7.0.1: workflow templating and VM initialization
This release adds an end-to-end workflow system for template rendering and VM provisioning:
one workflow template init|render|import|applyone workflow vm initfor single VM initializationone workflow vm applyfor bulk initialization from a list- cloud-init helper functions for Jinja templates:
read_file(path)read_file_b64(path)fetch_url(url, method=..., headers=..., params=..., body=..., timeout=...)
Template workflow example:
one workflow template init ./openclaw-workflow
one workflow template render ./openclaw-workflow/workflow.yaml \
--vars-file ./openclaw-workflow/vars.example.yaml
one workflow template import ./openclaw-workflow/workflow.yaml \
--vars-file ./openclaw-workflow/vars.example.yaml
Bulk VM initialization example:
one workflow vm apply docs/examples/05-vm-init/bulk-init.yaml \
--wait-ready \
--set global.name_prefix=user-vm-
Single VM initialization example:
one workflow vm init docs/examples/05-vm-init/bulk-init.yaml --vm-name alice
Read the full guide:
docs/workflows-vm-templates.mdxdocs/examples/README.md
Supported command families
Wave 1:
vm:list,show,poweroffhost:list,show,flushimage:list,show,deletetemplate:list,show,delete,instantiate
Wave 2 read-only:
vnet:list,showdatastore:list,showcluster:list,show
Workflow automation:
workflow template:init,render,import,applyworkflow vm:init,apply
Validation status for 7.0.1
7.0.1 targets OpenNebula 7.0.x and maintains the compatibility baseline validated against:
- Ubuntu
24.04 - OpenNebula CE
7.0.x - single-node frontend
- localhost
lxchost
Live-validated surfaces:
- read-only
listandshowcoverage forvm,host,image,template,vnet,datastore, andcluster - disposable mutation validation for:
template instantiatevm poweroff --wait
Implemented but not yet fully live-validated on disposable fixtures:
host flushimage deletetemplate delete
Workflow template and VM initialization additions are validated through unit/integration test coverage and runnable docs examples.
Configuration and profiles
Configuration precedence:
- CLI flags
- selected profile
- environment variables
- defaults
Key environment variables:
ONE_XMLRPCONE_AUTHONE_XMLRPC_TIMEOUTONE_CERT_DIRONE_DISABLE_SSL_VERIFYONE_PAGERONE_LISTCONFONE_POOL_PAGE_SIZE
Profile config lives at the platform config directory for opennebula-cli, for example:
- macOS:
~/Library/Application Support/opennebula-cli/config.toml - Linux:
~/.config/opennebula-cli/config.toml
Example:
default_profile = "prod"
[profiles.prod]
endpoint = "https://opennebula.example.com/RPC2"
auth = "file:/home/ops/.one/prod_auth"
output = "table"
timeout = 60
verify_ssl = true
SDK
from opennebula_cli.sdk import OneClient
client = OneClient.from_env()
for vm in client.vm.list():
print(vm.id, vm.name, vm.state)
Live capture for private environments
When credentials cannot be shared, use the read-only capture workflow:
tools/capture_live_readonly.sh --write-artifact > /tmp/opennebula-capture.jsonl
uv run python tools/import_live_capture.py import --input /tmp/opennebula-capture.jsonl
The capture path:
- only runs allowlisted
--help,list, andshowcommands - never runs create, update, delete, or lifecycle operations
- redacts endpoints, hostnames, IPs, MACs, and secret-like fields
- writes private artifacts under
refs/tasks/live-capture/
Remote E2E harness
The repo includes an assh-backed workflow for disposable OpenNebula validation VMs:
ONE_E2E_TARGET_ALIAS=opennebula-e2e \
ONE_E2E_TARGET_ENDPOINT=root@vm.example.com \
ONE_E2E_REMOTE_ROOT=/mnt/opennebula-cli-e2e \
ONE_E2E_MODE=manual-frontend \
ONE_E2E_VALIDATE_LOCAL=1 \
bash tools/e2e_run_live.sh
That flow:
- bootstraps a disposable OpenNebula CE frontend
- seeds
e2e-*fixtures - runs live read-only and mutation E2E from the current checkout
- imports sanitized read-only observations
- cleans up disposable
e2e-vm-*VMs afterward
Staging-lab bootstrap
For multi-node staging environments, this repo also ships simple bootstrap helpers:
export STAGING_FRONTEND=104.130.246.124
export STAGING_HYPERVISORS=104.130.246.141,104.130.246.135,104.130.246.139,104.130.246.134
export STAGING_HYPERVISOR_NAMES=lab-hv-01,lab-hv-02,lab-hv-03,lab-hv-04
bash tools/staging_bootstrap_cluster.sh gather
bash tools/staging_bootstrap_cluster.sh prepare
bash tools/staging_bootstrap_cluster.sh install-common
bash tools/staging_validate_cluster.sh capture
These scripts intentionally cover the repeatable host-preparation and read-only validation layers. Higher-level OpenNebula, Ceph, and Omni service bootstrap remains environment-specific and is documented in the consuming repos.
Versioning and releases
Public package versions now mirror the OpenNebula compatibility target.
- current release:
7.0.1 - compatibility target: OpenNebula
7.0.x - historical bootstrap release:
0.1.0
Release tags must always match project.version exactly:
uv run python tools/check_release_version.py --tag v7.0.1
git tag -a v7.0.1 -m "Release v7.0.1"
Docs
Tracked public documentation lives in docs/:
docs/index.mdxdocs/getting-started.mdxdocs/command-model.mdxdocs/workflows-vm-templates.mdxdocs/configuration.mdxdocs/sdk.mdxdocs/testing.mdxdocs/parity-roadmap.mdxdocs/contributing.mdx
Development checks
uv run ruff check .
uv run mypy src tests tools
uv run pytest
uv run python tools/check_catalog_schema.py
uv build
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opennebula_cli-7.0.1.tar.gz.
File metadata
- Download URL: opennebula_cli-7.0.1.tar.gz
- Upload date:
- Size: 44.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e20bd8af3caa46421fa020092235bfa708c51daa3294ed22b40febe311a024a
|
|
| MD5 |
d071d020d6f1a1e03e031b7491cf7432
|
|
| BLAKE2b-256 |
c89ae7d839e32683c3a68288e73e59e3ca0dc1c24301419305de1db3fe829199
|
Provenance
The following attestation bundles were made for opennebula_cli-7.0.1.tar.gz:
Publisher:
release.yml on SparkAIUR/opennebula-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opennebula_cli-7.0.1.tar.gz -
Subject digest:
3e20bd8af3caa46421fa020092235bfa708c51daa3294ed22b40febe311a024a - Sigstore transparency entry: 1322356066
- Sigstore integration time:
-
Permalink:
SparkAIUR/opennebula-cli@deba8c5f05f3bce5e251ad64bb6d53c7c6007b6a -
Branch / Tag:
refs/tags/v7.0.1 - Owner: https://github.com/SparkAIUR
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@deba8c5f05f3bce5e251ad64bb6d53c7c6007b6a -
Trigger Event:
push
-
Statement type:
File details
Details for the file opennebula_cli-7.0.1-py3-none-any.whl.
File metadata
- Download URL: opennebula_cli-7.0.1-py3-none-any.whl
- Upload date:
- Size: 79.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
394b04743a0857fb78ba3e13924b75481ec15d16f34bcfc8b199ad935bc3613e
|
|
| MD5 |
5ae9fa99451c7a1b953fa8423181ba14
|
|
| BLAKE2b-256 |
1ba0121345759217c338ab926a2fae5f616ed122298af12a35226d97c5f9dbb5
|
Provenance
The following attestation bundles were made for opennebula_cli-7.0.1-py3-none-any.whl:
Publisher:
release.yml on SparkAIUR/opennebula-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opennebula_cli-7.0.1-py3-none-any.whl -
Subject digest:
394b04743a0857fb78ba3e13924b75481ec15d16f34bcfc8b199ad935bc3613e - Sigstore transparency entry: 1322356441
- Sigstore integration time:
-
Permalink:
SparkAIUR/opennebula-cli@deba8c5f05f3bce5e251ad64bb6d53c7c6007b6a -
Branch / Tag:
refs/tags/v7.0.1 - Owner: https://github.com/SparkAIUR
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@deba8c5f05f3bce5e251ad64bb6d53c7c6007b6a -
Trigger Event:
push
-
Statement type: