34074 Commits

Author SHA1 Message Date
Wei Zhou
c6ba3d1bea
ui: Make 'ACL' field as mandatory and add warning message for default_allow and default_deny (#5003)
Co-authored-by: Wei Zhou <weizhouapache@gmail.com>
2021-05-21 15:15:54 +05:30
Spaceman1984
5cbc1d9b18
Fixed invalid ostypeid when not using deployasis (#5033) 2021-05-21 15:15:24 +05:30
Spaceman1984
5f734f718e
vmware: Disk controller vmware deploy as is (#5006)
Fixes #4344
2021-05-19 14:33:16 +05:30
Pearl Dsilva
2eae0f5385
SystemVM: Set agent state to disconnected on Stopping the systemVM (#5010)
Fixes: #4972
This PR sets systevms' agent state to disconnected when it is stopped. Currently, when a systemVM (Console Proxy VM / Secondary storage VM) is stopped, the agent state still appears to be 'Up'
2021-05-19 13:00:17 +05:30
Rohit Yadav
65672b77fb
setup: pass password in quotes for cloudstack-setup-databases (#5025)
Fixes issue of passing password and management secret key with special
characters.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2021-05-18 22:09:14 +05:30
slavkap
06454ff92e
tests: Fix in Marvin migrate_vm_with_volume (#5023)
Cannot migrate VM to another storage, because 'migrateto' is overriden.
2021-05-17 19:15:29 +05:30
Rohit Yadav
2286c8d2bf Merge remote-tracking branch 'origin/4.14' into 4.15 2021-05-14 23:19:06 +05:30
Abhishek Kumar
dc91a1fd4d
server: destroy ssvm, cpvm on last host maintenance (#4644)
* server: destroy ssvm, cpvm on last host maintenance

When a single or last UP host enters into maintenance just stopping SSVM and CPVM will leave behind VMs on hypervisor side. As these system vms will be recreated they can be destroyed.
Fixes #3719

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

* fix methods

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

* immediately destroy systemvms

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

* fix destroy

Added bypassHostMaintenance flag in Comma.java class to allow command to be handled by host agent even when host is in maintenace.
Flag is set true only for delete commands for ssvm and cpvm.

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

* unit test fix

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

* fix missing return statement

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

* fix

VM should be stopped with cleanup before calling expunge else it server may through error with host in PrepareForMaintenance state.

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

* refactor

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

* rename

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

* refactor

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-05-14 23:16:15 +05:30
Abhishek Kumar
755791089d
api/server: cpu, memory values with overprovisioning in metrics response (#4795)
* metrics: operprovisioned host cpu allocated

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

* changes

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

* remove unused

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-05-14 23:15:35 +05:30
Wei Zhou
e2183ed666
forceha: fix two issues when (1)stop vm from inside (2) force remove host (#4647)
* forceha: fix vm is not started if it is poweroff from inside

steps to reproduce the issue
(1) make sure force.ha is true in global setting. if not, change it to true, and restart mgt server
(2) create a service offering , ha is not enabled
(3) create a vm
(4) log into the vm, and power off via cli.

expected result: vm is started again by cloudstack
actual result: vm is not started.

* forceha: fix vms are still running if host is force-removed

when host can be force removed, however vms are stopped in cloudstack, but not stopped on host
```
(localcloud) 🐱 > delete host id="a5625393-444d-4d0a-b31d-62baf88a8be1" forced=true
{
  "success": true
}```

after some minutes, vms are still runnning on host
```
root@mgt01:~# ssh node63 virsh list
 Id   Name        State
---------------------------
 1    i-2-19-VM   running
 2    i-2-11-VM   running
```

error message are
```
Cannot transmit host 2 to Enabled state
com.cloud.utils.fsm.NoTransitionException: No next resource state found for current state = Enabled event = DeleteHost
        at com.cloud.resource.ResourceManagerImpl.resourceStateTransitTo(ResourceManagerImpl.java:1216)
        at com.cloud.resource.ResourceManagerImpl$1.doInTransactionWithoutResult(ResourceManagerImpl.java:907)
```

* forceha: Make ForceHA dynamic
2021-05-14 23:14:39 +05:30
Pearl Dsilva
cc7f426564
ui: Allow IP range creation for Physical Network - Guest Traffic in Basic Zones (#5020)
* ui: Allow IP range creation for Physical Network - Guest Traffic

* get guest network only for basic zone
2021-05-14 23:14:12 +05:30
Abhishek Kumar
57c8286602
ui: pass podid for basic zone createvlaniprange (#5022)
While add IP range for a basic zone, podid parameter must be passed with createVlanIpRange.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-05-14 23:13:43 +05:30
Wei Zhou
1b28ea1ebb
network: fix dhcp/password/metadata issues on shared networks with multiple subnets (#5013)
* #4943: apply iptables for password and metadata

* #4943: fix wrong ip alias

* #4943: revert previous change and add ip_aliases

Co-authored-by: Wei Zhou <weizhouapache@gmail.com>
2021-05-13 14:31:47 +05:30
Nicolas Vazquez
aa289542f0
vmware: Fix deploy-as-is not honoured on upload from local (#5015)
* Fix deploy-as-is not honoured on upload from local

* Missing param
2021-05-13 14:30:34 +05:30
Abhishek Kumar
4ecef4bfb4
ui: prevent same string docHelp override (#5014)
Prevent same string docHelp suffix override.
List all existing docHelp suffixes in the config file during the build process.
Updated apache/cloudstack-documentation#199

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-05-12 16:20:17 +05:30
Pearl Dsilva
493d6a08d2
ui: Display Zone Name instead of Zone UUID in list view (#5011) 2021-05-10 20:48:44 +05:30
Harikrishna
32e3bbdcc5
VMware Datastore Cluster primary storage pool synchronisation (#4871)
Datastore cluster as a primary storage support is already there. But if any changes at vCenter to datastore cluster like addition/removal of datastore is not synchronised with CloudStack directly. It needs removal of primary storage from CloudStack and add it again to CloudStack.

Here synchronisation of datastore cluster is fixed without need to remove or add the datastore cluster.
1. A new API is introduced syncStoragePool which takes datastore cluster storage pool UUID as the parameter. This API checks if there any changes in the datastore cluster and updates management server accordingly.
2. During synchronisation if a new child datastore is found in datastore cluster, then management server will create a new child storage pool in database under the datastore cluster. If the new child storage pool is already added as an individual storage pool then the existing storage pool entry will be converted to child storage pool (instead of creating a new storage pool entry)
3. During synchronisaton if the existing child datastore in CloudStack is found to be removed on vCenter then management server removes that child datastore from datastore cluster and makes it an individual storage pool.
The above behaviour is on par with the vCenter behaviour when adding and removing child datastore.
2021-05-07 16:30:54 +05:30
Abhishek Kumar
1eea9c5939
ui: add tooltips for actions in tab (#4842)
Adds tooltips for buttons in tabs

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-05-07 16:28:16 +05:30
Rohit Yadav
f5e665cd63
server: NPE may cause management server to not start (#5001)
This NPE may happen when a VM is marked removed in the DB but not its
nics on a shared network. This can usually happen due to a failed
expunged VM or when an admin manually marks a VM as removed in DB but
does not cleanup the nics/network resources.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2021-05-07 00:03:16 +05:30
DK101010
21b0b0f84e
allow zero as cpu speed value in service offerings (#4986)
Co-authored-by: DK101010 <dirk.klahre@itelligence.de>
2021-05-06 16:13:36 +05:30
Hoang Nguyen
1654391309
ui: update treeview when clicking the refresh button (#4999)
Fixes #4975
When a domain is generated by another client, the treeview is modified when clicking the refresh button.
2021-05-06 15:00:25 +05:30
sureshanaparti
645ceecea4
Updated since and validations attributes for the ikeversion and splitconnections parameters of vpn customer gateway cmd(s) (#4996) 2021-05-06 10:38:36 +05:30
Pearl Dsilva
bc80815cf5
server: Adding VPN options for IKE version and IKE split connections (#4953)
IKE version allows selecting ike (autoselect), ikev1, or ikev2.
Split connections gives an option of separating the first right subnet from the rest, and kicking out individual statements for each right subnet for better cross-compatibility.

Backported from PR: #4137
update per PR suggestion

Fixes #3138

Co-authored-by: Greg Goodrich <ggoodrich@ippathways.com>
Co-authored-by: Daan Hoogland <dahn@onecht.net>
Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com>
2021-05-05 12:54:23 +05:30
Spaceman1984
7a7fd27350
setup: Fixed error when passing shell reserved characters to setup databases (#4995)
* Fixed error when passing shell reserved charaters to setup databases script for dbsecret

* Moved quote to encrypt method
2021-05-04 23:09:19 +05:30
Pearl Dsilva
4df8d7ade3
ui: Prevent reset of port-forward rules on cancelling a form (#4981)
* ui: Prevent reset of port-forward rules on cancelling a form

* add check for undefined value
2021-05-04 19:34:53 +05:30
davidjumani
1cb8ca69d9
ui: Adding success message for DomainActionForm (#4987) 2021-05-04 19:34:11 +05:30
davidjumani
eb2e5f73d3
ui: show VR offering when provider is VR (#4988)
* ui: show VR offering when provider is VR

* send serviceofferingid not index
2021-05-04 19:33:45 +05:30
Pearl Dsilva
5b6ab3d248
ui: fix for filtering network offering for VPC tiers (#4989) 2021-05-04 19:33:23 +05:30
Pearl Dsilva
d92022ee5c
ui: Hide reset password button for a running VM (#4991) 2021-05-04 19:33:13 +05:30
Pearl Dsilva
155636902c
ui: Close Create network form from Zones -> Physical Network (Guest) -> Traffic Types view (#4993) 2021-05-04 19:33:00 +05:30
Abhishek Kumar
0c47d4efd2
ui: show domain paths for offering domain selection (#4979)
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-04-30 16:37:24 +05:30
davidjumani
603a83066d
ui: rename acl reason to description (#4980) 2021-04-30 13:17:14 +05:30
Pearl Dsilva
2d176db9a4
centos: Install libgcrypt v1.8.5 required by libvirt 6.0 on CentOS8 (#4970)
Fixes: #4969
This PR upgrades the version of libgcrypt that is required by libevirt 6.0

Co-authored-by: Pearl1594 <pearl.dsilva@shapeblue.com>
2021-04-30 12:15:09 +05:30
Gabriel Beims Bräscher
ab790c11d5
server: Allow to upgrade service offerings from local <> shared storage pools (#4915)
This PR addresses the issue raised at #4545 (Fail to change Service offering from local <> shared storage).

When upgrading a VM service offering it is validated if the new offering has the same storage scope (local or shared) as the current offering. I think that the validation makes sense in a way of preventing running Root disks with an offering that does not match the current storage pool. However, the validation only compares both offerings and does not consider that it is possible to migrate Volumes between local <> shared storage pools.

The idea behind this implementation is that CloudStack should check the scope of the current storage pool which the ROOT volume is allocated; this, it is possible to migrate the volume between storage pools and list/upgrade according to the offerings that are supported for such pool.

This PR also fixes an issue where the API command that lists offerings for a VM should follow the same idea and list based on the storage pool that the volume is allocated and not the previous offering.

Fixes: #4545
2021-04-30 11:59:50 +05:30
Olivier Lemasle
72f6612971
server: Increase max length for VMInstanceVO.backupVolumes (#4967)
The default length is 255, which caused a truncation of data if
the JSON object representing the backup volumes is too big.
It caused errors when backups were made on VMs with 3 volumes
or more.

`vm_instance.backup_volumes` has the type TEXT, which has a
maximal length of 65535 characters.

Fixes #4965
2021-04-30 11:57:56 +05:30
Pearl Dsilva
92f9c9922c
ui: Fix Settings Tab view (#4964)
Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com>
2021-04-30 11:51:28 +05:30
Nicolas Vazquez
9349d20dd3
vmware: Make deploy-as-is optional (#4901)
* [Vmware] Make deploy-as-is optional

* Do not use deployasis on create volume test

* Update api/src/main/java/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java

Co-authored-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* Update api/src/main/java/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java

Co-authored-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* Review comments

* Refactor condition to select suitable template

Co-authored-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-04-30 09:47:50 +05:30
Pearl Dsilva
de30f3b7ee
vmware cks: Guard k8s cluster root disk resize if no root disk size passed (#4957)
* Guard k8s cluster resize if no root disk size passed

* test regression

Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com>
2021-04-29 20:41:38 +05:30
dahn
be255e4203
server: protect against stray snapshot-details without snapshot (#4924)
This PR makes sure no orphaned snapshot details are considered in the cleanup at startup job.
a real solution would be to implement some kind of cascading delete, but as the parent record is "only" marked as removed this would be a bit com

Co-authored-by: Daan Hoogland <dahn@onecht.net>
2021-04-29 20:40:29 +05:30
Pearl Dsilva
39cb2bf0af
ui: Display 'Add LDAP Account' button when LDAP configuration is added (#4971)
Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com>
2021-04-29 15:52:12 +05:30
Pearl Dsilva
98e2ed3c4f
vmware: Add force parameter to iso attach/detach operations (#4907)
Fixes: #4808, #4941

This PR adds a force flag to the attachIso / detachIso commands, especially for VMware where it is noticed that when trying to either detach an iso or attach an iso when there already exists another present it fails to do the necessary operation as from ACS end we either answer the question returned by Esxi for CDRom disconnect operation as No (for detach operation) or do not answer the question at all (for Attach operation).

Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com>
2021-04-28 13:46:03 +05:30
Hoang Nguyen
73f82ae9dd
ui: Save the tab and re-activate it after submitting the form. (#4962)
* save the tab and reactivate it after submitting the form.

* fix for quota resource

Fixes #4961
2021-04-28 12:15:42 +05:30
Abhishek Kumar
8e31d1e650
api: fix disk/service offering keys (#4946)
Volume can either have an associated disk offering (for DATA disks & ROOT disks for VMs created from ISO) or a compute/service offering (for ROOT disks of VMs created from templates).
This fix simplifies and fixes check to return the appropriate response keys in these cases.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-04-27 21:54:24 +05:30
Hoang Nguyen
d68b098a43
UI: Show IPv6 address of Instance (#4948)
* vm: show IPv6 address

* show ipv6 address on listview
2021-04-27 21:47:49 +05:30
Pearl Dsilva
d4db1015b8
marvin: fix test_scale_vm for xenserver/Xcp-ng (#4929)
Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com>
2021-04-27 10:21:48 +05:30
Spaceman1984
04cdb50e95
debian: Adding net tools as a dependency (#4951)
Fixes #4928
2021-04-27 10:20:19 +05:30
davidjumani
96ccd6d3e3
ui: Show traffic type in physical networks tab (#4952) 2021-04-26 14:24:20 +05:30
lujiefsi
f8ba33d570
server: Some APIs should have access check (#4859)
This PR fixes the CLOUDSTACK-10434. I think some APIs lack access check and list them in below table. I also give the pattch to add the access check for the api in this table. Anyone chould change this table, If you think the APIs do not need access check and change their lable as "no".

API	Lack?
VolumeApiServiceImpl # updateVolume	yes
VolumeApiServiceImpl # detachVolumeViaDestroyVM	yes
VolumeApiServiceImpl # takeSnapshot	yes
VolumeApiServiceImpl # migrateVolume	yes
AccountManagerImpl#createApiKeyAndSecretKey	yes
LoadBalancingRulesManagerImpl#applyLBStickinessPolicy	yes
LoadBalancingRulesManagerImpl#applyLBHealthCheckPolicy	yes
TemplateManagerImpl#createPrivateTemplate	yes
SnapshotManagerImpl#updateSnapshotPolicy

Co-authored-by: lujie <lujie@foxmail.com>
2021-04-26 13:39:03 +05:30
davidjumani
f9ca881ebe
ui: Show domain path instead of name (#4949) 2021-04-26 13:03:27 +05:30
davidjumani
bc2a6e82a7
ui: Fix error in adduser (#4950) 2021-04-26 13:03:14 +05:30