Commit Graph

798 Commits

Author SHA1 Message Date
Wei Zhou b6500ca7e3 extension: remove resourceId and resourceType from listExtensions 2026-05-12 10:16:27 +01:00
Marco Sinhoreli f6dc4f36ad NE: persist OVN broadcast type and URI on Network for vif.binding=lswitch
Companion to the NIC-level URI override -- when an extension declares
vif.binding=lswitch, the Network row itself should advertise
``broadcast_domain_type=Lswitch`` and ``broadcast_uri=ovn://cs-net-<id>``
so listNetworks / details views are consistent with what the OVN
control plane represents.

Without this hook the GuestNetworkGuru still allocated a VLAN at
design time, which leaks back into the UI:

   VLAN/VNI:        138
   Broadcast URI:   vlan://138

Apply the override on a successful ``implement-network`` script return
in NetworkExtensionElement.implement().  The VLAN that the guru
allocated stays as a ghost in op_dc_vnet_alloc -- it is never used on
the wire because the VIF attaches to br-int and traffic flows through
OVN's logical pipeline over geneve.  Releasing the VLAN back to the
pool would require intercepting the design phase and is out of scope
for this hook.

Verified end-to-end: i-2-27-VM on network 216 now lists

   networks.broadcast_uri          = ovn://cs-net-216
   networks.broadcast_domain_type  = Lswitch
   nics.broadcast_uri              = ovn://cs-net-216
   nics.isolation_uri              = ovn://cs-net-216

The OVN NB LSP / OVS iface-id / OVN SB Port_Binding remain bound, as
before.
2026-05-12 10:16:27 +01:00
Marco Sinhoreli c3aaf658b1 NE: persist OVN broadcast/isolation URI on NIC for vif.binding=lswitch
Delta 1 already overrides nic.setBroadcastType(Lswitch) on the
NicProfile during prepare() so the KVM agent picks the OVS Lswitch
path. But the underlying nics row still carried the cosmetic
``vlan://<id>`` URI allocated by GuestNetworkGuru at design-time, which
is misleading on listNics / DB queries: a NIC sitting on an OVN
logical switch should not advertise a VLAN URI.

Override broadcast_uri and isolation_uri on the NicProfile to
``ovn://cs-net-<networkId>`` (the convention used by the legacy
ovn-plugin) and persist the same on the nics row via nicDao.update.
The VLAN that the guru allocated stays as a ghost in
op_dc_vnet_alloc -- it is never used on the wire because the VIF
attaches to br-int and traffic flows through OVN's logical pipeline
over geneve. Releasing the VLAN back to the pool would require
intercepting the design phase, which is out of scope for this hook.

Verified end-to-end: i-2-24-VM on network 214 now lists

   broadcast_uri = ovn://cs-net-214
   isolation_uri = ovn://cs-net-214

and the OVN NB LSP / OVS iface-id / OVN SB Port_Binding remain
correctly bound to the chassis, as before.
2026-05-12 10:16:27 +01:00
Marco Sinhoreli 0edce199a0 NE: VIF binding hooks for OVS-backed extensions
CloudStack's existing OvsVifDriver already binds NICs correctly when the
NicProfile's BroadcastDomainType is Lswitch: it emits libvirt
<virtualport type='openvswitch' interfaceid='<nic.getUuid()>'/> and
libvirt sets external_ids:iface-id atomically with tap creation.  No
agent patch is required for OVS-backed extensions to consume this path
-- they just need (a) a way to opt in, and (b) nic.getUuid() carried in
per-NIC script commands so the SDN-side port identifier can match.

Add the framework hooks to enable this without any KVM agent change:

* ExtensionHelper.VIF_BINDING_DETAIL_KEY ("vif.binding") -- new
  top-level extension detail.  Currently supported value: "lswitch".

* NetworkExtensionElement.prepare(...) -- when the extension owning the
  NIC's network declares vif.binding=lswitch in its extension_details,
  override nic.setBroadcastType(Networks.BroadcastDomainType.Lswitch).
  OvsVifDriver on the KVM agent then picks the existing Lswitch path
  unchanged.  Without the opt-in, the previous default (typically Vlan)
  is preserved -- existing reference extensions like network-namespace
  are unaffected.

