Commit Graph
1778 Commits
Author SHA1 Message Date
Pavel Czerný a85ee3d759 M #-: Remove obsolete data_vmx (#4449)
* sync updateconf description with code
2026-08-26 14:45:38 +02:00
Pavel Czerný 027f7ded48 F #7936: Add option to preserve HA settings for onezone serversync (#4389) 2026-08-13 17:07:44 +02:00
Jan Orel e25c52c4bf M #-: Fix ambiguous assignment in one_helper 2026-08-06 11:12:35 +02:00
Pavel Czerný 4fe17b8ee9 B #7925: Consider PCI NIC for onevm ssh and port-forward (#4374) 2026-08-04 11:46:20 +02:00
Tino Vázquez d550eb4a27 L #-: linting for rubocop 1.88.2 2026-07-24 10:28:18 +02:00
Ruben S. Montero ea9175969f M #-: Fix oneuser show command when EGID is set 2026-07-21 13:27:43 +02:00
Pavel Czerný d1c2d07a4c M #-: Remove deprecated CLI methods (#4295) 2026-07-09 15:56:11 +02:00
Pavel Czerný 6f44ae3af1 M #-: Fix CLI user inputs while instantiating VM template (#4294) 2026-07-07 10:16:28 +02:00
Ruben S. Montero 4b00876502 F #7615: add selected disk support for backups
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)
2026-07-01 22:29:39 +02:00
d48a32e252 F #7490: VLAN Groups for VNET multi-tenancy
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>
2026-06-24 11:26:36 +02:00
Victor Palma 5e1fd83026 F #7594: Add sched-delete action to flow 2026-06-23 12:17:49 +02:00
Jan Orel d032c10d08 B #-: Make onehost tolerant of missing HostSyncManager (#4270)
on CLI-only
2026-06-22 15:22:45 +02:00
Ruben S. Montero df7ee58367 F #7678: Minor fixes
- Fix dummy NIC CLI template generation
- Fix case cmp's for dummy NIC handling
2026-06-12 15:00:02 +02:00
Pavel Czerný 87d55b2cf9 F #7678: Dummy NIC interface for VM (#4251) 2026-06-12 14:29:08 +02:00
Pavel Czerný 352b53e8ab B #7725: Fix method name mismatches for HA forwarding (#4255)
(cherry picked from commit d5971151ed)
2026-06-11 17:38:09 +02:00
MarioRobresandRuben S. Montero 7a69805a8d F OpenNebula/one#7660: Interactive Backup EXport server for third-party backup/restore solutions (#4260)
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>
2026-06-11 17:27:41 +02:00
Victor Palma c596cf8612 F OpenNebula/one#7644: Add shared ODS streaming support and VM exec helper (#4239)
Adds shared ODS support required for streaming operations and VM guest command execution.

- Adds Server-Sent Events (SSE) support to ODS responses through `stream_events` and `EventStream`.
- Implements incremental SSE response parsing and exposes each event payload to callers, enabling progress tracking.
- Adds ODS client support for streaming POST requests with `post_stream`.
- Adds `EventProgressPrinter` for CLI commands consuming streamed progress events, including spinner support for interactive terminals and plain output for non-TTY environments.
- Extracts a reusable `OneHelper::VirtualMachine.exec` helper from K8sHelper to execute commands through VM exec, making it accessible from other components such as the Cluster Readiness Service.
2026-05-28 13:27:31 +02:00
Victor Palma 8290af0733 B #-: Improve CLI JSON input handling (#4213) 2026-05-14 11:55:28 +02:00
Guillermo Ramos a334e30f48 B #-: Recover 7260d2d3 + escape dashed Ruby symbol (#4201)
Signed-off-by: Guillermo Ramos <gramos@opennebula.io>
2026-05-12 12:03:14 +02:00
Ruben S. Montero bb6f6256be Revert "F #-: Fix inconsistency in onevm --help (#4199)"
This reverts commit 7260d2d3ba.
2026-05-12 09:17:09 +02:00
Guillermo Ramos 7260d2d3ba F #-: Fix inconsistency in onevm --help (#4199)
Signed-off-by: Guillermo Ramos <gramos@opennebula.io>
2026-05-11 17:36:03 +02:00
Pavel Czerný 7f6b45ecc4 F #4159: Allow dynamic VMGroup management (#4172) 2026-05-11 10:58:30 +02:00
Victor Palma ea1df5ffec F #7259: Add OpenNebula Document Server (ODS)
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.
2026-04-28 09:03:45 +02:00
Pavel Czerný af05910b1a M #-: Improve error messages for onezone serversync (#4174) 2026-04-27 09:57:22 +02:00
Ruben S. MonteroandGuillermo Ramos 16c1ccf4bc F one#5774: Add per-VM live migration options
Add support for per-VM migration flags (--auto-converge and --compressed)
controlled by VM template attributes:

