ODS
- Adds reusable GenericController and DocumentController DSLs for REST APIs.
- Extends ODS::Document and document pools with typed attributes, safe partial updates, raw access, dependency resolution, and per-resource locking.
- Adds reusable document capabilities through StateMachine, Errorable, Historyable, and Jobable.
- Introduces a declarative workflow/job framework with lifecycle transitions, recovery, cancellation, failure handling, and ensure actions.
- Adds JobScheduler for concurrent execution, resource exclusion, persisted job recovery, stale-result protection, and cancellation coordination.
- Adds the common ODS::Command executor with structured logging, timeout, environment/workspace handling, and signal-based cancellation.
- Moves shared OpenNebula resource helpers and common validation/serialization logic into ODS.
- Adds common handling for sensitive document attributes and automatic secret redaction.
OneForm
- Migrates providers and provisions to ODS documents and reuses the new ODS controller infrastructure.
- Replaces the previous lifecycle manager with the declarative ProvisionLCM workflow.
- Persists active operations in provisions and supports automatic recovery after service restarts.
- Adds asynchronous operation cancellation and replaces retry with recover.
- Introduces ResourceManager for dependency-aware, idempotent management and reconciliation of OpenNebula resources.
- Updates the provision API with direct REST operations for recovery, cancellation, hosts, public IPs, and deletion.
- Improves sensitive provider data handling, including redacted credentials and permission-aware access.
- Adapts Terraform and Ansible execution to the ODS job system, including persistent Terraform state, isolated workspaces, improved progress/error logs, and cancellation.
- Updates host and public IP management, including batch host deletion and stable UUID-based host reconciliation.
- Adds common host template support for Terraform-discovered hosts, including IM_MAD and VMM_MAD.
- Adds support for common host templates in deployment definitions, including IM_MAD and VMM_MAD, automatically applied to hosts discovered by Terraform.
- Improves driver management, validation, deployment inputs, synchronization, and host templates.
- Updates the Ruby client and the oneform, oneprovider, and oneprovision CLIs to match the new API and lifecycle semantics.
- Adapt current Sunstone API calls. No new features included.
- Adds onedb and onecfg migrations for server and sunstone configuration.
- Updates bundled drivers and Ansible inventory handling to match the new implementation and remove obsolete warnings.
(cherry picked from commit 1eab0b458a16e0dfaedfd9cef923ee9c05b5d61c)
* Critical failures like all arping fails return exit code 1
* Unable to start/stop service prints warning
* Removed sleep in arping loop between -U and -A
Adds new oned.conf parameter to configure oned IP allocation mode.
REUSE_ADDRESS: Reuse the first available address instead of assigning
addresses in round-robin order for internal address ranges.
sudo-rs (default sudo on Ubuntu 26.04+) rejects wildcards inside command
arguments, so the ONE_NETNS entry 'sysctl -w net.ipv4.conf.*.arp_ignore=0'
made the whole alias unparseable and broke all netns sudo commands on the
node (tproxy/OneGate setup failed).
Set net.ipv4.conf.{all,default}.arp_ignore=0 in the namespace before the
veth device is moved in; the device then re-inherits arp_ignore=0 from
conf.default, so the per-device (wildcarded) sysctl is not needed and the
sudoers entry becomes a fixed string accepted by both sudo flavors.
to allow cross-subnet ARP replies.
Network namespaces can inherit strict ARP policies (where arp_ignore is greater than 0) from the host's default configurations. When this strictness is inherited, it breaks cross-subnet ARP resolution. Specifically, the namespace silently drops and fails to reply to the VM's cross-subnet ARP requests for local endpoints, such as the 169.254.16.9.
This PR explicitly loosens the inherited ARP strictness by forcing arp_ignore=0 inside the namespace. By applying this to both all and the specific interface, it guarantees the namespace will successfully reply to the VM's ARP requests for local IPs.
(cherry picked from commit ba242ba963)
Add DISK_IDS as part of the VM backup configuration so backups can target a
subset of eligible VM disks. The configuration parser now normalizes and
validates the list against the VM and resets the incremental chain when the
selected disk set changes.
co-authored-by: Pavel Czerny <pczerny@opennebula.io>
(cherry picked from commit 59c2cac474de545eddd642e03e3caac8fb47c1cc)
This PR adds Group VLAN authorization rules for Virtual Network self-provisioning
through VN Template instantiation and VNET updates derived from a VN Template.
The feature lets administrators define VLAN usage policies at group level. These policies are
evaluated when users instantiate VN Templates or update VNETs that were instantiated from a VN
Template. Direct VNET allocation is not treated as the tenant self-provisioning path; the intended
multi-tenant model is to expose network creation through reservations and VN Template
instantiation, while direct VNET allocation remains an admin-controlled operation.
Group VLAN rules are stored under `VLAN_RULES` as `RULE` vector attributes.
Rule format:
```txt
RULE = [
ID = "5,6,100-200",
SCOPE = "CVLAN",
VNTEMPLATE = "10,20-30"
]
Fields:
- ID: VLAN values allowed by the rule. Supports single values and ranges, comma-separated.
- Examples: "5", "5,6,100-200"
- SCOPE: VLAN attribute scope controlled by the rule.
- Supported scopes: VLAN_ID, OUTER_VLAN_ID, CVLAN, VLAN_TAGGED_ID, ANY
- VNTEMPLATE: optional VN Template IDs where the rule applies.
- Supports single values and ranges, comma-separated.
- -1 or missing value means the rule applies to any VN Template.
Examples:
RULE = [
ID = "100-200",
SCOPE = "VLAN_ID",
VNTEMPLATE = "10"
]
Allows VLAN_ID values from 100 to 200 when instantiating or updating VNETs derived from VN Template
10.
RULE = [
ID = "300,400-450",
SCOPE = "ANY",
VNTEMPLATE = "-1"
]
Allows the listed VLAN IDs/ranges for any supported VLAN scope and any VN Template.
Rules are parsed into an internal structured representation when group VLAN data is loaded or
updated. Each rule is normalized into:
- scope
- VLAN ID ranges
- VN Template ID ranges
This avoids reparsing raw template attributes during authorization checks.
Validation is applied to these input scopes:
- VLAN_ID
- OUTER_VLAN_ID
- CVLAN
- VLAN_TAGGED_ID
VLAN_ID and OUTER_VLAN_ID are validated as single integer values. CVLAN and VLAN_TAGGED_ID accept
range expressions such as 5,6-10.
For each requested VLAN value or range:
1. The input is parsed into one or more test ranges.
2. Rules are scanned for matching scope, including ANY.
3. Rules are filtered by VN Template ID:
- empty/-1 VNTEMPLATE matches all templates
- explicit ranges match only included template IDs
4. A requested range is accepted only if it is fully covered by a single rule range.
5. The check passes when all requested ranges are covered.
Automatic VLAN selection is rejected when the user belongs to a group with VLAN rules matching the
target VN Template, including global rules. This avoids bypassing explicit group VLAN policy
through automatic allocation.
VNETs instantiated from VN Templates now preserve the source VN Template ID as a first-class VNET
attribute:
<VNET>
...
<TEMPLATE_ID>...</TEMPLATE_ID>
...
</VNET>
TEMPLATE_ID = -1 means the VNET was created directly and was not instantiated from a VN Template.
This ID is immutable from user template updates:
- it is removed from the VNET template body on insert/update
- it is serialized as a top-level VNET attribute
- update operations use the stored value to validate VLAN authorization
A database migrator moves legacy TEMPLATE/TEMPLATE_ID values to top-level VNET/TEMPLATE_ID.
The tenant self-provisioning model for VNETs is based on controlled entry points:
- VNET reservations
- VN Template instantiation
Group VLAN authorization is enforced on VN Template instantiation and on updates to VNETs that were
instantiated from a VN Template.
Direct VNET allocation is not considered the tenant-facing self-provisioning path. It should remain
admin-controlled, as unrestricted VNET creation can expose other sensitive network attributes such
as PHYDEV, BRIDGE, and driver-specific configuration in addition to VLAN IDs.
Existing VNETs created from VN Templates may have the source template ID stored inside TEMPLATE/
TEMPLATE_ID. The migration step moves that value to top-level VNET/TEMPLATE_ID and removes it from
the template body.
This PR also updates the AR operations (add/del/update) so tenants can easily managed the VNET instantiations.
Existing directly-created VNETs will have no source VN Template and are treated as TEMPLATE_ID =
-1.
Existing group objects without VLAN rules are initialized with an empty VLAN_RULES section,
preserving current behavior until rules are explicitly configured.
Configuration compatibility:
- VLAN_ID, CVLANS, and AR/VLAN_ID are no longer expected to be handled through generic VNET
restricted attributes for the VN Template instantiation flow.
- OneCfg migration/update handling for configuration files will be addressed separately before
release.
co-authored-by: Pavel Czerny <pczerny@opennebula.io>
co-authored-by: Miguel E. Ruiz <mruiz@opennebula.io>
co-authored-by: dcarracedo <dcarracedo@opennebula.io>
This commit introduces a new backup driver based on an "interactive" server. The purpose is to ease the integration of third-party backup systems so they are able to pull backups/increments from the hypervisors:
- New backup driver
- New OpenNebula Backup Exporter (OneBEX). The REST API supports: status,
export, exporters, blocks, data and finish.
- Initial support for file based virtual disks (incrementals only support CBT)
- Refactor backup_qcow2 to accomodate the new logic
- New restore logic to directly write images to the datastore from the backup service.
Co-authored-by: Ruben S. Montero <rsmontero@opennebula.org>
- Configure Open vSwitch VF representor ports
- Apply VLAN, QinQ, and trunk tagging to representors
- Clear OVS port tags when VLAN_ID is empty on update
- Update monitoring components for the new network support
- Fix non string message driver logging
- #7707, fix update VLAN IDs
co-authored-by: Ruben S. Montero <rsmontero@opennebula.org>
New configuration attribue MAC_GLOBAL_SPACE in oned.conf to enable the global
MAC address space generation mode.
MAC addresses are generated from a global pool preventing collisions across
VNETs. This does not apply to IP networks and limits the number of VNETs to
2^20, with a max of 2^20 leases per VNET.
This commit also implementes:
* A round-robin assignment of addresses. (jukka.jokiniva@qt.io)
* Optimizes the storing of the BitMap - do not store leading zeros
co-authored-by: Pavel Czerny <pczerny@opennebula.io>
co-authored-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
Extend the FireEdge log fix to oned, oneflow, oneform, onegate and
onehem so they share the same rotation behavior:
- Add compress / compressoptions -9 / delaycompress to the logrotate
configs. With copytruncate, delaycompress avoids gzipping the
freshly-rotated file in the same pass and keeps service restarts
fast even when ExecStartPre runs logrotate -f.
- Drop the synchronous gzip ExecStartPre loops from each unit. The
glob (e.g. oneflow*.log) does not match files rotated with
dateformat -%Y%m%d-%s, so the loop was ineffective, and running
gzip without backgrounding blocked startup.
- Ship a logrotate config for oneform; the unit was pointing at
/etc/logrotate.d/opennebula-form but no such file existed, so
oneform.log was never rotated.
- src/hem/bin/onehem-server: use >> instead of > so restarts via the
shell wrapper do not truncate the log, matching oneflow / onegate /
oneform / fireedge wrappers (originally fixed in #6034).
Signed-off-by: Mikalai Kutouski <mkutouski@opennebula.io>
Co-authored-by: Jan Orel <jorel@opennebula.io>
Add load_opennebula_paths stub to the CLI gem and include the missing
opennebula/lib/ files in the OCA gem so both gems work when installed
standalone via RubyGems.
OpenNebula Document Server (ODS) is a lightweight Sinatra-based server that
provides a foundation for building API servers within the OpenNebula ecosystem
which work with Documents. It can be used as a base class for custom services,
making it easier to maintain consistency across different OpenNebula
servers.
Features
========
- Provides a configurable base server class that can be inherited.
- Centralized logging setup with `LogConfig`.
- Supports modular route registration via `AppRoutes`.
- Easy configuration through `ConfigLoader`.
- Preconfigured error handling and exception management.