* NetworkExtensionElement.getNicUuidArgs(network, nic) -- helper that
  returns ["--nic-uuid", "<uuid>"] only when vif.binding=lswitch is
  declared.  Wired into add-dhcp-entry, remove-dhcp-entry,
  add-dns-entry, save-vm-data, save-password, save-userdata,
  save-sshkey, and save-hypervisor-hostname.  Extensions that do not
  declare the hint never see --nic-uuid, so backwards-compatible.

* README -- new section "VIF Binding for OVS-backed Extensions"
  documenting the contract end-to-end: cmk createExtension snippet,
  what prepare() does, how --nic-uuid flows, why the extension never
  writes iface-id remotely on the boot path.  Also notes the new
  argument in the add-dhcp-entry table.

Result: an OVN extension (or any future OVS-backed extension) gets
correct VIF binding by adding a single detail key at extension creation
time.  No host-side agent patch, no libvirt patch, no OVS schema
change.
2026-05-12 10:16:27 +01:00
Wei Zhou 7f9d3e350f Update framework/extensions/src/main/java/org/apache/cloudstack/framework/extensions/network/README.md 2026-05-12 10:16:27 +01:00
Wei Zhou de2eced11b NE: check vpc CustomAction provider instead of first tier and cleanup UI 2026-05-12 10:16:27 +01:00
Wei Zhou 600a65226b NE: apply copilot's suggestions 2026-05-12 10:16:27 +01:00
Wei Zhou d409852b45 NE: more unit tests and UI optimization 2026-05-12 10:16:27 +01:00
Wei Zhou eb300ca1e7 network extension: add service CustomAction 2026-05-12 10:16:27 +01:00
Wei Zhou 5a3fdc0485 api/server: apply suggestions 2026-05-12 10:16:27 +01:00
Wei Zhou ffc5d8eee3 ExtensionsManagerImpl: minor changes 2026-05-12 10:16:27 +01:00
Wei Zhou 966be69605 add unit tests 2026-05-12 10:16:27 +01:00
Wei Zhou b3dea2673b gha: fix EOF and license 2026-05-12 10:16:27 +01:00
Wei Zhou b39eeac0d7 Network Extension: Orchestrate external Network devices 2026-05-12 10:16:27 +01:00
Suresh Kumar Anaparti a4a52c9665
Merge branch '4.22' 2026-05-08 20:57:36 +05:30
Daan Hoogland 3e688b0197 Merge tag '4.22.0.1' into 4.22 2026-05-06 11:13:45 +02:00
Henrique Sato c07f1fd5d2
Number of running and stopped VMs as preset variables for `Network` type Quota tariffs (#11689)
Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>
2026-05-01 11:54:40 +02:00
Abhishek Kumar 2eef7aa9a2 adding default deny keys also when there are no other keys 2026-04-30 13:52:39 +02:00
julien-vaz a73cc9a22c
Improve Quota Statement (#10506)
* Improve Quota Statement

* Removes unused import

* Fix QuotaUsageJoinDao, QuotaResponseBuilderImpl, QuotaServiceImpl e QuotaServiceImplTest

* Reorganize imports

* Updates QuotaStatementCmd responseBuilder scope to default

* Fix log4j syntax

* Address reviews + other improvements

* Add missing SQL scripts and injections

* Change accountid and domainid logic + add unit tests

* Rename QuotaUsageDetail to QuotaTariffUsage

* Fix out of bounds exception

---------

Co-authored-by: Julien Hervot de Mattos Vaz <julien.vaz@scclouds.com.br>
Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>
2026-04-29 21:09:13 -03:00
Henrique Sato 6f4445c5c1
Add offering preset variables for `Network` and `VPC` Quota tariffs (#11810)
* Add offering preset variable to Network and VPC tariffs

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>

* Add tests

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>
2026-04-27 09:36:37 -03:00
Daan Hoogland 82bfa9fb3f Merge branch '4.22' 2026-04-14 14:50:44 +02:00
Daan Hoogland 1085da4ef8 Merge commit '19b4ef106931aa1d6a8fed06984009d86760e4de' into 4.22 2026-04-14 13:15:05 +02:00
Suresh Kumar Anaparti 47c5bb8ee7 Support list/query async jobs by resource (#12983)
* Add resource filtering to async job query commands

* Fix logical condition in AsyncJobDaoImpl and ResourceIdSupport

* resource type case-insensitive validation

* fix resource type and id search

---------

Co-authored-by: mprokopchuk <mprokopchuk@gmail.com>
Co-authored-by: mprokopchuk <mprokopchuk@apple.com>
2026-04-13 15:39:49 +02:00
Daan Hoogland d6f4fc3ac4 Updating pom.xml version numbers for release 22.0.1 2026-04-13 11:53:00 +02:00
julien-vaz 4f93ba888c
Refactor Quota Summary API (#10505)
* Refactor Quota Summary API

* Fixes imports

* Fix QuotaServiceImplTest

* Update plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaSummaryCmd.java

Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>

* Fix QuotaSummaryCmd

* Remove unnecessary imports

* Remove unused createQuotaSummaryResponse declarations

* Remove unnecessary imports

* Update plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaSummaryCmd.java

Co-authored-by: dahn <daan.hoogland@gmail.com>

* Fix QuotaSummaryCmd

* Fix QuotaResponseBuilderImplTest

* Refactor test

* Fix QuotaSummaryCmd

* Fix projectid behavior

* Simplify QuotaSummary and deprecate listall

* Fix createQuotaSummaryResponse

* Remove unused import

* Apply suggestions + some adjustments

* Remove duplicated check

* Fix checkstyle

* Adjust entity owner

* Remove unused method + fix tests

* Add missing @ACL to some parameters

* Adjust how the parameters behave

* Allow domain admins and users to use keyword

* Address reviews

---------

Co-authored-by: Julien Hervot de Mattos Vaz <julien.vaz@scclouds.com.br>
Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>
Co-authored-by: dahn <daan.hoogland@gmail.com>
2026-03-31 20:29:30 -03:00
John Bampton 5d61ba3538
[CI] Create `.codespellrc`; upgrade codespell hook; fix typos (#12824) 2026-03-31 15:04:05 +02:00
Suresh Kumar Anaparti 75620309c2
Merge branch '4.22' 2026-03-04 21:13:01 +05:30
Suresh Kumar Anaparti 9e386a3128
PowerFlex/ScaleIO client initialization, authentication and command execution improvements (#12391)
* PowerFlex/ScaleIO client initialization, authentication and command execution improvements

* Migrate VM with volume not supported yet for PowerFlex/ScaleIO

* review changes
2026-02-26 09:23:41 -03:00
Abhishek Kumar 95816b44e9 extensions: allow reserved resource details
Adds a new request parameter for create/updateExtension API to allow
operator to provide detail names for the extension resources which will be reserved to be used by the extension. The end user won't be able to view or add details with these details names for the resource.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2026-02-22 18:08:03 +01:00
Daan Hoogland a7dc5efad5 Merge release branch 4.22 to main
* 4.22:
  Fix issue when restoring backup after migration of volume (#12549)
  Usage: Heartbeat should not schedule usage job when a job is already running (#12616)
  Allow limit queries without random ordering (#12598)
  engine/schema: fix cluster/zone settings with encrypted values (#12626)
  Fix injection of preset variables into the JS interpreter (#12515)
  Fix issue with multiple KVM Host entries in host table (#12589)
  Add a Prometheus metric to track host certificate expiry (#12613)
  ssvm: delete temp directory while deleting entity download url (#12562)
2026-02-17 11:55:04 +01:00
Daan Hoogland 11df71e55c Merge branch '4.20' into '4.22' 2026-02-17 11:53:08 +01:00
Suresh Kumar Anaparti e22f842ed8
Allow limit queries without random ordering (#12598) 2026-02-13 09:30:55 +01:00
Fabricio Duarte 34f6f413a1
Fix injection of preset variables into the JS interpreter (#12515) 2026-02-11 16:12:09 +01:00
Daan Hoogland d3e1976912 Merge release branch 4.22 to main
* 4.22:
  Fixes issue with loading Capacity dashboard when mulitple backup providers configured (#12550)
2026-02-09 13:06:28 +01:00
Daan Hoogland 7324ef45d4 Merge branch '4.20' into 4.22 2026-02-09 13:05:08 +01:00
Pearl Dsilva a0f35a186d
Fixes issue with loading Capacity dashboard when mulitple backup providers configured (#12550) 2026-02-09 12:12:28 +01:00
Erik Böck e32d08e50e
Create new generic method for resource UUID obtention in event's descriptions (#12502) 2026-02-05 11:23:40 +01:00
Vishesh a7178ee687
Fix mvn warnings (#10909)
* Replace maven-jgit-buildnumber-plugin with thread safe buildnumber-maven-plugin

* Fix mysql-connector-java warning

* Fix thread safe warning for properties-maven-plugin

* Fix mvn build - marvin warnings

* Update tools/marvin/README.md

* Update tools/marvin/README.md

Co-authored-by: dahn <daan.hoogland@gmail.com>

---------

Co-authored-by: dahn <daan.hoogland@gmail.com>
2026-01-30 14:01:57 +05:30
Suresh Kumar Anaparti a55f85af50
Merge branch '4.22' 2026-01-29 15:55:03 +05:30
Suresh Kumar Anaparti d700e2db64
Merge branch '4.20' into 4.22 2026-01-29 15:51:58 +05:30
Fabricio Duarte b7fc7179fc
Add batch deletion support to `removeRawUsageRecords` (#12522)
* Add batch deletion support to `removeRawUsageRecords`

* Remove ORDER BY from batch expunge
2026-01-29 08:14:05 +02:00
Daan Hoogland e3999923a7 Merge release branch 4.22 to main
* 4.22:
  fix install path for systemvm templates when introducing new sec storage (#11605)
  fix Sensitive Data Exposure Through Exception Logging in OVM Hypervis… (#12032)
  Fix snapshot physical size after migration (#12166)
  ConfigDrive: use file absolute path instead of canonical path to create ISO (#11623)
  Add log for null templateVO (#12406)
  snapshot: fix listSnapshots for volume which got delete and whose storage pool got deleted (#12433)
  Notify user if template upgrade is not required (#12483)
  Fix: proper permissions for systemvm template registrations on hardened systems (#12098)
  Allow modification of user vm details if user.vm.readonly.details is empty (#10456)
  NPE fix while deleting storage pool when pool has detached volumes (#12451)
2026-01-26 13:32:56 +01:00
Daan Hoogland edb62b490c Merge branch '4.20' into 4.22 2026-01-26 13:30:26 +01:00
Pearl Dsilva 4adb719570
Allow modification of user vm details if user.vm.readonly.details is empty (#10456) 2026-01-26 11:18:12 +02:00
Suresh Kumar Anaparti 4bcf3ea57d
Merge branch '4.22' 2026-01-26 12:46:54 +05:30
Suresh Kumar Anaparti 000919d6e5
Merge branch '4.20' into 4.22 2026-01-26 12:46:09 +05:30
Harikrishna 6e5d78a8a7
Fix NPE on adding new columns in the tables (#12464)
* Fix NPE on adding new columns in the tables

* Remove assert
2026-01-22 12:46:16 +05:30
Abhisar Sinha 002d9768b2
Add settings to mark cryptographic algorithms in vpn customer gateways as excluded or obsolete (#12193)
This PR introduces several configuration settings using which an operator can mark certain cryptographic algorithms and parameters as excluded or obsolete for VPN Customer Gateway creation for Site-to-Site VPN.

Cloud providers following modern security frameworks (e.g., ISO 27001/27017) are required to enforce and communicate approved cryptographic standards. CloudStack currently accepts several weak or deprecated algorithms without guidance to users. This PR closes that gap by giving operators explicit control over what is disallowed vs discouraged, improving security posture without breaking existing deployments.

These settings are:

1. vpn.customer.gateway.excluded.encryption.algorithms
2. vpn.customer.gateway.excluded.hashing.algorithms
3. vpn.customer.gateway.excluded.ike.versions
4. vpn.customer.gateway.excluded.dh.group
5. vpn.customer.gateway.obsolete.encryption.algorithms
6. vpn.customer.gateway.obsolete.hashing.algorithms
7. vpn.customer.gateway.obsolete.ike.versions
8. vpn.customer.gateway.obsolete.dh.group
2026-01-19 13:18:37 +05:30
Daan Hoogland 22da57f922 Merge branch '4.22' 2025-12-22 14:13:50 +01:00
Daan Hoogland 55ab7c5589 Merge branch '4.20' into 4.22 2025-12-22 13:23:37 +01:00