36461 Commits

Author SHA1 Message Date
Rohit Yadav
6d916cad34 Merge remote-tracking branch 'origin/4.18' 2023-12-21 13:18:51 +05:30
Rohit Yadav
969e094419
server: improve stats collector logs to state what the collector does (#8387)
This simply improves the log statement that prints debug statements
during beginning of a stats collector run for hosts or VMs.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-12-21 13:06:32 +05:30
Vishesh
1411da1a22
Add e2e tests for listing resources (#8281)
This PR adds e2e tests for listing resources
2023-12-20 11:54:39 +05:30
Abhishek Kumar
f5c7018e5e Merge remote-tracking branch 'apache/4.18' 2023-12-20 11:53:18 +05:30
Abhishek Kumar
64ecd00eb7
test: fix test_host_ping.py to restore original host state (#8380)
Failures seen in #7344 were debugged and it was seen since one of the
host is in Alert state. VM deployment fails with affinity group.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2023-12-20 11:52:08 +05:30
Vishesh
7c06d289d2
Fixup test_image_store_object_migration.py (#8378)
This PR fixes failure seem in #7344 (comment)
2023-12-20 11:17:41 +05:30
Abhishek Kumar
2253a33c1e Merge remote-tracking branch 'apache/4.18' 2023-12-20 08:58:30 +05:30
Wei Zhou
ab70108f15
CKS: create Security Groups for CKS clusters of each account (#8316)
This PR fixes #7684

The security groups contain the same rules for port 22 and 6443, no need to recreate for each CKS cluster.
2023-12-20 08:57:27 +05:30
Wei Zhou
33e2a4dd66
VPC: update default network offering for vpc tier to conserve_mode=1 (#8309)
This PR updates the conserve mode of default vpc tier offering to conserve_mode=1
so we can create both port forwarding and load balancing rules on a public IP in vpc tiers.

This fixes #8313
2023-12-18 12:08:51 +05:30
Fabricio Duarte
16d45f731d
Save the account which deliberately removed a public IP from quarantine (#8339)
When a public IP gets removed from quarantine, the removal reason gets saved to the database; however, it may also be useful for operators to know who removed the public IP from quarantine. For that reason, this PR extends the public IP quarantine feature so that the account that deliberately removed an IP from quarantine also gets saved to the database.
2023-12-18 12:06:31 +05:30
Rohit Yadav
af872224d6
README: that time of the year! 🎄 (#8365)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-12-16 11:48:20 +01:00
sato03
127fd9d2f0
UI: Project column in Default View (#8287)
The Default View has a projects toggle button that allows users to see which resources belong to projects, but there is nothing to indicate which project they belong to.

For this reason, a project column was added if the projects button is enabled, indicating the name of the project to which the resource belongs.

---------

Co-authored-by: Henrique Sato <henrique.sato@scclouds.com.br>
2023-12-15 17:42:24 +05:30
John Bampton
dda672503f
Remove unneeded duplicate words (#8358)
This PR removes some unneeded duplicate words.
2023-12-15 17:13:32 +05:30
Abhishek Kumar
de095ba70d
server: fix url check for storages without a valid url (#8353)
Fixes #8352
Some managed storages may not need a valid URL to be passed. We can skip check and extraction of host or path from url of such storages.
2023-12-15 16:25:28 +05:30
Wei Zhou
0bc7fb540a
client/pom.xml: fix code coverage is not updated in some modules (#8346)
This PR fixes that code coverage is not updated in some modules

The following modules should have better code coverage with this PR

    cloud-agent
    cloud-api
    cloud-core
    cloud-framework-cluster
    cloud-framework-config
    cloud-framework-db
    cloud-framework-events
    cloud-framework-jobs
    cloud-framework-managed-context
    cloud-framework-security
    cloud-usage
    cloud-utils
2023-12-14 13:18:16 +05:30
kishankavala
ab20b1220f
KVM Ingestion - Import Instance (#7976)
This PR adds new functionality to import KVM instances from an external host or from disk images in local or shared storage.
Doc PR: https://github.com/apache/cloudstack-documentation/pull/356
2023-12-14 13:08:56 +05:30
Abhishek Kumar
82f7abddb3 Merge remote-tracking branch 'apache/4.18' 2023-12-13 11:24:15 +05:30
Bryan Lima
3bb318bab9
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.
2023-12-13 10:51:24 +05:30
Nicolas Vazquez
27a3d61729
Fix unmanage VM marvin tests and small UI fixes for import (#8338)
This PR fixes the failing smoke test for test_vm_lifecycle_unmanage_import.py for Vmware and adds a small UI fix on the import wizard
2023-12-13 10:25:05 +05:30
Vishesh
a791d46abe
events,alerts: Add missing indexes (#8276)
This PR adds missing indexes on `alerts` & `events` tables.

For alerts table, some of the queries are part of a couple of APIs and some operations. I have added the index for the same. Ref: 
8f39087377/engine/schema/src/main/java/com/cloud/alert/dao/AlertDaoImpl.java (L40-L45)

For Events table, we query for `resource_id` & `resource_type` in the UI for a resource's events. Indexes were missing, so I have added those.
2023-12-13 10:24:36 +05:30
Abhishek Kumar
080a5aee00 Merge remote-tracking branch 'apache/4.18' 2023-12-12 17:01:52 +05:30
Harikrishna
3ce7c39bef
cks: handle errors while scaling cluster (#8107)
This PR fixes the issue #7920
2023-12-12 16:57:28 +05:30
Abhishek Kumar
05b0a8ae86 Merge remote-tracking branch 'apache/4.18' 2023-12-12 16:48:21 +05:30
Rohit Yadav
031b4c675c .asf.yaml: dummy commit to force asf.yaml effect
ASF Infra has enabled Github Discussions but discussion isn't published
on users@ ML yet. Pushing this dummy commit to see if makes any effect.
https://github.com/apache/cloudstack/pull/8274#issuecomment-1849641565

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-12-11 16:16:54 +05:30
Abhishek Kumar
ce586e3eca
server: fix resource count during assign volume (#8171)
ResourceType.volume stores the count of the volume and not the size so increment decrement should be just 1 when assigning a volume to a different account.
2023-12-11 15:45:42 +05:30
Rohit Yadav
05d0dd851f
.asf.yaml: Enable Github Discussions for CloudStack (#8274)
This enables Github Discussions feature for Apache CloudStack
repository. Several tech-savvy users are already using CloudStack issues
to report bugs, improvements and ideas, and finding using mailing list
old-school. The discussions feature presents a forum and can help
community have both users (including non-technical users) and developers
on the same platform. Further, the discussions feature is proposed to be
connected to the users@ mailing list so traditional users can benefit
from discussions happening on Github Discusssions forum.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-12-11 14:52:35 +05:30
João Jandre
12dcf5cc6f
Move subdomains between domains (#7446)
Sometimes users have the need to move resources between domains, for example, in a big company, a department may be moved from one part of the company to another, changing the company's department hierarchy, the easiest way of reflecting this change on the company's cloud environment would be to move subdomains between domains, but currently ACS offers no option to do that.
This PR adds the moveDomain API, which will move domains between subdomains. Furthermore, if the domain that is being moved has any subdomains, those will also be moved, maintaining the current subdomain tree.
2023-12-10 12:18:15 +05:30
Abhishek Kumar
4bdf35b7b0 Merge remote-tracking branch 'apache/4.18' 2023-12-09 12:04:21 +05:30
Abhishek Kumar
a11fc43788
server: fix diskoffering details in vm response (#8135)
Fixes #8120
2023-12-09 11:43:52 +05:30
dahn
ea569ffaad
expand tags in csv (#8258)
Fixes: #8256
2023-12-09 11:33:55 +05:30
Wei Zhou
fc44df7c95
CKS: create HA cluster with 3 control VMs instead 2 (#8297)
This PR fixes the test failures with CKS HA-cluster upgrade.
In production, the CKS HA cluster should have at least 3 control VMs as well.
The etcd cluster requires 3 members to achieve reliable HA. The etcd daemon in control VMs uses RAFT protocol to determine the roles of nodes. During upgrade of CKS with HA, the etcd become unreliable if there are only 2 control VMs.
2023-12-09 11:33:05 +05:30
Rene Glover
1031c31e6a
FiberChannel Multipath for KVM + Pure Flash Array and HPE-Primera Support (#7889)
This PR provides a new primary storage volume type called "FiberChannel" that allows access to volumes connected to hosts over fiber channel connections. It requires Multipath to provide path discovery and failover. Second, the PR adds an AdaptivePrimaryDatastoreProvider that abstracts how volumes are managed/orchestrated from the connector to communicate with the primary storage provider, using a ProviderAdapter interface, allowing the code interacting with the primary storage provider API's to be simpler and have no direct dependencies on Cloudstack code. Lastly, the PR provides an implementation of the ProviderAdapter classes for the HP Enterprise Primera line of storage solutions and the Pure Flash Array line of storage solutions.
2023-12-09 11:31:33 +05:30
Abhishek Kumar
231a9eae2e
ui: add action to declare/cancel host as degraded (#8327) 2023-12-08 17:08:35 +01:00
Fabricio Duarte
4e46f5ad17
Add logs to listLoadBalancerRuleInstances API (#8094) 2023-12-08 15:30:19 +01:00
Sina Kashipazha
2993c99363
Add missing hosts info to the prometheus exporter output. (#8328)
Sometimes the hostStats object of the agents becomes null in the management server. It is a rare situation, and we haven't found the root cause yet, but it occurs occasionally in our CloudStack deployments with many hosts.

The hostStat is null, even though the agent is UP and hosting multiple VMs. It is possible to access the VM consoles and execute tasks on them.

This pull request doesn't address the issue directly; rather it displays those hosts in Prometheus so we can restart the agent and get the necessary information.
2023-12-08 19:51:06 +05:30
Abhishek Kumar
c599011ef5 Merge remote-tracking branch 'apache/4.18' 2023-12-08 18:06:15 +05:30
Wei Zhou
f42feb1568
CKS: update imagePullPolicy to IfNotPresent in yaml files (#8296)
The kubernetes dashboard yaml file has the following setting

image: kubernetesui/dashboard:v2.7.0
imagePullPolicy: Always

see https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml The similar config can be found at https://raw.githubusercontent.com/weaveworks/weave/master/prog/weave-kube/weave-daemonset-k8s-1.11.yaml

Due to it, CKS does not work in the following cases

    reach the dockerhub rate limitations (see https://docs.docker.com/docker-hub/download-rate-limit/)
    The VMs do not have internet connection

Since the CKS ISO contains the image, it is not necessary to pull the images again.
2023-12-08 17:05:09 +05:30
Peinthor Rene
bba554bcc4
linstor: Fix possible NPE if Linstor storage-pool data missing (#8319)
If Linstor doesn't return storage pool info, certain values are null.
Now we assume the values are 0 if we get null values.
2023-12-08 17:02:18 +05:30
Harikrishna
7eb36367c9
Add lock mechanism considering template id, pool id, host id in PowerFlex Storage (#8233)
Observed a failure to start new virtual machine with PowerFlex storage. Traced it to concurrent VM starts using the same template and the same host to copy. Second mapping attempt failed.

While creating the volume clone from the seeded template in primary storage, adding a lock with the string containing IDs of template, storage pool and destination host avoids the situation of concurrent mapping attempts with the same host.
2023-12-08 13:21:16 +05:30
Rene Glover
9773ba3e95
Allow autoscale group and name override (#8324)
Updates AutoScaleManager/AutoScaleManagerImpl so that getNextVmHostName and checkAutoScaleVmGroupName can be overridden in derivative implementations to allow for custom naming conditions and restrictions. If possible, would like to include this in 4.19 since it is a trivial change.
This can be used to create an extension of AutoScaleManagerImpl.java, overriding these 2 methods
2023-12-08 11:21:25 +05:30
Vishesh
4e9c4a5895
Fix intermittent build failures (#8312) 2023-12-07 14:03:26 +01:00
Andrija Panic
88f64de848
Update cloudstack-help-text (#8329) 2023-12-07 12:27:42 +01:00
Gabriel Pordeus Santos
22a4464c67
change args visibility when editing a default role (#8322) 2023-12-07 12:12:14 +01:00
Wei Zhou
7ea068c4dc
kvm: fix error 'Failed to find passphrase for keystore: cloud.jks' when enable SSL for kvm agent (#7923) 2023-12-07 09:10:11 +01:00
Nicolas Vazquez
371ad9f55b
New Feature: Import VMware VMs into KVM (#7881)
This PR adds the capability in CloudStack to convert VMware Instances disk(s) to KVM using virt-v2v and import them as CloudStack instances. It enables CloudStack operators to import VMware instances from vSphere into a KVM cluster managed by CloudStack. vSphere/VMware setup might be managed by CloudStack or be a standalone setup.

    CloudStack will let the administrator select a VM from an existing VMware vCenter in the CloudStack environment or external vCenter requesting vCenter IP, Datacenter name and credentials.
    The migrated VM will be imported as a KVM instance
    The migration is done through virt-v2v: https://access.redhat.com/articles/1351473, https://www.ovirt.org/develop/release-management/features/virt/virt-v2v-integration.html
    The migration process timeout can be set by the setting convert.instance.process.timeout
    Before attempting the virt-v2v migration, CloudStack will create a clone of the source VM on VMware. The clone VM will be removed after the registration process finishes.
    CloudStack will delegate the migration action to a KVM host and the host will attempt to migrate the VM invoking virt-v2v. In case the guest OS is not supported then CloudStack will handle the error operation as a failure
    The migration process using virt-v2v may not be a fast process
    CloudStack will not perform any check about the guest OS compatibility for the virt-v2v library as indicated on: https://access.redhat.com/articles/1351473.
2023-12-07 12:59:56 +05:30
sato03
fdfbb4fad1
Prioritize hypervisor.uri configuration (#8254)
Co-authored-by: Henrique Sato <henrique.sato@scclouds.com.br>
2023-12-06 16:43:04 -03:00
Daan Hoogland
14376ce298 Merge release branch 4.18 to main
* 4.18:
  kvm: fix ide controller for rocky/alma vms (#8247)
2023-12-06 16:06:09 +01:00
Wei Zhou
db6dd52f44
kvm: fix ide controller for rocky/alma vms (#8247) 2023-12-06 15:05:49 +01:00
Abhishek Kumar
b00fd6bb4d Merge remote-tracking branch 'apache/4.18' 2023-12-06 18:27:35 +05:30
dahn
a6b570845f
lower level and no stack traces at info or higher (#8278)
This PR reduces loglevel on non fatal errors and removes stacktraces above debug level.
2023-12-06 16:42:54 +05:30