36461 Commits

Author SHA1 Message Date
Suresh Kumar Anaparti
8ea9fc911d
StoragePoolType as class (#8544)
* StoragePoolType as a class

* Fix agent side StoragePoolType enum to class

* Handle StoragePoolType for StoragePoolJoinVO

* Since StoragePoolType is a class, it cannot be converted by @Enumerated annotation.
Implemented conveter class and logic to utilize @Convert annotation.

* Fix UserVMJoinVO for StoragePoolType

* fixed missing imports

* Since StoragePoolType is a class, it cannot be converted by @Enumerated annotation.
Implemented conveter class and logic to utilize @Convert annotation.

* Fixed equals for the enum.

* removed not needed try/catch for prepareAttribute

* Added license to the file.

* Implemented "supportsPhysicalDiskCopy" for storage adaptor.

Co-authored-by: mprokopchuk <mprokopchuk@apple.com>

* Add javadoc to StoragePoolType class

* Add unit test for StoragePoolType comparisons

* StoragePoolType "==" and ".equals()" fix.

* Fix StoragePoolType for FiberChannelAdapter

* Fix for abstract storage adaptor set up issue

* review comments

* Pass StoragePoolType object for poolType dao attribute

---------

Co-authored-by: Marcus Sorensen <mls@apple.com>
Co-authored-by: mprokopchuk <mprokopchuk@apple.com>
Co-authored-by: mprokopchuk <mprokopchuk@gmail.com>
2024-02-05 13:27:15 +05:30
Abhishek Kumar
d353fcc599
engine-schema: upgrade path 4.19.0.0 to 4.20.0.0 (#8608)
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-02-05 13:20:20 +05:30
Abhishek Kumar
d5d8b6d086
tools,changelog: fix nextversion 4.20.0.0-SNAPSHOT (#8607)
Fixes next version to 4.20.0.0-SNAPSHOT in files that were not updated by the setnextversion script.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-02-05 11:22:19 +05:30
Abhishek Kumar
e33f98f52c Merge remote-tracking branch 'apache/4.19' 2024-02-05 11:16:04 +05:30
Abhishek Kumar
3550f6a959
tools,changelog: fix nextversion (#8606)
Fixes next version in files that were not updated by the setnextversion
script.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-02-05 11:15:13 +05:30
Wei Zhou
af8a582055
api/utils/ui: List protocol numbers and icmp types (#8293)
This PR contains the following changes

* adds a new API to list network procotols and details/types/codes, etc
* get network protocols on UI and add dropdowns for procotol numbers and icmp types/codes
* validate icmp types/codes when add network ACL
2024-02-02 15:49:04 +01:00
Abhishek Kumar
7dffbc6e47 Updating pom.xml version numbers for release 4.20.0.0-SNAPSHOT
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-02-02 18:16:37 +05:30
Abhishek Kumar
cf0d436fc8 Merge remote-tracking branch 'apache/4.19' into main 2024-02-02 18:15:21 +05:30
Abhishek Kumar
67bd3aad71 Updating tools/checkstyle/pom.xml version numbers for release 4.19.1.0-SNAPSHOT
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-02-02 18:13:20 +05:30
Abhishek Kumar
a7b97ff3b0 Updating pom.xml version numbers for release 4.19.1.0-SNAPSHOT
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-02-02 18:06:04 +05:30
Lucas Martins
39e0a8e8d4
Change Cryptsetup validation (#8482)
Co-authored-by: lucas.martins.scclouds <lucas.martins@scclouds.com.br>
2024-01-31 10:23:53 -03:00
Abhishek Kumar
2746225b99 Updating pom.xml version numbers for release 4.19.0.0
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
4.19.0.0
2024-01-29 10:21:52 +05:30
Vishesh
fedcf66de0
Externalise a few timeouts & fix timeout for hostSupportsUefi in libvirt ready command wrapper (#8547)
This PR fixes bug introduced in #8502. Timeout for script execution was set to 60 ms instead of 60s which resulted in host not getting UEFI enabled. This is a blocker for 4.19 release.

We do this by introducing a new agent parameter `agent.script.timeout` (default - 60 seconds) to use as a timeout for the script checking host's UEFI status.

We also externalize the timeout for the ReadyCommand by introducing a new global setting `ready.command.wait` (default - 60 seconds).

For ModifyStoragePoolCommand, we don't externalize the timeout to avoid confusion for the user. Since, the required timeout can vary depending on the provider in use and we are only setting the wait for default host listener for now. Instead, we reuse the global `wait` setting by dividing it by `5` making the default value of 6 minutes (1800/5 = 360s) for ModifyStoragePoolCommand.

Note: the actual time, the MS waits is twice the wait set for a Command. Check reference code below.
19250403e6/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentAttache.java (L406-L442)
2024-01-27 23:36:13 +05:30
Abhishek Kumar
19250403e6
ui: fix create k8s cluster multiple listing (#8539)
Fixes #8536

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-01-22 10:26:40 +05:30
kishankavala
80bbb29abf
CleanUp Async Jobs after mgmt server maintenance (#8394)
This PR fixes moves resources stuck in transition state during async job cleanup

Problem:
During maintenance of the management server, other servers in the cluster or the same server after a restart initiate async job cleanup. However, this process leaves resources in a transitional state. The only recovery option currently available is to make direct database changes.

Solution:
This PR introduces a resolution by changing Volume, Virtual Machine, and Network resources from their transitional states. This adjustment enables the reattempt of failed operations without the need for manual database modifications.
2024-01-19 13:26:25 +05:30
Nicolas Vazquez
8d42ca8ccf
Use project version on pom dependencies (#8529)
This PR fixes the POM dependencies from a hardcoded value to the project.version property on dependencies
2024-01-18 20:16:06 +05:30
Andrija Panic
3bcf6f0faf
Rename "Import QCOW...." to "Import QCOW2....." (#8519)
Minor UI updates, renaming "Import QCOW...." to "Import QCOW2....."
2024-01-18 18:07:07 +05:30
Wei Zhou
62efe7433d
scripts: mark multipath scripts as executable (#8524)
This PR marks the multipath scripts as executable.

This fixes the issue that in 4.19.0.0-RC2, vms can not be stopped in ubuntu hosts.

2024-01-17 12:56:26,061 ERROR [c.c.v.VmWorkJobHandlerProxy] (Work-Job-Executor-4:ctx-e3503563 job-38/job-39 ctx-42706275) (logid:81ede4e9) Invocation exception, caused by: com.cloud.utils.exception.CloudRuntimeException: Unable to stop the virtual machine due to java.lang.NullPointerException
        at com.cloud.utils.script.Script.getExitValue(Script.java:74)
        at com.cloud.hypervisor.kvm.storage.MultipathSCSIAdapterBase.runScript(MultipathSCSIAdapterBase.java:476)
        at com.cloud.hypervisor.kvm.storage.MultipathSCSIAdapterBase.disconnectPhysicalDiskByPath(MultipathSCSIAdapterBase.java:226)
        at com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager.disconnectPhysicalDiskByPath(KVMStoragePoolManager.java:205)
        at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.cleanupDisk(LibvirtComputingResource.java:3335)
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtStopCommandWrapper.execute(LibvirtStopCommandWrapper.java:101)
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtStopCommandWrapper.execute(LibvirtStopCommandWrapper.java:49)
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtRequestWrapper.execute(LibvirtRequestWrapper.java:78)
        at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.executeRequest(LibvirtComputingResource.java:1903)
2024-01-18 18:06:28 +05:30
Vishesh
c3b77cb7b8
Fix host stuck in connecting state (#8502)
There are a lot of test failures due to test_vm_life_cycle.py in multiple PRs due to host not available for migration of VMs.
#8438 (comment)
#8433 (comment)
#7344 (comment)

While debugging I noticed that the hosts get stuck in Connecting state because MS is waiting for a response of the ReadyCommand from the agent. Since we take a lock on connection and disconnection, restarting the agent doesn't work. To fix this, we have to restart the MS or wait for ~1 hour (default timeout).

On the agent side, it gets stuck waiting for a response from the Script execution.

To reproduce, run smoke/test_vm_life_cycle.py (TestSecuredVmMigration test class to be specific). Once the tests are complete, you will notice that some hosts are stuck in Connecting state. And restarting the agent fails due to the named lock. Locks on DB can be checked using the below query.

SELECT *
FROM performance_schema.metadata_locks
INNER JOIN performance_schema.threads ON THREAD_ID = OWNER_THREAD_ID
WHERE PROCESSLIST_ID <> CONNECTION_ID() \G;

This PR adds a wait for the ready command and a timeout to the Script execution to ensure that the thread doesn't get stuck and the named lock from database is released.
2024-01-15 13:56:34 +05:30
Abhishek Kumar
3936f7c2cf
vm-import: kvm import and fix volume size when lesser than 1GiB (#8500)
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Co-authored-by: Daan Hoogland <daan@onecht.net>
2024-01-12 13:32:02 +01:00
Nicolas Vazquez
a3a4833c3e
Fixes for KVM unmanaged instances import on advanced network and VNC password (#8492)
This PR fixes a regression caused by #8465 on advanced zones, import fails with:

2024-01-10 12:13:33,234 DEBUG [o.a.c.e.o.NetworkOrchestrator] (API-Job-Executor-3:ctx-991bbe9f job-128 ctx-f49517d4) (logid:d7b8e716) Allocating nic for vm 142272e8-9e2e-407b-9d7e-e9a03b81653c in network Network {"id": 204, "name": "Isolated", "uuid": "9679fac5-e3ac-4694-a57b-beb635340f39", "networkofferingid": 10} during import
2024-01-10 12:13:33,239 ERROR [o.a.c.v.UnmanagedVMsManagerImpl] (API-Job-Executor-3:ctx-991bbe9f job-128 ctx-f49517d4) (logid:d7b8e716) Failed to import NICs while importing vm: i-2-31-VM
com.cloud.exception.InsufficientVirtualNetworkCapacityException: Unable to acquire Guest IP  address for network Network {"id": 204, "name": "Isolated", "uuid": "9679fac5-e3ac-4694-a57b-beb635340f39", "networkofferingid": 10}Scope=interface com.cloud.dc.DataCenter; id=1
	at org.apache.cloudstack.engine.orchestration.NetworkOrchestrator.importNic(NetworkOrchestrator.java:4582)
	at org.apache.cloudstack.vm.UnmanagedVMsManagerImpl.importNic(UnmanagedVMsManagerImpl.java:859)
	at org.apache.cloudstack.vm.UnmanagedVMsManagerImpl.importVirtualMachineInternal(UnmanagedVMsManagerImpl.java:1198)
	at org.apache.cloudstack.vm.UnmanagedVMsManagerImpl.importUnmanagedInstanceFromHypervisor(UnmanagedVMsManagerImpl.java:1511)
	at org.apache.cloudstack.vm.UnmanagedVMsManagerImpl.baseImportInstance(UnmanagedVMsManagerImpl.java:1342)
	at org.apache.cloudstack.vm.UnmanagedVMsManagerImpl.importUnmanagedInstance(UnmanagedVMsManagerImpl.java:1282)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Also, addresses the VNC password field set instead of a fixed string
2024-01-12 14:14:01 +05:30
Nicolas Vazquez
59e78cbc45
Fix KVM unmanage disks path (#8483)
This PR fixes the volumes path on KVM import unmanaged instances

Fixes: #8479
2024-01-11 14:45:57 +05:30
Nicolas Vazquez
64f4480ef4
Fix Vmware to KVM migration (#8485)
This PR fixes the Vmware to KVM migration issue on main branch

Fixes: #8473
2024-01-11 12:02:02 +05:30
Abhishek Kumar
c43b7c04f4
ui: fix labels when migrating instances from vmware (#8490)
Fixes #8474
Renames labels when importing from VMware
2024-01-11 11:58:56 +05:30
Suresh Kumar Anaparti
e87ce0c723
Fix reorder/list pools when cluster details are not set, while deploying vm / attaching volume (#8373)
This PR fixes reorder/list pools when cluster details are not set, while deploying vm / attaching volume.

Problem:
Attach volume to a VM fails, on infra with zone-wide pools & vm.allocation.algorithm=userdispersing as the cluster details are not set (passed as null) while reordering / listing pools by volumes.

Solution:
Ignore cluster details when not set, while reordering / listing pools by volumes.
2024-01-10 18:13:32 +05:30
Vishesh
4f40eae1c4
DRS: Use free metrics insteado of used for computation (#8458)
This PR makes changes to use cluster's free metrics instead of used while computing imbalance for the cluster. This allows DRS to run for clusters where hosts doesn't have the same amount of metrics.
2024-01-10 17:52:46 +05:30
Nicolas Vazquez
b8d3e342be
Fix KVM import unmanaged instances on basic zone (#8465)
This PR fixes import unmanaged instances on KVM basic zones, on top of #8433

Fixes: #8439: point 1
2024-01-10 13:21:00 +05:30
slavkap
c569fe9119
Fix KVM import and list unmanaged VMs (#8445)
VM import fixes

1 - Fix of VM insert for VMs with StorPool volumes
2 - Fix of list/insert unmanaged VMs with RBD volumes
2024-01-10 13:12:07 +05:30
Abhishek Kumar
4d42b8da0d Merge remote-tracking branch 'apache/4.18' 2024-01-10 12:26:09 +05:30
Suresh Kumar Anaparti
32f379270c
Register managed user data using POST call from UI (to support user data content > 4096 bytes) (#8487)
This PR allows to register managed user data using POST call from UI (to support user data content > 4096 bytes).

Partially fixes #8415
2024-01-10 12:06:12 +05:30
sato03
76aff0f422
Add reconnect button to hosts on alert (#8468)
Currently, if a host is on alert, the option to reconnect it is not presented in the UI.

This PR addresses this issue by adding a reconnect button to the host if it is in an alert state.
2024-01-10 12:05:46 +05:30
Abhishek Kumar
d6ac91f2df
minio: fix store user creation (#8425)
To prevent errors during multi-user access, use account UUID to create/access user on the provider side. Also, update the existing secret key for a user that already exists.
2024-01-09 17:44:11 +05:30
Suresh Kumar Anaparti
2b28a664fe
Updated jetty maxFormContentSize value to 1048576 bytes (default is 200000 bytes), to support user data upto 1048576 bytes (#8420)
This PR enables support for user data content upto 1048576 bytes - updates jetty maxFormContentSize value to 1048576 bytes (default is 200000 bytes).

CloudStack can support max user data content to 1048576 bytes (the size can be configurable through vm.userdata.max.length setting, max 1048576), but it's limited due to the default Jetty max content size, which is 200000 bytes.

Configuration Reference from jetty doc:
https://eclipse.dev/jetty/documentation/jetty-9/index.html#configuring-specific-webapp-deployment (check with maxFormContentSize here)
2024-01-09 17:38:44 +05:30
Nicolas Vazquez
9a915b11c4
Fix KVM import unmanaged instance (#8433)
This PR fixes KVM manage/unmanage functionality on 4.19.0 RC1 - was introduced on #7976 but the latest merge commits on the PR removed the execution for KVM
2024-01-09 17:38:11 +05:30
Abhishek Kumar
514d2c2a26
schema,engine-schema: explicit VMware 8.0.0.2, 8.0.0.3 support, logs (#8444)
Fixes #8412

Add support for 8.0.0.2 explicitly to prevent falling over to the parent version
Adds log when hypervisor capabilities fail over to the parent version

---------

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-01-09 14:43:04 +05:30
Abhishek Kumar
5c32a0edba
ui: prevent scheduling readyforshutdown job when api inaccessible (#8448)
Non-admin account may not have access to the readyForShutdown API therefore UI should not schedule the job.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-01-08 18:02:11 +05:30
Abhishek Kumar
a68dc0bfb5 Merge remote-tracking branch 'apache/4.18' 2024-01-08 18:01:13 +05:30
Abhishek Kumar
f023fc53c0
engine-schema: fix finding guestos mapping with parent version (#8426)
GuestOS mappings are retrieved from the parent hypervisor version when a minor, patch hypervisor version doesn't exist.

Fixes #8412

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-01-08 17:51:04 +05:30
Nicolas Vazquez
3f9dd4dc07
Fix VMware VM ingestion template selection and default template failure (#8429)
This PR fixes the template selection regression for VMware Ingestion in the UI on 4.19.0 RC1 and adds back the default template selection for VMware

Fixes: #8428 #8432
2024-01-05 12:57:13 +05:30
Abhishek Kumar
746bae740e
ui: fix default domainid for add account (#8435)
Fixes setting domainid param default value which was being set to 0.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-01-04 17:59:18 +05:30
Abhishek Kumar
66ae96b5eb
ui: fix layout for action button for template form (#8434)
Fixes layout for the action buttons on register template form

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-01-04 17:33:55 +05:30
João Jandre
687610dd5f
Fix bootstrap exceptions (#8397)
During management server initialization, some EmptyStackException and BeansException exceptions are always thrown; These exceptions do not affect ACS, however, they can cause confusion when observing the management server startup logs with DEBUG level on. The causes of the exceptions have been addressed.

Co-authored-by: João Jandre <joao@scclouds.com.br>
2024-01-04 17:27:24 +05:30
Vishesh
2eaed80435
ui: fix ssl check in image store browser (#8430)
This PR fixes the ssl in image store browser.
2024-01-04 17:26:07 +05:30
dahn
9d4f0715d4
change of the guard (#8408) 2023-12-27 13:56:17 +01:00
Abhishek Kumar
a97ce242ba Merge remote-tracking branch 'apache/4.18' 2023-12-22 15:44:17 +05:30
João Jandre
08749d8354
server: skip password policies check on empty password (#8370)
This PR changes the password.policy.regex default value to empty. With an empty value for the configuration, it is skipped during the password policy check, only when the configuration is set to something different than a blank string, the regex will get checked.
This way, when creating a user on org.apache.cloudstack.ldap.LdapAuthenticator#authenticate() we won't get an error by default, as an empty value for the password is passed.
2023-12-22 15:43:39 +05:30
Abhishek Kumar
ab808995ff
Revert "Add e2e tests for listing resources (#8281)" (#8396)
This reverts commit 1411da1a22bc6aa26634f3038475e3d5fbbcd6bb.
2023-12-21 20:56:40 +05:30
Abhishek Kumar
26214ea139 Merge remote-tracking branch 'apache/4.18' 2023-12-21 20:55:38 +05:30
Abhishek Kumar
d83d994929
test: additional check to ensure hosts are left in up state (#8383)
With this change, a fix is added for failures seen with test_08_migrate_vm or other migration-related tests because the target host is in `Connecting` state,
#8356 (comment)
#8374 (comment)
and more
2023-12-21 20:54:43 +05:30
Wei Zhou
9d3a7be4dd
server: fix debug message when expunge a vm (#8374)
This PR fixes the debug message when expunge a vm
2023-12-21 14:17:57 +05:30