- MIGRATE_AUTO_CONVERGE: Initial CPU throttling rate/increment (ranges: 0-100).
  Format: <initial>[,<increment>]
- MIGRATE_COMPRESSED: Enable migration compression (YES/NO). Default: NO

This commit also adds a FEATURES parser and use it during VM creation and updateconf.

The parser normalizes boolean FEATURES values, validates GIC and MIGRATE_AUTO_CONVERG.

Since FEATURES are normalized in oned, the commit removes some redundant checks.

updateconf allow updates GIC, RAS, MIGRATE_* options

See also https://libvirt.org/manpages/virsh.html#migrate

Author: Guillermo Ramos <gramos@opennebula.io>

co-authored-by: Guillermo Ramos <gramos@opennebula.io>
co-authored-by: Ruben S. Montero <rsmontero@opennebula.org>

Signed-off-by: Guillermo Ramos <gramos@opennebula.io>
2026-04-21 13:36:50 +02:00
Pavel Czerný 37524d156e L #-: Ruby linting src/cli/* files (#4159) 2026-04-20 11:34:39 +02:00
Pavel Czerný 63b6e50dcb B #7458: Fix empty --resource for onegroup create (#4146) 2026-04-06 15:21:39 +02:00
Ruben S. Montero ebbb7be5d4 M #-: Bump version 7.3.80 2026-03-30 09:58:53 +02:00
Pavel Czerný 721c143f20 M #-: Fix typo in user_helper quotas (#4127) 2026-03-25 15:23:27 +01:00
David 2ebe4ee328 M #-: Add oneform man page (#4104)
Signed-off-by: dcarracedo <dcarracedo@opennebula.io>
2026-03-19 19:15:40 +01:00
bffbecedc0 F #913: Storage live migration
The following TM's now support storage live migrations:

- File system based (local and shared variants)
- LVM based (pure LVM, and LVM thin)

The LVM TM's does not support migrating a VM with disk snapshots.

co-authored-by: Guillermo Ramos <gramos@opennebula.io>
co-authored-by: josepselga <jselga@opennebula.io>

Author: Guillermo Ramos <gramos@opennebula.io>
2026-02-17 09:45:33 +01:00
Victor Palma 2dccd80347 B #-: OneForm fixes (#4049)
* Add form option to install.sh
*  Improve CLI redacted output
* Add dummy OneForm drivers to simulate operation time
* Read from sensitive
* Fix delete operation
2026-02-09 09:53:03 +01:00
Pavel Czerný 03e59c5718 M #-: Fix return code for onetemplate clone (#4047) 2026-02-06 17:27:17 +01:00
MarioRobres f46e7953ee B #7455: remove LEASES from updatear (#4030) 2026-02-04 12:05:02 +01:00
Pavel Czerný 9f0c7dc334 B #7254: Fix copy-paste typo in oneuser and onegroup helper (#4041) 2026-02-04 09:40:09 +01:00
Pavel Czerný 52d6ec7e07 B #7254: Fix quotas for CLI oneuser and onegroup list (#4035) (#4040)
* Fix `onegroup list` for cluster quota
* Fix `onegroup list` and `oneuser list` for duplicit VM_QUOTA
* Linting
2026-02-03 10:23:00 +01:00
Ruben S. Monteroandvickmp baae300fb8 F #7460: Updates to oneform server
- Lint
- Add bash completion for oneform commands
- Driver state is now stored in /var/lib/one/oneform
- Improve rendering of descriptions in CLI (HTML/MD support)
- Move cloud providers to oneform registry
- Disable dummy driver by default
- Qeury paths for driver/provider list

co-authored-by: vickmp <vpalma@opennebula.io>
2026-02-02 19:50:01 +01:00
Pavel Czerný a29cf07b0b F #6778: Fix build with grpc=no (#4029) 2026-02-02 12:29:40 +01:00
Miguel E. Ruiz 52ccc2d67e F OpenNebula/one-form#62: Sunstone integration with OpenNebula Form (#4026) 2026-01-27 10:22:55 +01:00
Ruben S. Montero 6be7ed9362 M #- [OneForm]: Add support for user inputs in templates
This commit replaces {{user_inputs.<input>}} strings in OpenNebula
template: sections. This way common parameters for datastores and
networks can be defined by the user.

