37741 Commits

Author SHA1 Message Date
Manoj Kumar
7632814cd2
Instance lease: Allow deployment of instances with lease duration and leaseexpiry action (#10560)
* FR-248: Instance lease, WIP commit

* insert lease expiry into db and use that to filter exiring vms, add asyncjobmanager

* Add leaseDuration and leaseExpiryAction in Service offering create flow

* Update listVM cmd to allow listing only leased instances

* Add methods to fetch instances for which lease is expiring in next days

* Changes included:
config key setup and configured for alert email
lease options in create and update vm screen
handle delete protection, edit vm, create vm
validated stop and detroy, delete protection

* Update UI screens for leased properties coming from config and service offering

* use global lock before running scheduler

* Unit tests

* Flow changes done in UI based on discussion

* Include view changes in schema upgrade files and use feature in various UI elements

* Added integration test for vm deployment, UI enhancements for user persona, bug fixes

* validate integration tests, minor ui changes and log messages

* fix build: moving configkey from setup to test itself

* Disable testAlert to unblock build and trim whitespaces in integration tests

* Address review comments

* Minor changes in EditVM screen

* Use ExecutorService instead of Timer and TimerTask

* Additional review comments

* Incorporate following changes:
1. Execute lease action once on the instance
2. Cancel lease on instance when feature is disabled
3. Relevant events when lease gets disabled, cancelled, executed
4. Disable associating lease after deployment
5. UI elements and flow changes
6. Changes based on feedback from demo

* Handle pr review comments

* address review comments

* move instance.lease.enabled config to VMLeaseManager interface

* bug fix in edit instance flow and reject api request for invalid values

* max allowed lease is for 100 years

* log instance ids for expired instance

* Fix config validation for value range and code coverage improvement

* fix lease expiry request failures in async

* dont use forced: true for StopVmCmd

* Update server/src/main/java/org/apache/cloudstack/vm/lease/VMLeaseManager.java

Co-authored-by: Vishesh <vishesh92@gmail.com>

* handle review comments

---------

Co-authored-by: Rohit Yadav <rohityadav89@gmail.com>
Co-authored-by: Vishesh <vishesh92@gmail.com>
2025-05-28 17:40:09 +05:30
Daan Hoogland
650b5ec3da Merge branch '4.20' 2025-05-27 18:18:39 +02:00
Pearl Dsilva
6bb6fe7b41 Merge branch '4.19' into 4.20 2025-05-27 20:10:58 +05:30
Nicolas Vazquez
d5fbd07b9f Adding privilege checks on user and account operations
Co-authored-by: Harikrishna <harikrishna.patnala@gmail.com>
2025-05-27 20:08:16 +05:30
Abhishek Kumar
19d6b979af cks: create separate service account in project
A separate service account will be created and added in the project, if
not exist already, when a Kubernetes cluster is deployed in a project.
This account will have a role with limited API access.

Cleanup clusters on owner account cleanup, delete service account
if needed

When the owner account of k8s clusters is deleted, while its node VMs
get expunged, the cluster entry in DB remain present. This fixes the
issue by cleaning up all clusters for the account deleted.

Project k8s service account will be deleted on account cleanup or when
there is no active k8s cluster remaining

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2025-05-27 20:08:12 +05:30
Suresh Kumar Anaparti
9cf9966dfe Keep same/consistent auth time for valid & invalid users 2025-05-27 20:06:56 +05:30
Fabricio Duarte
c3c6d34589 Add access validation to Quota email APIs 2025-05-27 20:03:55 +05:30
nvazquez
64d83ce9d1 Fix access to template/ISO list for domain/resource admins
In Apache CloudStack, while using the listTemplates and listIsos APIs, Domain Admins and Resource Admins can retrieve templates and ISOs outside their intended scope.

Co-authored-by: bernardodemarco <bernardomg2004@gmail.com>
Co-authored-by: nvazquez <nicovazquez90@gmail.com>
2025-05-27 20:03:13 +05:30
nvazquez
a0080a04fe Adding privilege checks on user and account operations
Co-authored-by: Harikrishna <harikrishna.patnala@gmail.com>
2025-05-27 16:24:29 +02:00
Abhishek Kumar
e2f187912c cks: create separate service account in project
A separate service account will be created and added in the project, if
not exist already, when a Kubernetes cluster is deployed in a project.
This account will have a role with limited API access.

Cleanup clusters on owner account cleanup, delete service account
if needed

When the owner account of k8s clusters is deleted, while its node VMs
get expunged, the cluster entry in DB remain present. This fixes the
issue by cleaning up all clusters for the account deleted.

Project k8s service account will be deleted on account cleanup or when
there is no active k8s cluster remaining

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2025-05-27 16:24:29 +02:00
Suresh Kumar Anaparti
ad9d9cd3f6 Keep same/consistent auth time for valid & invalid users 2025-05-27 16:24:29 +02:00
nvazquez
38f3107211 Fix aaccess to template/ISO list for domain/resource admins
In Apache CloudStack, while using the listTemplates and listIsos APIs, Domain Admins and Resource Admins can retrieve templates and ISOs outside their intended scope.

Co-authored-by: bernardodemarco <bernardomg2004@gmail.com>
Co-authored-by: nvazquez <nicovazquez90@gmail.com>
2025-05-27 16:24:29 +02:00
Pearl Dsilva
16fc2cd1f0 Merge branch '4.19' of https://github.com/apache/cloudstack into 4.20 2025-05-27 19:27:33 +05:30
Wei Zhou
857ccb0a3b
server: fix list diskoffering by domainid returns Inactive offerings (#10916) 2025-05-27 10:56:35 +02:00
Wei Zhou
7e565d2524
Routed: support vxlan networks (#10861) 2025-05-27 10:43:37 +02:00
Pearl Dsilva
b760b0262f
Fix issue with configdrive on XenServer (#10912) 2025-05-27 10:14:04 +02:00
dahn
bb79f0b727
engine/schema: create default network offering for vpc tier with conserve_mode=1 for fresh installation (#10744) (#10843)
Co-authored-by: Wei Zhou <weizhou@apache.org>
2025-05-27 08:17:49 +02:00
Harikrishna
99863c2fa5
Imporve socketChannel closing in NioConnection (#10895) 2025-05-23 13:13:04 +05:30
Wei Zhou
f2a6a2ff13
.github: fix sonar checks (#10894)
* .github: fix sonar check

* .github: fix main sonar check

* add more pom.xml files
2025-05-22 12:07:00 +02:00
Pearl Dsilva
f496ed6eaf Merge branch '4.20' of https://github.com/apache/cloudstack 2025-05-22 12:05:47 +05:30
Rohit Yadav
f99fb3ecde Merge remote-tracking branch 'origin/4.19' into 4.20 2025-05-22 11:46:59 +05:30
Suresh Kumar Anaparti
6e19c07da1
Fixed typos (#10882) 2025-05-22 11:41:04 +05:30
Wei Zhou
4748c3fd4d
test: cleanup acl in test_global_acls.py (#10893) 2025-05-22 11:40:08 +05:30
Wei Zhou
d0dc6d8093
mgmt: add back serviceip in ManagementServerResponse (#10891)
* mgmt: add back serviceip in ManagementServerResponse

* api: add Deprecated annotation to serviceip
2025-05-21 09:55:52 +05:30
Fabricio Duarte
34896a1ada
Address assignVm regression (#10875)
* Address assignVm regression
2025-05-21 09:21:41 +05:30
Wei Zhou
97c96a55ba
.github: fix sonar checks (#10894)
* .github: fix sonar check

* .github: fix main sonar check

* add more pom.xml files
2025-05-20 15:26:54 +02:00
Wei Zhou
96b8e23767
kvm: fix vm deployment from RAW template (#10880)
* kvm: fix vm deployment from RAW template

* Update plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java

Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com>

---------

Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com>
2025-05-19 21:44:01 +02:00
Wei Zhou
842b2f8c24
Merge remote-tracking branch 'apache/4.20' 2025-05-19 21:25:37 +02:00
Wei Zhou
5444261902
test: fix several simulator CI failures (#10890)
* test: fix several simulator CI failures

* Inject dataStoreProviderManager
2025-05-19 18:33:14 +02:00
Wei Zhou
538e35f8ad
test: fix test_restore_vm failure on vmware (#10885)
* test: fix test_restore_vm failure on vmware

* Fix URL for cloud-init vms on vmware/xen
2025-05-19 12:24:18 +02:00
Wei Zhou
badf3e18da
test: Update test ubuntu template for VMware to deployasis=False (#10881) 2025-05-19 08:57:02 +02:00
Harikrishna
b17808bfba
Introducing Storage Access Groups for better management for host and storage connections (#10381)
* Introducing Storage Access Groups to define the host and storage pool connections

In CloudStack, when a primary storage is added at the Zone or Cluster scope, it is by default connected to all hosts within that scope. This default behavior can be refined using storage access groups, which allow operators to control and limit which hosts can access specific storage pools.

Storage access groups can be assigned to hosts, clusters, pods, zones, and primary storage pools. When a storage access group is set on a cluster/pod/zone, all hosts within that scope inherit the group. Connectivity between a host and a storage pool is then governed by whether they share the same storage access group.

A storage pool with a storage access group will connect only to hosts that have the same storage access group. A storage pool without a storage access group will connect to all hosts, including those with or without a storage access group.
2025-05-19 11:33:29 +05:30
Suresh Kumar Anaparti
90316b2e90
VMware 80u2 and 80u3 updates/fixes (#10586)
* VMware - Ignore disk not found error on cleanup when the VM disk doesn't exists

* VMware - Retry powerOn on lock issues

* addressed comments

* Update CPVM reboot tests - wait for the agent to Disconnect and back Up

* Retry moveDatastoreFile when any file access issue while creating volume from snapshot

* Update full clone flag when restoring vm using root disk offering with more size than the template size

* refactored (mainly,for diskInfo - causing NPE in some cases)

* Retry moveDatastoreFile when there is any file access issue
2025-05-17 00:39:34 +05:30
Daan Hoogland
8f8c685d17 Merge branch '4.19' into 4.20 2025-05-16 15:51:37 +02:00
Manoj Kumar
d5ba23c848
Introduce volume allocation algorithm global configuration (#10696) 2025-05-16 14:06:42 +02:00
Rene Peinthor
4259e0b51b
linstor: fix host connect recursion regression (#10878) 2025-05-16 12:37:37 +02:00
Pearl Dsilva
39a0ba9670
Fix issue with security group selection box display (#10849)
Co-authored-by: toolmanwyj <wyjtoolmancc@gmail.com>
2025-05-16 12:35:04 +02:00
Abhishek Kumar
951863c3fe
ui: add an infinite scroll select component (#10840)
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2025-05-16 12:27:19 +02:00
Suresh Kumar Anaparti
112dfddd40
Reset the pool id when create volume fails on the allocated pool, and update the resize error when no endpoint exists (#10777)
* Reset the pool id when create volume fails on the allocated pool

- the pool id is persisted while creating the volume, when it fails the pool id is not reverted. On next create volume attempt, CloudStack couldn't find any suitable primary storage even there are pools available with enough capacity as the pool is already assigned to volume which is in Allocated state (and storage pool compatibility check fails). Ensure volume is not assigned to any pool if create volume fails (so the next creation job would pick the suitable pool).

* endpoint check for resize

* update the resize error through callback result instead of exception
2025-05-16 10:26:28 +02:00
slavkap
c183fc9859
Prevent data corruption for StorPool volumes (#10799) 2025-05-16 10:02:33 +02:00
Suresh Kumar Anaparti
13ab8a04d1
Fix for Vlan doesn't match issue while adding IP range for the shared network without any IP range (#10837) 2025-05-16 09:24:55 +02:00
Vitor Hugo Homem Marzarotto
1507a5633e
Correct typo in exception (#10876)
Co-authored-by: Vitor Hugo Homem Marzarotto <vitor.marzarotto@scclouds.com.br>
2025-05-16 12:53:04 +05:30
Suresh Kumar Anaparti
f199783c75
VMware import - logs sanitation (#10433) 2025-05-16 09:21:19 +02:00
Abhishek Kumar
005afde24e
ssvm: reset fields on destroy (#10253)
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2025-05-15 12:10:38 +02:00
Erik Böck
7bab40db6f
disabled create and add volume button for VMs in Error state (#10859)
Co-authored-by: erik.silva.scclouds <erik.silva@scclouds.com.br>
2025-05-15 09:36:42 +02:00
Suresh Kumar Anaparti
572fc11a64
[PowerFlex] Add & Remove PowerFlex/ScaleIO MDMs for the storage SDC connections (#9903)
* Add & Remove PowerFlex/ScaleIO MDMs while preparing & unpreparing the storage SDC connections (instead of start & stop scini)

* Add/Remove MDM IP addresses during Host connection/disconnection to/from storage pool when powerflex.connect.on.demand is false

* unit test fixes

* Don't remove MDM IPs from SDC when any volumes mapped to SDC

* Don't remove MDM IPs when other pools of same ScaleIO/PowerFlex cluster are connected

* rebase fixes

* update changes, to not remove/disconnect MDMs on maintenance

* import fixes after rebase
2025-05-15 12:42:13 +05:30
Abhisar Sinha
3df83da86c
Get backup offering details from listVirtualMachinesMetrics in UI (#10867) 2025-05-14 20:42:38 +05:30
Abhisar Sinha
d55aa70f7e
Restore single backed-up volume on a live instance attaches the volume as a Raw image making it unreadable (#10844) 2025-05-14 15:23:07 +02:00
Suresh Kumar Anaparti
a4cce70e28
List usage records for network offering (usage type 13) when offering id is specified in usage id (#10852) 2025-05-14 10:25:11 +02:00
Nicolas Vazquez
8d3ae3e057
[Vmware] Improve listing of Vmware Datacenter VMs for migration to KVM (#10770)
Co-authored-by: dahn <daan.hoogland@gmail.com>
Co-authored-by: Suresh Kumar Anaparti <sureshkumar.anaparti@gmail.com>
2025-05-14 08:12:27 +02:00