3314 Commits

Author SHA1 Message Date
Abhishek Kumar
d0fc91ab2a build fix
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-10-09 17:29:18 +05:30
Abhishek Kumar
5f86dad4cb improve cluster overcommit value cache
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-10-09 16:28:24 +05:30
Abhishek Kumar
1589cde4e4 check for empty ids
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-10-09 16:27:39 +05:30
Abhishek Kumar
a3ea8603a9 during resource calculation directly return ids for service offering,
templates

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-10-08 14:28:26 +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
c6cc136ce6 changes in pools for agent executors
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-10-08 14:24:09 +05:30
Abhishek Kumar
c859f8ba80 changes in vm powerstate sync
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-10-07 16:25:14 +05:30
Abhishek Kumar
a9661f4587 changes in statscollection
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-10-07 16:23:15 +05:30
Abhishek Kumar
a5d02665b4 changes for host reqrieval from db
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-10-07 16:21:06 +05:30
Abhishek Kumar
adae7c88b8 changes
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-27 13:00:38 +05:30
Abhishek Kumar
fa50740514 wip
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-26 12:10:38 +05:30
Abhishek Kumar
1652086ff9 wip changes for agent reconnection
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-25 18:33:55 +05:30
Abhishek Kumar
0151f125aa improvement
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-23 20:04:34 +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
Abhishek Kumar
35ed30bd51 continuation of 1d47e4d4ae177e4a9f41c12b6d72c0ca011a3f1a
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
33321f00ce template list fix
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-16 14:28:51 +05:30
Abhishek Kumar
97ddd17f94 fix related to 38d6c4e7e7d7535e08f1e45dad0f4e5fd1eb2239
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-13 17:40:20 +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
fe4ef05053 server,engine-schema: use single query to to list host capacities while
host capacity update

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-13 16:17:47 +05:30
Abhishek Kumar
98b27a409d engine-schema: fix get host type count searchcriteria
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-13 15:06:33 +05:30
Abhishek Kumar
38d6c4e7e7 optimize finding ready systemvm template for zone
Retrieving templates with inner join on host table was turning out to be
more expensive than finding distinct hypervisor types for a zone using
hsot table and then finding templates for those types

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-13 12:10:47 +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
Abhishek Kumar
9e5c99ef9e fix tests from a78a2508e955fa8c08b62e56c3440ca58bad3e77
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-12 16:58:18 +05:30
Abhishek Kumar
a78a2508e9 server: refactor MS list retrieval for agent connect
During agent join and while changing configs - host and indirect.agent.lb.algorithm, optimize calling DB for zone's host list

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-12 16:00:17 +05:30
Abhishek Kumar
68bab20d24 VMInstanceDao.updatePowerState refactor
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-12 15:47:00 +05:30
Abhishek Kumar
d5a774c736 import fix
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-11 11:44:48 +05:30
Abhishek Kumar
de60fb64e8 fix
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-10 15:35:14 +05:30
Abhishek Kumar
9074c4b6ad address process vm power state report for transitioning VMs
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-10 15:22:16 +05:30
Abhishek Kumar
3e098b87a9 fix
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-10 15:22:02 +05:30
Abhishek Kumar
df137fc387 refactor
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-10 10:22:59 +05:30
Abhishek Kumar
61764aba1f cache and executors refactoring
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-09 19:39:50 +05:30
Abhishek Kumar
8f6c657159 optimize scanStalledVms procedure
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-06 14:27:56 +05:30
mprokopchuk
cf8dd76d4c renamed created_exists to created_column_not_exists in sql migration script 2024-09-06 01:25:04 -07:00
Abhishek Kumar
8ee5e6a99a refactor transitioning vm process report
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-04 18:35:23 +05:30
Abhishek Kumar
1be848da25 server: PingRoutingCommand - enable scanStalledVm
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-03 16:03:11 +05:30
Abhishek Kumar
337add8fb9 server: PingRoutingCommand - apply some optimizations
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-03 16:01:46 +05:30
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
1ec11a1482 removed insert of powerflex.connect.on.demand as it taken care by commit 0d553332 already 2024-08-30 11:24:04 -07:00
Abhishek Kumar
3f80cd3c66 optimize db list.size() cases
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-08-27 13:06:25 +05:30
mprokopchuk
e1c7492768 - added resource_reservation.mgmt_server_id
- added resource_reservation.created
to migration script
2024-08-22 14:12:49 -07:00
mprokopchuk
8136db637a Added configuration key powerflex.connect.on.demand to DB and resource_reservation DDL 2024-08-15 17:57:07 -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
Abhishek Kumar
5e98405b38 Merge remote-tracking branch 'apple/apple-base418' into scalability-improvements 2024-07-22 16:12:19 +05:30
Suresh Kumar Anaparti
5c682677fc
Support resource name / displaytext with unicode / emoji chars, and SQL exception msg improvements (#460)
* Don't send sql exception/query from dao to upper layer, log it and send only the error message

* Updated charset to utf8mb4, for display_name column/user_vm table and job_result column/async_job table to support unicode chars & emojis

* Added API arg validator for RFC compliance domain name, to validate VM's host name

* Updated user resources name / display name column's charset to utf8mb4

* Check and update char set for affinity group name to utf8mb4, from the data migration in upgrade path

* Updated backup offering name column charset to utf8mb4

* Added unit tests for vm host/domain name validation

* Added smoke test to check resource name for vm, volume, service & disk offering, template, iso, account(first/lastname)

* Updated resource annotation charset to utf8mb4

* Updated some resources description charset to utf8mb4
2024-07-19 09:35:18 +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
Vishesh
7ed43e3e43
Let network guru decide if ipv6 cidr size can't be equal to 64 (#462) 2024-06-27 12:20:49 +05:30
Vishesh
8be18e587f
FR75 Enforce strict host tag checking (#421)
* Enforce strict host tag checking

* Add e2e tests

* Add more information to error log

* Fix e2e test

* Update global settings descrption

* fixup

* Fix e2e test teardown
2024-06-25 14:38:59 +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