Change "force" message in API error message

Fix onecluster show

OnPrem clusters:
  - Improve naming and descriptions
  - Add method to precreate datastore folder dirs
  - Adjust site.yaml
2026-01-23 21:19:21 +01:00
8f57c337e1 F OpenNebula/one#6778: Introduces a gRPC API server for OpenNebula Demon
This commit introduces a new API server based on the gRPC/Protobuf. The
API follow the design of the existing xml-rpc to ease the transition to
the new server and support the current state management engine.

Both API servers can be run in parallel.

Main changes:

- Decouple Generic and XMLRPC specific logic and add gRPC classes.
- Source code re-structure to include logic for each server
- New compilation options to generate gRPC stubs
- Client code for C++, Ruby, Python and Go

co-authored-by: Jan Orel <jorel@opennebula.io>
co-authored-by: Pavel Czerny <pczerny@opennebula.io>
co-authored-by: MarioRobres <mrobres@opennebula.io>
2026-01-12 14:58:55 +01:00
MarioRobres 826f630f00 F OpenNebula/one#7299: Add new API calls to execute commands on a Virtual Machine (#3954)
This commit adds support for remote execution of commands in a VM through qemu Guest Agent (GA). The feature includes:

* New API calls so create, cancel and retry command execution
* Command results are included in VM information
* Command line tool exposing this functionality
* Monitor probe to reap execution of commands
2025-12-10 09:41:07 +01:00
bfccb59244 F OpenNebula/one#7361: Introduce OneForm (#3930)
Co-authored-by: Victor Palma <vpalma@opennebula.io>
Co-authored-by: Miguel E. Ruiz <mruiz@opennebula.io>
Co-authored-by: Ruben S. Montero <rsmontero@opennebula.org>
2025-11-13 17:06:42 +01:00
MarioRobres de46992f0c F OpenNebula/one#7235: Auto-enable index during multiple persistent VMs (#3896) 2025-11-05 13:50:53 +01:00
Pavel Czerný 77fae428d6 M #-: Fix CPUS typo in onehost_helper (#3816) 2025-09-22 14:58:21 +02:00
Ruben S. Montero 54f21aae0f M #-: Skip NUMA CPU cores information for non-cpu nodes
For example in some ARM architectures

(cherry picked from commit 378684229b)
2025-09-20 14:06:11 +02:00
Jan Orel 2a7f32b748 M #-: Switch to ruby-augeas (#3789) 2025-09-17 13:29:22 +02:00
MarioRobres aadbb4ee30 F OpenNebula/one#6408: Support for internal snapshots in UEFI VMs (#3792) 2025-09-16 17:06:26 +02:00
Ruben S. Montero 370a3daf64 F OpenNebula/one#7221: Add GPU monitoring & forecast for VMs
This commit extends the KVM domain probe to monitor NVIDIA GPUs:

* GPU metrics: GPU_UTILIZATION, GPU_MEMORY_UTILIZATION, GPU_MEMORY_FREE,
  GPU_POWER_USAGE, GPU_COUNT

* Implements method for NVIDIA GPUs. The code is prepared to add AMD
  vendor in the future

* NVIDIA monitor uses nvidia-smi through qemu guest-agent those are
  requirements for the VM to report metrics

* oned now adds PCI information (vendor, device and class) to all PCI
  devices (i.e. even if using SHORT_ADDRESS).

* KVM metadata include PCI devices in the VM to skip VMs not using
  supported GPU's

Signed-off-by: josepselga <jselga@opennebula.io>
2025-09-10 14:40:58 +02:00
Pavel Czerný f68c826ac8 F #951: Quota for PCI devices (#3756)
This commit adds support for PCI device quotas. It includes the following new attributes:

- PCI_NIC (and RUNNING_PCI_NIC), to account for PCI devices of TYPE = NIC
-  PCI_DEV (and RUNNING_PCI_DEV), to account for generic PCI devices  

This commits also includes:
  - Simpler naming of the onegroup/oneuser quota names (RUNNING is now just label as RUN and SYSTEM_DISK_SIZE  is now DISK SIZE)
- Consolidation of some duplicated logic in oned
- Golang bindings has been extended to include the new quota
- fsck update for the new quotas
- migrator for 7.2.0 release
2025-09-10 09:54:44 +02:00