11210 Commits

Author SHA1 Message Date
Nicolas Vazquez
fbf77978e1
Fix: Allow disabling the login attempts mechanism for disabling users (#6254)
* Fix: Allow disabling the login attempts mechanism for disabling users

* Refactor
2022-04-14 01:11:43 -03:00
Wei Zhou
91a5f0e285
server: honor global setting system.vm.default.hypervisor as first option when deploy VRs (#6160) 2022-04-13 07:22:22 -03:00
Pearl Dsilva
b6072fc826
Allow expunging a VM on a deleted host when using host cache and ConfigDrive userdata service (#6234) 2022-04-11 11:19:37 -03:00
Abhishek Kumar
e7071ec196
server: increment deviceid while importing vm data volumes (#6123)
Fixes #6121

deviceId for a volume/disk is never used by CloudStack VMware hypervisor plugin. Still it would be correct to increment value for each data volume/disk, behaviour similar to adding data volumes/disks.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2022-04-08 15:24:10 +05:30
Pearl Dsilva
908f594f00
configDrive: Fix failure to delete (unstarted) VM (#6146)
* configDrive: Fix failure to delete (unstarted)VM

* Address comments

* Address comments
2022-03-29 09:56:54 +02:00
Pearl Dsilva
bcd1a3274a
api: Fix reset configuration (#6168) 2022-03-29 09:54:34 +02:00
Pearl Dsilva
4be99fe971
api: Allow updating VM settings when custom contrained offering is used (#6136) 2022-03-18 09:09:40 +01:00
Wei Zhou
3a456f1b31
server: mark volume snapshots as Destroyed if it does not exist on primary and secondary storage when delete a volume (#6057)
* server: mark volume snapshots as Destroyed in some cases when delete a volume in QCOW2 format

when delete a volume in QCOW2 format, if volume snapshot does not exist on primary and secondary storage, mark the snapshot as Destroyed.

* Update #6057: remove check on volume format
2022-03-10 08:49:03 -03:00
Suresh Kumar Anaparti
2820a36f86
Check the network access when deploying VM in Advanced Security Group. (#6050)
* Check the network access when deploying VM in Advanced Security Group.

* Removed comment

* Removed redundant network access check, owner access check already exists
2022-03-06 10:07:57 -03:00
Suresh Kumar Anaparti
bc70535ee5
Updating pom.xml version numbers for release 4.16.2.0-SNAPSHOT
Signed-off-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
2022-03-03 18:15:33 +05:30
Suresh Kumar Anaparti
cad9332082
Updating pom.xml version numbers for release 4.16.1.0
Signed-off-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
2022-02-25 19:01:16 +05:30
Pearl Dsilva
a8cc261143
[vmware, ssvm] Scale down of ssvm (#6042)
* [vmware, ssvm] Scale down of ssvm

* address comments - change variable name
2022-02-25 15:45:10 +05:30
Wei Zhou
c543f5f546
server: reapply checkVmProfileAndHost to check guest os preference (#6000) 2022-02-17 14:25:13 +05:30
sureshanaparti
5297b52d98
Improve the guest OS hypervisor mappings addition on upgrade. (#5911)
- This removes the hardcoded guest os ids 305 - 329 in upgrade path 4.14.0 to 4.15.0, and 330 - 349 in upgrade path 4.15.0.0 to 4.15.1.0.
2022-02-10 14:43:03 +01:00
dahn
a6d9fa61b9
Role escalation prevention (#5879)
* prevent role access escallation

* hierarchy issue fixed

* create api list in account manager for checking new account access

* full api list check

* strange role restriction removed for BareMetal

* add role check on upfdate account as well

* more selective use of api checkers

* error msg and var name

Co-authored-by: Daan Hoogland <dahn@onecht.net>
2022-02-10 11:50:27 +05:30
slavkap
4ffb949a58
Fix of revert RBD snapshots (#5544)
* Fix of revert RBD snapshots

If snapshot is taken only on Primary storage with the option "snapshot.backup.to.secondary" set to true, when you set this option to false the revert will fail. Added check if the snapshot is not on Secondary to check for it on Primary

* Check if snapshot is on primary storage

Will check first if the snapshot is on Primary storage, if not will
return Image as data store

* Fix unit tests

* removed unused method's params

* Formatted error message and added the snapshot ID to it

* Return to the old logic, the fix will only apply to RBD

* Formatted Exception's messages
2022-02-10 10:22:21 +05:30
Abhishek Kumar
f88f934274
api, server: fix add-remove vpn user without vpn owner (#5850)
* api, server: fix add-remove vpn user without vpn owner

Fixes #5711

ACS should not add a new user in Add state when the owner account does not have VPN access.
While removing VPN user ACS should not fail completely when owner account ahs no VPN.

* change , fixes

* remove unused method

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2022-02-10 10:07:23 +05:30
dahn
3fc4ef478d
replace Random with SecureRandom (#5966)
Co-authored-by: Daan Hoogland <dahn@onecht.net>
2022-02-09 21:08:33 +05:30
davidjumani
453aeb02f0
Add ID search capability to sshkeypairs (#5963) 2022-02-09 09:34:00 +05:30
Pearl Dsilva
e609aa8e9c
Skip systemVM template registration for Simulator (#5954)
* Skip systemVM template registration for Simulator

* simplify
2022-02-08 19:44:01 +01:00
Abhishek Kumar
af58284560
server,config: respect storage.max.volume.size and make it dynamic (#5857)
* server,config: respect storage.max.volume.size and make it dynamic

Fixes #5830

* fix test

* size change

* fix check

* server: donot include ISO size while checking volume sizes

* revert size check

* refactor

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com>
2022-02-08 13:29:35 +05:30
dahn
0f1cd6009d
add logging to deployment planners (#5859)
Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com>

Co-authored-by: Daan Hoogland <dahn@onecht.net>
Co-authored-by: Daniel Augusto Veronezi Salvador <38945620+GutoVeronezi@users.noreply.github.com>
Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com>
2022-02-04 17:02:32 +01:00
Harikrishna
56a8852c4c
Remove code that reserves extra interfaces based on the global setting router.extra.public.nics in case of VMware. (#5912)
Added hot plugging of vifs whenever required in case of isolated networks. VPC networks already uses hotplugging of vifs.
2022-02-04 12:41:56 +01:00
dahn
ef7debb487
Filter usage for project (#5866)
Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com>
Co-authored-by: Daan Hoogland <dahn@onecht.net>
Co-authored-by: José Flauzino <jose.wilson.vf@gmail.com>
Co-authored-by: Daniel Augusto Veronezi Salvador <38945620+GutoVeronezi@users.noreply.github.com>
Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com>
2022-02-04 11:45:32 +01:00
Wei Zhou
4a1ebb3fa5
server: allow normal users to create isolated network without source nat (#5920) 2022-02-03 16:44:11 +05:30
Abhishek Kumar
638779ca37
vm-import: fix unmanaged instance listing (#5400)
* vm-import: fix unmanaged instance listing

When the host and last host ID is not set for the VM, it may appear in the list of unmanaged instances.
This changes fixes the behaviour by filtering unmanaged instances list for host for following three criteria:
- host is set as host_id for the VM
- host is set as the last_host_id for the VM
- pod of the host is set as the pod_id for the VM and both host_id and last_host_id is NULL

* use SearchBuilder to fix query condition

* add paranthesis

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2022-02-03 10:27:05 +05:30
Abhishek Kumar
62b806ac13
api,server: add params for updatehypervisorcapabilities API (#5473)
* api,server: add params for updatehypervisorcapabilities API

Allows updating following capabilities for a hypervisor, version:
- Max DATA volumes limit
- Storage motion supported
- Max hosts per cluster
- VM snapshot enabled

* added test

* changes

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* Update test/integration/smoke/test_hypervisor_capabilities.py

Co-authored-by: dahn <daan.hoogland@gmail.com>
2022-02-03 10:21:23 +05:30
Abhishek Kumar
8adb8df2fe
server: find suitable disk offering for volume upload (#5852)
* server: find suitable disk offering for volume upload

Fixes #5696

* fix npe check

* fixes, refactor, rename method and handle custom iops

* ui: allow offering selection

* list only disk offerings

* show name

* revert error check

* use checkaccess

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2022-02-02 16:35:47 +05:30
dahn
c1bba2a308
Do not restart VPC tiers with cleanup (#5873)
* do not restart VPC tiers with cleanup

* no option for cleanup for VPC tiers

* Update server/src/main/java/com/cloud/network/NetworkServiceImpl.java

* paramNames

* remove superfluent parameter

Co-authored-by: Daan Hoogland <dahn@onecht.net>
Co-authored-by: Daniel Augusto Veronezi Salvador <38945620+GutoVeronezi@users.noreply.github.com>
2022-01-31 17:59:26 +05:30
Nicolas Vazquez
3e92a63155
[XenServer/XCP-ng] Pass the image store NFS version on storage commands (#5886)
* Add NFS version to mount command

* Remove extra line

* Extend NFS version to mount secondary storage

* Unused import

* Refactor NFS version to be granular

* Make use of the ConfigKey on the NFS version setting value
2022-01-31 12:21:13 +05:30
sureshanaparti
0e150954d0
Allow direct download templates from IPv6 host address. (#5900)
* Allow templates & ISOs from IPv6 host address.

* fix checkstyle issue

* Allow only direct download templates from IPv6 address

Co-authored-by: gabriel <gabriel@apache.org>
2022-01-28 09:50:32 +05:30
Nicolas Vazquez
84f5768e64
[VMware][Deploy-as-is] OVF properties not importing when template is uploaded from local (#5861)
* Fix ova upload missing details

* Refactor and cleanup

* Unused import
2022-01-26 11:28:52 +05:30
Wei Zhou
f3289fb596
server: fix regular user can create isolated network without sourcenat (#5844)
* server: fix regular user can create isolated network without sourcenat
2022-01-20 14:10:23 +05:30
Abhishek Kumar
d78a815442
server: fix update vm with unconstrained offering (#5828)
Fixes #5694

Signed-off-by: Abhishek Kumar <abhishek.kumar@shapeblue.com>
2022-01-13 12:30:12 +05:30
Wei Zhou
216bea1978
ipv6: disable IPv6-only shared network with VR (#5810)
* ipv6: disable IPv6-only shared network with VR

* Update #5810: import org.apache.commons.lang3.StringUtils
* Update #5810: do not import org.apache.commons.lang3.StringUtils
* Update server/src/main/java/com/cloud/network/NetworkServiceImpl.java
* Update engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java

Co-authored-by: Daniel Augusto Veronezi Salvador <38945620+GutoVeronezi@users.noreply.github.com>
2022-01-12 13:33:35 +05:30
Wei Zhou
9293f5bd27
server: fix enable/disable static nat if userdata is not supported (#5839)
* server: fix enable/disable static nat if userdata is not supported

* Update #5839: rename applyUserData to applyUserDataIfNeeded

* Update server/src/main/java/com/cloud/network/rules/RulesManagerImpl.java

Co-authored-by: Daniel Augusto Veronezi Salvador <38945620+GutoVeronezi@users.noreply.github.com>
2022-01-11 12:22:59 +05:30
Wei Zhou
fadd74aaca
network: fix vm can be deployed on L2 network of other accounts (#5784)
* Update #5769: fix domain admin can deploy vm on L2 network of other users

* test: fix test_storage_policy.py

* Update #5784: revert part of changes in #2420
2022-01-11 12:16:00 +05:30
dahn
028d338aaa
remove VmWorkJob after adding a nic to a vm (#5658)
Co-authored-by: Daan Hoogland <dahn@onecht.net>
Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
Co-authored-by: Wei Zhou <weizhou@apache.org>
2022-01-10 16:31:50 +01:00
Nicolas Vazquez
946f9156e5
vmware: Persist empty values instead of null (#5748)
This PR allows deploying VMware appliances missing default values on some properties
Fixes: #5747
2022-01-08 08:58:46 +05:30
dahn
2774bc156f
use physical size instead of virtual size for migration. (#5750)
* Use Physical size to evaluate if migration is possible

* Improve logging and consider files skipped as failure in complete migration

* skipped can't be negative

* remove useless method

* group multidisk templates for secstor migration

* use enum

* Update engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/DataMigrationUtility.java

Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com>
Co-authored-by: Pearl Dsilva <pearl1594@gmail.com>
Co-authored-by: Daan Hoogland <dahn@onecht.net>
Co-authored-by: Pearl d'Silva <pearl.dsilva@shapeblue.com>
2022-01-06 17:18:50 +05:30
Abhishek Kumar
51f69f7134
server: do not return inaccessible entity details to normal users (#5827)
Fixes #5534

As pre 3.x APIs allow using internal DB IDs, even normal users can use internal IDs.
This fix removes additional information in error message when the caller doesn't have access to the resource.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2022-01-06 16:42:57 +05:30
Rakesh
2bd1dc1e14
Enable resetting config values to default value (#4230)
* Enable resetting config values to default value

Provide reset button to zone,cluster,domain,account,
primary and secondary storage so that config values
can be reset to default value

* fix ui issue

* Update test/integration/smoke/test_reset_configuration_settings.py

* Update test/integration/smoke/test_reset_configuration_settings.py

Co-authored-by: Rakesh Venkatesh <rakeshv@apache.org>
Co-authored-by: dahn <daan.hoogland@gmail.com>
2022-01-03 21:55:30 +01:00
Wei Zhou
8952cd5955
kvm: add hosts using cloudstack ssh private key (ccc21 hackathon) (#5684)
This PR provides the option to add kvm hosts with empty or wrong password.
To support this, the cloudstack ssh public key needs to be added in the ~/.ssh/authorized_keys on host.

Feature work:

1. get cloudstack public key from management server (/var/lib/cloudstack/management/.ssh/id_rsa.pub)

![image](https://user-images.githubusercontent.com/57355700/141449653-85f644b5-c32e-44ca-9c6b-77570262c046.png)


2. add the key to ~/.ssh/authorized_keys on kvm hosts

![image](https://user-images.githubusercontent.com/57355700/141449722-e906eea5-74fd-4f81-a4d3-41563beeb79c.png)

3. add kvm host with empty password

<img src="https://user-images.githubusercontent.com/57355700/141449865-6ffee1f0-b0d7-4ea4-b11a-32df42e2fe91.png" height="50%" width="50%">

Tested as:
1. add host, with correct password,  works as expected.
2. put host to maitenance, stop cloudstack-agent, cancel maintenance, remove the host. all work.
3. add host, with empty password (ssh public key is added to  ~/.ssh/authorized_keys),   works as expected.
4. put host to maitenance, stop cloudstack-agent, cancel maintenance. all work as expected.
2021-12-30 16:20:04 +05:30
Nicolas Vazquez
c0ddda361a
[VMware] Fix service offerings listing on appliances deployment options (#5752)
* Fix list service offerings for VMware deployment options

* UI fix to allow selecting offerings
2021-12-30 16:13:41 +05:30
Marcus Sorensen
dcdcd09058
Randomize managed volume copy host (#5789)
* Randomize managed volume copy host

* Managed volume copy was always returning first host that could see storage pools

* Fix null value in logging for ScaleIOPrimaryDataStoreDriver due to if/else logic error

Signed-off-by: Marcus Sorensen <mls@apple.com>

* Use String.format for ScaleIO debug message

Signed-off-by: Marcus Sorensen <mls@apple.com>

* Update debug message for ScaleIO copy methods

Signed-off-by: Marcus Sorensen <mls@apple.com>

Co-authored-by: Marcus Sorensen <mls@apple.com>
2021-12-30 16:11:00 +05:30
Wei Zhou
7823868746
network: update ip in lb/pf/dnat tables when update vm nic ip (#5757)
* network: update ip in lb/pf/dnat tables when update vm nic ip

* Update: create 3 separated methods for DNAT/LB/PF update

* Update: invert if condition to reduce code indentation
2021-12-28 01:35:29 +05:30
Rakesh
8ba5b92a83
server: Fix NPE while deleting a domain (#5753)
* server: Fix NPE while deleting a domain

While deleting a domain, if vlan ip range cant be found
then this will throw NPE. Just return false if vlan ip
range cant be found

* return true if vlan is not found

* change output message

Co-authored-by: Rakesh Venkatesh <rakeshv@apache.org>
2021-12-28 01:21:43 +05:30
Rakesh
9607ae9639
server: Fix NPE while adding network to VPC (#5723)
* server: Fix NPE while adding network to VPC

Sometimes adding network to VPC fails because of libirt error.
In that case the new network wont have any VR's associated with it
and hence it will return null.

* use collectionutils

Co-authored-by: Rakesh Venkatesh <rakeshv@apache.org>
2021-12-25 19:57:18 +05:30
sureshanaparti
9b0a1418ec
Provision to sort ISOs from UI, and Updated Templates/ISOs API response to return in the order of sortkey (#5800) 2021-12-24 12:44:50 +05:30
sureshanaparti
39e41f6b6e
Allow force reboot VM from user account, to start VM on the same host (#5791) 2021-12-22 17:43:02 +01:00