Commit Graph

4353 Commits

Author SHA1 Message Date
Abhishek Kumar 0fbdbca10f test fix
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-10-23 18:53:59 +05:30
Abhishek Kumar 1aaf2ae6cd scaleio fix
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-10-23 18:29:41 +05:30
Abhishek Kumar 3dccebce77 make dynamicapichecker cache confgurable, fix test
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-10-23 13:02:33 +05:30
Abhishek Kumar aae3a0a0b8 refactor to retrieve host count and cpu sockets in single query
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-10-20 19:58:43 +05:30
Abhishek Kumar c885464c71 storage pool host connection improvements
- Enabels using worker threads for parallel connection of hosts to a
  storage pool
- HostDaoImpl refactorings

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-10-20 19:11:02 +05:30
Abhishek Kumar a069e14cf9 directly return count for systemvms used in listInfra
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-10-08 14:25:25 +05:30
Abhishek Kumar d2075415ac remove logs from DynamicRoleBasedAPIAccessChecker
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-10-07 15:32:06 +05:30
Abhishek Kumar b4fb97c886 change in account role caching
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-10-04 16:50:09 +05:30
Abhishek Kumar 0ca8722c38 Merge remote-tracking branch 'apple/scalability-improvements' into scalability-improvements-fixes 2024-09-23 14:47:25 +05:30
Abhishek Kumar 1d0b90f984 Merge remote-tracking branch 'apple/apple-base418' into scalability-improvements 2024-09-23 14:45:21 +05:30
Suresh Kumar Anaparti a05a3f94b4
Updated powerflex connect on demand config description (#486) 2024-09-20 10:08:18 +05:30
Abhishek Kumar 0728e9ffdb Merge branch 'scalability-improvements' into scalability-improvements-fixes 2024-09-17 16:35:10 +05:30
Abhishek Kumar 0dd0934483 backport https://github.com/apache/cloudstack/pull/9518
Allows specifying connection pooling library. Default is HikariCP
2024-09-17 11:44:35 +05:30
Abhishek Kumar 35ed30bd51 continuation of 1d47e4d4ae
list host IDs instead of complete row where possible

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-16 18:03:06 +05:30
Abhishek Kumar 1d47e4d4ae engine-schema,server,plugins: list host IDs instead whole row where
applicable

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-13 16:19:43 +05:30
Abhishek Kumar a1ee64344d address host/cluster dao listall
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-12 17:23:44 +05:30
mprokopchuk 75f39cddc9
Merge pull request #473 from shapeblue/powerflex_on_demand_disable_config_key
PowerFlex on demand disable config key
2024-09-06 09:59:40 -07:00
Abhishek Kumar e798ab30b3 cache api permission in DynamicRoleBasedAPIAccessChecker
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-06 14:28:30 +05:30
Suresh Kumar Anaparti a15fe4f1f4
Added logs for on-demand connect/disconnect config 2024-09-05 12:49:47 +05:30
Suresh Kumar Anaparti 9f072f2f1c
Revert "Changed ConnectOnDemand order"
This reverts commit 05db34bf44.
2024-09-05 12:42:05 +05:30
mprokopchuk 05db34bf44 Changed ConnectOnDemand order 2024-09-04 20:27:57 -07:00
mprokopchuk 07218b8c3d Moved ConnectOnDemand logic to ScaleIO SDC Manager and made ConnectOnDemand of Zone-aware 2024-09-03 14:46:55 -07:00
Abhishek Kumar 4400e02a1b
framework/config,server: configkey caching (#472)
Added caching for ConfigKey value retrievals based on the Caffeine
in-memory caching library.
https://github.com/ben-manes/caffeine
Currently, expire time for a cache is 1 minute and each update of the
config key invalidates the cache.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-03 15:53:08 +05:30
mprokopchuk 0d553332d9 Implemented Configurable methods in ScaleIOPrimaryDataStoreDriver. 2024-08-28 17:35:16 -07:00
mprokopchuk e0d6066935 Bumped pom version to 4.18.1.2 (to add migration SQL script) 2024-08-15 17:55:00 -07:00
mprokopchuk 422f3ba7fe Introduced configuration key "powerflex.connect.on.demand" to enable/disable PowerFlex on-demand connection from Host to Storage Pool feature. 2024-08-14 17:32:56 -07:00
mprokopchuk 8890e71052 Provide encryption key for DATA volume type (in addition to ROOT) to copy volume. 2024-08-13 12:09:41 -07:00
Abhishek Kumar 5e98405b38 Merge remote-tracking branch 'apple/apple-base418' into scalability-improvements 2024-07-22 16:12:19 +05:30
Suresh Kumar Anaparti d1faa59677
Back port fixes from upstream 4.19 (#466)
* Fixed src datastore on copy check for PowerFlex/ScaleIO storage driver (#9310)

* Ignore non-managed pools for storage pool access preparation (#9376)
2024-07-19 09:38:11 +05:30
Rohit Yadav a142359784
saml: make default signature check mandatory
Backport https://github.com/apache/cloudstack/pull/9357
2024-07-12 09:40:59 +05:30
Rohit Yadav b46e4d4bbf
framework/cluster: improve cluster service and integration API service (#465)
- mTLS implementation for cluster service communication
- Listen only on the specified cluster node IP address instead of all interfaces
- Validate incoming cluster service requests are from peer management servers based on the server's certificate dns name which can be through global config - ca.framework.cert.management.custom.san
- Hardening of KVM command wrapper script execution
- Improve API server integration port check
- cloudstack-management.default: don't have JMX configuration if not needed. JMX is used for instrumentation; users who need to use it should enable it explicitly

Co-authored-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Co-authored-by: Wei Zhou <weizhou@apache.org>
Co-authored-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
(cherry picked from commit 4f5561937c)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2024-07-09 09:03:40 +05:30
Marcus Sorensen 23a0faf729
Apply upstream SAML sig check from #9219 (#463)
Co-authored-by: Marcus Sorensen <mls@apple.com>
2024-07-01 09:33:40 +05:30
Suresh Kumar Anaparti be87b1a668
FR74: Mitigation for non-scalable ScaleIO clients (#447)
* Mitigation for non-scalable Powerflex/ScaleIO clients
- Added ScaleIOSDCManager to manage SDC connections, checks clients limit, prepare and unprepare SDC on the hosts.
- Added commands for prepare and unprepare storage clients to prepare/start and stop SDC service respectively on the hosts.
- Introduced config 'storage.pool.connected.clients.limit' at storage level for client limits, currently support for Powerflex only.

* tests issue fixed

* refactor / improvements

* lock with powerflex systemid while checking connections limit

* updated powerflex systemid lock to hold till sdc preparation

* Added custom stats support for storage pool, through listStoragePools API

* code improvements, and unit tests

* Update config 'storage.pool.connected.clients.limit' to dynamic, and some improvements

* Stop SDC on host after migration if no volumes mapped to host

* Wait for SDC to connect after scini service start, and some log improvements

* Do not throw exception (log it) when SDC is not connected while revoking access for the powerflex volume

* some log improvements
2024-06-27 18:47:50 +05:30
Vishesh c2de75744e
kvm: Add support for cgroupv2 (#8252) (#459)
* kvm: Add support for cgroupv2 (#8252)

1. Problem description

In Apache CloudStack (ACS), when a VM is deployed in a host with the KVM hypervisor, an XML file is created in the assigned host, which has a property shares that defines the weight of the VM to access the host CPU. The value of this property has no unit, and it is a relative measure to calculate how much CPU a given VM will have in the host. However, this value has a limit, which depends on the version of cgroup utilized by the host's kernel. The problem lies at the range value of shares that varies between both versions: [2, 264144] for cgroups version 1; and [1, 10000] for cgroups version 2. Currently, ACS calculates the value of shares using Equation 1, presented below, where CPU is the number of cores and speed is the CPU frequency; both specified in the VM's compute offering. Therefore, if a compute offering has, for example, 6 cores at 2 GHz, the shares value will be 12000 and an exception will be thrown by libvirt if the host utilizes cgroup v2. The second version is becoming the default one in current Linux distributions; thus, it is necessary to address this limitation.

    Equation 1
    shares = CPU * speed

Fixes: #6744
2. Proposed changes

To address the problem described, we propose to apply a scale conversion considering the max shares of the host. Using the same formula currently utilized by ACS, it is possible to calculate the maximum shares of a VM for a given host. In other words, using the number of cores and the nominal speed of the host's CPU as the upper limit of shares allowed to a VM. Then, this value will be scaled to the allowed interval of [1, 10000] of cgroup v2 by using a linear scale conversion.

The VM shares would be calculated as Equation 2, presented below, where VM requested shares is the requested shares value calculated using Equation 1, cgroup upper limit is fixed with a value of 10000 (cgroups v2 upper limit), and host max shares is the maximum shares value of the host, calculated using Equation 1. Using Equation 2, the only case where a VM passes the cgroup v2 limit is when the user requests more resources than the host has, which is not possible with the current implementation of ACS.

    Equation 2
    shares = (VM requested shares * cgroup upper limit)/host max shares

To implement the proposal, the following APIs will be updated: deployVirtualMachine, migrateVirtualMachine and scaleVirtualMachine. When a VM is being deployed, a new verification will be added to find a suitable host. The max shares of each host will be calculated, and the VM calculated shares will be verified if it does not surpass the host's value. Likewise, the migration of VMs will have a similar new verification. Lastly, the scale of VMs will also have the same verification for the VM's host.

To determine the max shares of a given host, we will use the same equation currently used in ACS for calculating the shares of VMs, presented in Section 1. When Equation 1 is used to determine the maximum shares of a host, CPU is the number of cores of the host, and speed is the nominal CPU speed, i.e., considering the CPU's base frequency.

It is important to note that these changes are only for hosts with the KVM hypervisor using cgroup v2 for now.

* Update overcommit ratio during live VM migration

* minor refactoring

---------

Co-authored-by: Bryan Lima <42067040+BryanMLima@users.noreply.github.com>
2024-06-27 12:22:17 +05:30
Abhishek Kumar 8f88103a29
FR72 - api,server: purge expunged resources (#405)
This PR introduces the functionality of purging removed DB entries for CloudStack entities (currently only for VirtualMachine).
There would be three mechanisms for purging removed resources:
- Background task - CloudStack will run a background task which runs at a defined interval. Other parameters for this task can be controlled with new global settings.
- API - New API `purgeExpungedResources`. It will allow passing the following parameters - resourcetype, batchsize, startdate, enddate
- Config for service offering. Service offerings can be created with purgeresources parameter which would allow purging resources immediately on expunge.

Following new global settings have been added:
- `expunged.resources.purge.enabled`: Default: false. Whether to run a background task to purge the DB records of the expunged resources.
- `expunged.resources.purge.resources`: Default: (empty). A comma-separated list of resource types that will be considered by the background task to purge the DB records of the expunged resources. Currently only VirtualMachine is supported. An empty value will result in considering all resource types for purging.
- `expunged.resources.purge.interval`: Default: 86400. Interval (in seconds) for the background task to purge the DB records of the expunged resources.
- `expunged.resources.purge.delay`: Default: 300. Initial delay (in seconds) to start the background task to purge the DB records of the expunged resources task.
- `expunged.resources.purge.batch.size`: Default: 50. Batch size to be used during purging of the DB records of the expunged resources.
- `expunged.resources.purge.start.time`: Default: (empty). Start time to be used by the background task to purge the DB records of the expunged resources. Use format `yyyy-MM-dd` or `yyyy-MM-dd HH:mm:ss`.
- `expunged.resources.purge.keep.past.days`: Default: 30. The number of days in the past from the execution time of the background task to purge the DB records of the expunged resources for which the expunged resources must not be purged. To enable purging DB records of the expunged resource till the execution of the background task, set the value to zero.
- `expunged.resource.purge.job.delay`: Default: 180. Delay (in seconds) to execute the purging of the DB records of an expunged resource initiated by the configuration in the offering. Minimum value should be 180 seconds and if a lower value is set then the minimum value will be used.

Upstream PRs:
https://github.com/apache/cloudstack/pull/8999
https://github.com/apache/cloudstack-documentation/pull/397

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
2024-06-19 12:59:50 +05:30
Suresh Kumar Anaparti bda0543dd0
ScaleIO volume live migration - use usable bytes from source disk to format the destination disk (#452)
* ScaleIO volume live migration - use usable bytes from source disk to format the destination disk

* Don't abort block copy job when cur,end = 0

* code improvements
2024-06-10 14:12:06 +05:30
Wei Zhou e065c93c3f
Apple FR76: Implicit host tags (#427)
* Merge two HostTagVO and HostTagDaoImpl

* Apple FR76: dynamic host tags

* Revert "Apple FR76: dynamic host tags"

This reverts commit 01b93a873f167018c4fafd0744c0de07ae4de4ed.

* Apple FR76: Implicit host tags

* Apple FR76: address Abhishek's comments

* Apple FR76: move updateImplicitTags

* Apple FR76: add since to other two responses

* Update 8929: add unit test in LibvirtComputingResourceTest

* Update variable names

* Update FR76: add explicithosttags in response

* Update FR76 UI: Update explicit host tags

* Update 8929: remove host tags and change labels on UI

* Update: ui polish for host tags

* fix since in responses

* Update 8929: fix UI error if no host tags
2024-05-30 17:20:37 +05:30
Rohit Yadav b03d1382e6 fix unit tests failures
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2024-05-23 10:23:32 +05:30
Rohit Yadav c3867a941f more fixmes and todos
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2024-05-22 20:22:39 +05:30
Rohit Yadav 7a7f1e2b6e FIXME/TODO: CPU and DB hotspot found
Found these CPU and DB hotspot that handle agent ping commands, this
adds idle load when there are high number of hosts. By design, there
isn't any quick win here. However, the power sync report/handling could
be improved, so it doesn't need to kick-in for every ping command
received.

Few more areas marked in the codebase.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2024-05-22 20:22:39 +05:30
Rohit Yadav 90afcf2f85 metrics: optimise code and query to get summed cpu sockets
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2024-05-22 20:22:38 +05:30
Rohit Yadav 807cd6a830 metrics: speed up list zones and cluster metrics APIs
Also add a flag to disable on-the-fly metrics computation when the
list metrics APIs for zones and clusters are called.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2024-05-22 20:22:38 +05:30
Vishesh c3eba5e213
Fix exceeding of resource limits with powerflex (#443)
* Fix exceeding of resource limits with powerflex

* Fix for volume prepare during VM start

* resolve comments

* Add e2e tests

* Fixup

* Update e2e tests

* minor refactoring

* refactoring

* fixup

---------

Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
2024-05-08 20:54:54 +05:30
Vishesh 8d0915c4c9
Change iops on offering change (#416)
* Change IOPS on disk offering change

* Remove iops & bandwidth limits before copying template

* minor refactor

* Handle diskOfferingDetails

* Fixup
2024-04-11 16:59:57 +05:30
Marcus Sorensen 227dc5e86a
Add ability to set cpu.threadspercore similar to existing cpu.corespersocket (#411)
* Add ability to set cpu.threadspercore similar to existing cpu.corespersocket

* Add license to new test file

* Add tests to handle some edge cases

* Add some edge test cases to CPU topology

* Rework logic on KVM CPU topology, handle more cases

* Add more test cases

* Add more test cases

* Update plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java

Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>

* Added cpu.threadspercore detail in listDetailOptions response (for KVM hypervisor)

---------

Co-authored-by: Marcus Sorensen <mls@apple.com>
Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
2024-04-10 09:58:03 -06:00
Marcus Sorensen 631b0960f3
Allow kvm storage plugin to customize diskdef, add geometry (#402)
* Allow kvm storage plugin to customize diskdef, add geometry

* formatting update

---------

Co-authored-by: Marcus Sorensen <mls@apple.com>
Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
2024-04-08 09:28:59 -06:00
Marcus Sorensen f896586925
Update version to 4.18.1.1 (#417)
* Update version to 4.18.1.1

* Update changelog

* Update changelog

* Update changelog

---------

Co-authored-by: Marcus Sorensen <mls@apple.com>
2024-04-08 09:27:57 -06:00
Rohit Yadav 0c23820c7c
Merge pull request #414 from shapeblue/security-backport418
Backport upstream security fixes to apple-base418
2024-04-03 19:58:28 +05:30
Marcus Sorensen ac4b030759
Mark libvirt events experimental, add properties flag (#404)
Co-authored-by: Marcus Sorensen <mls@apple.com>
2024-04-03 08:03:26 -06:00
Vishesh 5137c196c2
HypervisorType as a class (#393)
* HypervisorType as a class

* Fixup

* fixup

* Add missing annotation

* Resolve comments

* Handle parallels typo
2024-04-02 17:35:16 +05:30