2918 Commits

Author SHA1 Message Date
Daniel Augusto Veronezi Salvador
79d924f3ee
Insert correct template size when live migrating VM with volumes (#5758)
Co-authored-by: GutoVeronezi <daniel@scclouds.com.br>
2021-12-16 20:21:38 +05:30
davidjumani
dfd75d7bc0
api: Fix wrong logger class in *Cmd.java (#5740)
This PR changes the incorrect class name used in the logger in ListHypervisorsCmd
2021-12-02 15:16:28 +05:30
Harikrishna
4beca925d7
Fix NPE on scale VM operation after the corresponding template is deleted (#5736) 2021-12-01 17:53:09 +01:00
Wei Zhou
965316b842
server bug fix: remove network details when network is removed (#5675) 2021-11-25 21:15:51 +01:00
Wei Zhou
2b54b587fc
engine/schema: fix findActiveAccountById in AccountDaoImpl.java (#5704) 2021-11-25 12:20:48 +01:00
Wei Zhou
c95f8e263a
server: set network rate for additional public IPs (#5670)
This PR fixes #5669
2021-11-18 13:45:37 +05:30
nicolas
bdab51424a
New upgrade schema path and workaround for system VM template auto registration 2021-11-10 12:56:52 -03:00
nicolas
462e0511f4
Fix version and add schema upgrade path 2021-11-10 11:49:02 -03:00
nicolas
93c3c3b9ac
Updating pom.xml version numbers for release 4.16.1.0-SNAPSHOT
Signed-off-by: nicolas <nicovazquez90@gmail.com>
2021-11-09 22:50:22 -03:00
nicolas
44c08b5acc
Updating pom.xml version numbers for release 4.16.0.0
Signed-off-by: nicolas <nicovazquez90@gmail.com>
2021-11-04 14:14:57 -03:00
Nicolas Vazquez
261fe326ff
Revert "parallel nic adding (#5541)" (#5665)
This reverts commit 3574d8d20be01b90ca09e58ab4b492604c1a8d1f.
2021-11-04 13:29:59 -03:00
Abhishek Kumar
0ad742405c
api,server,engine/schema: admin listvm api clusterid (#5659)
* api,server,engine/schema: admin listvm api clusterid

Add clusterid parameter in listVirtualMachines API for admin

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

* import order

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

* set clusterid only for ListVMsCmdByAdmin

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-11-04 08:47:42 +05:30
Wei Zhou
1928723054
engine/schema: fix build error in #5642 (#5657) 2021-11-02 14:59:41 +01:00
Abhishek Kumar
d717d8a4cd
upgrade/systemvm: add template zone entries (#5642)
* upgrade/systemvm: add template_zone_ref entries

Fixes #5641

When registering a system VM template during an upgrade, entries in cloud.template_zone_ref must be created for the new template.
For a cross-zones template, entry for each zone must be added.

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

* fix for template-zone entry create

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

* change

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-11-02 17:19:04 +05:30
sureshanaparti
0a88e710b2
Check the pool used space from the bytes used in the storage pool stats collector, for non-default primary storage pools that cannot provide stats. (#5586)
* Check the pool used space from the bytes used in the storage pool stats collector, for  non-default primary storage pools that cannot provide stats.
Also, Update the used bytes from the pool stats answer for non-default primary storage pools if the pool can provide stats.

* Update server/src/main/java/com/cloud/storage/StorageManagerImpl.java

Co-authored-by: Daniel Augusto Veronezi Salvador <38945620+GutoVeronezi@users.noreply.github.com>

* space fix

Co-authored-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Co-authored-by: Daniel Augusto Veronezi Salvador <38945620+GutoVeronezi@users.noreply.github.com>
2021-10-25 08:23:07 -03:00
Pearl Dsilva
f2ca11fc68
Fix systemVM template name in metadata file (#5598) 2021-10-21 13:44:23 -03:00
Wei Zhou
f29aef8b70
VPC: support LB in multiple vpc tiers if LB provider is VpcVirtualRouter (#5580)
* VPC: support LB in multiple vpc tiers if LB provider is VpcVirtualRouter

* server: fix unit test CreateNetworkOfferingTest failures

[ERROR] Tests run: 10, Failures: 0, Errors: 10, Skipped: 0, Time elapsed: 13.902 s <<< FAILURE! - in org.apache.cloudstack.networkoffering.CreateNetworkOfferingTest
[ERROR] createIsolatedNtwkOffWithVlan(org.apache.cloudstack.networkoffering.CreateNetworkOfferingTest)  Time elapsed: 0.662 s  <<< ERROR!
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loadBalancerDaoImpl': Invocation of init method failed; nested exception is java.lang.NullPointerException
	at org.apache.cloudstack.networkoffering.CreateNetworkOfferingTest.setUp(CreateNetworkOfferingTest.java:110)
Caused by: java.lang.NullPointerException
	at org.apache.cloudstack.networkoffering.CreateNetworkOfferingTest.setUp(CreateNetworkOfferingTest.java:110)

* update #5580: use java.util.Optional

* update #5580: create method listByNetworkIdOrVpcIdAndScheme
2021-10-17 06:55:24 +05:30
Nicolas Vazquez
a5372a98dc
Fix storage cleanup corner case preventing VM deletion (#5575)
* Fix storage cleanup corner case

* Improve deletion

* Refactor
2021-10-16 00:09:54 -03:00
Rohit Yadav
ad8f3750c9
engine/schema: add unique constraint for sshkeys UUID column (#5565)
This adds unique constraints much like other tables, instead of using
query that maybe incompatible with older 5.x mysql servers.

Fixes #5564

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2021-10-12 10:08:30 -03:00
Pearl Dsilva
79e6fe47c8
Fix warning caused due to duplicate declaration of plugin - pom.xml (#5568) 2021-10-12 10:10:53 +05:30
Gabriel Beims Bräscher
404e264caf
CloudStack fails to migrate VM with volume when there are datadisks attatched (#5410)
* Check if should map volume in createStoragePoolMappingsForVolumes

* Invert conditional at internalCanHandle
2021-10-08 11:50:37 +05:30
davidjumani
6ac834a358
Adding AutoScaling for cks + CKS CoreOS EOL update + systemvmtemplate improvements (#4329)
Adding AutoScaling support for cks
Kubernetes PR : kubernetes/autoscaler#3629
Also replaces CoreOS with Debian
Fixes #4198

Co-authored-by: Pearl Dsilva <pearl1594@gmail.com>
Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com>
Co-authored-by: Wei Zhou <w.zhou@global.leaseweb.com>
Co-authored-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2021-10-06 21:17:41 +05:30
Harikrishna
cd4e7e031a
Fix resize volume and migrate volume to update volume path if DRS is applied on volume in datastore cluster (#5539)
* Fix resize volume and migrate volume to update volume path if DRS is applied on volume in datastore cluster

* Change in constructors

* Naming changes

* Remove commented code

* Refactor code for more readability

* Addressed review comments on code refactor
2021-10-04 20:58:25 -03:00
Abhishek Kumar
6e216dd0d1
vmware, network: add maclearning option (#5471)
* vmware, network: add maclearning option

Adds option for specifying MAC Learning property for network offering (useful for VMware Distributed Virtual Portgroup). Added global config - network.mac.learning for the default value.
MAC Learning is supported for DV portgroups for VMware Distributed vSwitches v6.6.0+ and vSphere 6.7+

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

* fix warning msg

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-10-04 20:00:45 -03:00
dahn
3574d8d20b
parallel nic adding (#5541)
* trace nics additions

* work queue patch for network to add

* add secondary key to job

* logging improvements and naming of field(s)

* several naming corrections

* extra check if net already exists for vm

* placeholder job with secondary object

* constraint on entering the same job multiple times

* error handling/warning message

* review comments applied

Co-authored-by: Daan Hoogland <dahn@onecht.net>
Co-authored-by: Wei Zhou <wei.zhou@shapeblue.com>
2021-10-04 12:21:21 -03:00
Wei Zhou
669ab73efe
server: check service offering (storage) tags when reallocate a ROOT disk (#5501)
* server: check service offering (storage) tags when reallocate a ROOT disk

* server: resize volumes in Allocated state
2021-10-03 19:45:59 -03:00
Abhishek Kumar
4a42e7ef9e
vmware, ui: update portgroup on network update (#5470)
Enhanced update network form in the UI.
On network offering change for an isolated network,

- VMware portgroup should be updated accordingly.
- VMs on the network should be placed on the correct VMware portgroup based on the network rate, https://docs.cloudstack.apache.org/en/latest/adminguide/service_offerings.html#network-throttling.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2021-10-03 14:41:42 +05:30
SadiJr
965a47fdfd
Create UpdateBackupOffering API (#5511)
* Create UpdateBackupOffering API

* Address reviews

* Address reviews

* Address reviews

Co-authored-by: SadiJr <sadi@scclouds.com.br>
2021-10-01 08:30:25 -03:00
Wei Zhou
ea643a64e5
server: cannot deploy/start vm if service offering has multiple tags (#5521) 2021-09-29 14:59:48 +05:30
Rakesh
dcc02e0fbb
Enable account settings to be visible under domain settings (#4215)
* Enable account settings to be visible under domain settings

All the account settings can't be configured under domain
level settings right now.
By default, if account setting is not configured then
its value will be taken from global setting.
Add a global setting "enable.account.settings.for.domain"
so that if its enabled then all the account level settings
will be visible under domain levelsettings also.
If account level setting is configured then that value will
be considered else it will take domain scope value. If
domain scope value is not configured then it will pick
it up from global setting.

If domain level setting is not configured then by default
the value will be taken from global setting
Add another global setting "enable.domain.settings.for.child.domain"
so that when its true, if a value for domain setting is not
configured then its parent domain value is considered until
it reaches ROOT domain. If no value is configured till ROOT
domain then global setting value will be taken.

Also display all the settings configured under the domain level
in list domains api response

* rename variables

Co-authored-by: Rakesh Venkatesh <rakeshv@apache.org>
2021-09-29 10:29:20 +02:00
Pearl Dsilva
74bb80687d
resource limit: Fix resource limit check on VM start (#5428)
* resource limit: Fix resource limit check on VM start

* add check to validate if cpu/memory are within limits for custom offering + exception handling

* unit tests

Co-authored-by: utchoang <hoangnm@unitech.vn>
2021-09-24 09:51:16 +05:30
sureshanaparti
34bd92259a
New API endpoint to update pod management network IP range (#5458)
* Add UpdatePodManagementNetwork api endpoint

* Checkstyle changes and added a few methods

* Minor Checkstyle change

* Refactor UpdatePodManagementNetworkIpRangeCmd.java

* Added missing parameters

* Cleanup

* Addressed the review comments

Co-authored-by: kioie <kioieddy@google.com>
Co-authored-by: kioie <kioi@outlook.com>
2021-09-20 18:19:05 -03:00
Pearl Dsilva
93150f465b
api: Fix list templates when no secondary stores present (#5468) 2021-09-20 14:07:47 -03:00
dahn
22a0c0a46c
change logging during upgrade (#5474)
* reduce ERROR logging on ignored exception

* string concat formatting

Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com>

Co-authored-by: Daan Hoogland <dahn@onecht.net>
Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com>
2021-09-20 13:00:06 -03:00
Wei Zhou
747608f75f
Add New API endpoint: UpdateVlanIpRange (#5411)
* Added Logic to update the user_ip_address table

* Edited ConfigurationManagerImpl

* Refactor UpdateVlanIpRangeCmd location

* Checkstyle corrections

* Mock updateVlanAndPublicIpRange

* Changes:
- UpdateVlanIpRangeCmd - changed since to 4.15.0
- ConfigurationService - Updated Javadoc
- ConfigurationManager - Updated Javadoc
- Added Unit tests
- Added license
- Update server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
- fix some bugs in #5411 and add support for ipv6 and forsystemvms
- fix #5411: disallow forsystemvms if ip range is dedicated
- update #5411: ui changes
- update #5411: support gateway/netmask change
- update #5411: change to sync call and fix bugs

Co-authored-by: kioie <kioieddy@google.com>
Co-authored-by: kioie <kioi@outlook.com>
Co-authored-by: dahn <daan.hoogland@gmail.com>
2021-09-20 10:56:29 +05:30
Nicolas Vazquez
8228ecee43
[Vmware] Add missing condition to cleanup nics if there are commands to send (#5449)
* [Vmware] Add missing condition to cleanup nics if there are commands to send
2021-09-17 21:54:52 +05:30
Nicolas Vazquez
3ca3843b02
[Vmware] Fix for ovf templates with prefix (#5448)
* [Vmware] Fix for ovf templates with prefix

* Support multiple hardware versions
2021-09-16 16:16:41 -03:00
Peinthor Rene
66c39c1589
storage: Linstor volume plugin (#4994)
This adds a volume(primary) storage plugin for the Linstor SDS.
Currently it can create/delete/migrate volumes, snapshots should be possible,
but currently don't work for RAW volume types in cloudstack.

* plugin-storage-volume-linstor: notify libvirt guests about the resize
2021-09-16 10:50:58 +05:30
Wei Zhou
95ef292860
kvm: honor migrate.wait and abort vm migration job (#5388)
* kvm: honor migrate.wait and abort vm migration job

* kvm: propogate migratewait to all cloudstack agents on kvm hosts

* update #5388

* update #5388: display error msg
2021-09-15 12:38:16 -03:00
Pearl Dsilva
3f827ef22b
UI: Support to upload resource icons (#5157)
* Resource Icon support - backend

* Add API support for resourceicon

* update reponse params + ui support

* Add exclusive list api for icons and UI changes

* refactor upload view

* UI changes to support resource icon wherever necessary

* convert api to POST + refactor icon view

* Add response name to list API + cosmetic changes in UI

* Added support for the following:
resource icon support for vpcs, networks, domains, and projects
add icons to list view if reosurces support icons to be added
support for showing project icons in the project switching drop-down menu

* List resourceicon cmds to be allowed for user role too
Users to inherit account icon if present (in listUsers response)
Move common code to plugin.js
Add icon to project list view - while switching between projects - Dashboard page
Show icons against zones - Capacity Dashboard view
Show user / account icon at the login button if present

* cosmetic changes

* optimize ui code

* fix reload issue for domain view

* add access check for delete operation

* ui-related changes to show iso icons

* iso image in uservm response

* add icons to custom form's list resources

* some more custom forms aligned to show icon for resources

* conmitic changes + add listing of icons to listdomainchildren cmd

* Add backend/server-side validation for base64 string passed for image

* change preview border

* preselect zone if there's only one

* add default icon

* show icon for network list in deploy vm view

* add custom icons if any to the import-export VM view

* preselect zone persistence on clearing cache

* prevent root vol from inheriting template/iso icon

* show tempalte icon in the info card details

* fix icon not being show on hard-refresh / initial traversal

* fx success message
2021-09-15 00:50:42 -03:00
Rakesh
3c2360c9d2
VM has wrong network statistics with multiple nics in shared networks (#4741)
If vm has multiple nics belonging to different shared networks then
wrong statistics will be collected since network id is not considred
as primary key. Make the change so that primary key contains network
id so that traffic belonging to that corresponding network is shown

If network id is not added to primary key then all the traffic of all
shared networks will show up in one nic.

Co-authored-by: Rakesh Venkatesh <rakeshv@apache.org>
2021-09-14 23:54:34 -03:00
Junxuan Wu
f6073052aa
Fix potential NullPointerException in findStoragePool (VolumeOrchestrator) (#5358)
* fix null pointer exception when vm is null

* add null checker to getPreferredStoragePool method

Co-authored-by: junxuan <atrocitythemetms@gmail.com>
2021-09-08 23:43:33 +05:30
Daniel Augusto Veronezi Salvador
8ffba83214
Keep volume policies after migrating it to another primary storage (#5067)
* Add commons-lang3 to Utils

* Create an util to provide methods that ReflectionToStringBuilder does not have yet

* Create method to retrieve map of tags from resource

* Enable tests on volume components and remove useless tests

* Refactor VolumeObject and add unit tests

* Extract createPolicy in several methods

* Create method to copy policies between volumes and add unit tests

* Copy policies to new volume before removing old volume on volume migration

* Extract "destroySourceVolumeAfterMigration" to a method and test it

* Remove javadoc @param with no sensible information

* Rename method name to a generic name

Co-authored-by: Daniel Augusto Veronezi Salvador <daniel@scclouds.com.br>
2021-09-08 09:13:41 -03:00
Nicolas Vazquez
413d10dd81
server: Extend the Annotations framework (#5103)
* Extend addAnnotation and listAnnotations APIs

* Allow users to add, list and remove comments

* Add adminsonly UI and allow admins or owners to remove comments

* New annotations tab

* In progress: new comments section

* Address review comments

* Fix

* Fix annotationfilter and comments section

* Add keyword and delete action

* Fix and rename annotations tab

* Update annotation visibility API and update comments table accordingly

* Allow users seeing all the comments for their owned resources

* Extend comments for volumes and snapshots

* Extend comments to multiple entities

* Add uuid to ssh keypairs

* SSH keypair UI refactor

* Extend comments to the infrastructure entities

* Add missing entities

* Fix upgrade version for ssh keypairs

* Fix typo on DB upgrade schema

* Fix annotations table columns when there is no data

* Extend the list view of items showing they if they have comments

* Remove extra test

* Add annotation permissions

* Address review comments

* Extend marvin tests for annotations

* updating ui stuff

* addition to toggle visibility

* Fix pagination on comments section

* Extend to kubernetes clusters

* Fixes after last review

* Change default value for adminsonly column

* Remove the required field for the annotationfilter parameter

* Small fixes on visibility and other fixes

* Cleanup to reduce files changed

* Rollback extra line

* Address review comments

* Fix cleanup error on smoke test

* Fix sending incorrect parameter to checkPermissions method

* Add check domain access for the calling account for domain networks

* Fix only display annotations icon if there are comments the user can see

* Simply change the Save button label to Submit

* Change order of the Tools menu to provent users getting 404 error on clicking the text instead of expanding

* Remove comments when removing entities

* Address review comments on marvin tests

* Allow users to list annotations for an entity ID

* Allow users to see all comments for allowed entities

* Fix search filters

* Remove username from search filter

* Add pagination to the annotations tab

* Display username for user comments

* Fix add permissions for domain and resource admins

* Fix for domain admins

* Trivial but important UI fix

* Replace pagination for annotations tab

* Add confirmation for delete comment

* Lint warnings

* Fix reduced list as domain admin

* Fix display remove comment button for non admins

* Improve display remove action button

* Remove unused parameter on groupShow

* Include a clock icon to the all comments filter except for root admin

* Move cleanup SQL to the correct file after rebasing main

Co-authored-by: davidjumani <dj.davidjumani1994@gmail.com>
2021-09-08 10:14:06 +05:30
Wei Zhou
a755ecfce8
Migrate vm across clusters (#4534)
* server: Optional destination host when migrate a vm

* #4378: migrate systemvms/routers with optional host

* Migrate vms across clusters

After enabling maintenance mode on host, if no suitable hosts
are found in the same cluster then search for hosts in
different clusters having the same hypervisor type

set global setting migrate.vm.across.clusters to true

* search all clusters in zone when migrate vm across clusters if applicable

* Honor migrate.vm.across.clusters when migrate vm without destination

* Check MIGRATE_VM_ACROSS_CLUSTERS in zone setting

* #4534 Fix Vms are migrated to same clusters in CloudStack caused by dedicated resources.

* #4534 extract some codes to methods

* fix #4534: an error in 'git merge'

* fix #4534: remove useless methods in FirstFitPlanner.java

* fix #4534: vms are stopped in host maintenance

* fix #4534: across-cluster migration of vms with cluster-scoped pools is supported by vmware vmotion

* fix #4534: migrate systemvms is only possible across clusters in same pod to avoid potential network errors.

* fix #4534: code optimization

Co-authored-by: Rakesh Venkatesh <r.venkatesh@global.leaseweb.com>
Co-authored-by: Sina Kashipazha <s.kashipazha@global.leaseweb.com>
Co-authored-by: Wei Zhou <weizhou@apache.org>
Co-authored-by: Sina Kashipazha <soreana@users.noreply.github.com>
2021-09-07 21:50:29 -03:00
davidjumani
a000361238
Merge remote-tracking branch 'apache/4.15' into main 2021-09-03 16:55:10 +05:30
Pearl Dsilva
b2fd1f6d32
server: Allow public templates with no url to be migrated (#5404)
This PR allows migration of public templates that are created from snapshots / volumes. Data migration across secondary stores initially excluded all public templates on the pretext that public templates are automatically synced when a new image store is added; however, this assumption isn't true for templates marked as "public" when created from snapshots / volumes. Such templates can be identified if their url is null
2021-09-03 16:25:11 +05:30
davidjumani
0bc6e05bc4
ui: Honour default.ui.page.size (#5394)
* ui: Honour default.ui.page.size

* Moving db upgrade path
2021-09-03 16:23:26 +05:30
nicolas
13d8489478
Merge branch '4.15' into main 2021-09-03 00:06:08 -03:00
davidjumani
a5e7e08a6b
Filter disk / service offerings by domain at DB level (#5307)
* Filter disk / service offerings by domain at DB level

* Search for tags in the db

* Update search to include host tags

* Differenciate between tags

* Refactor
2021-09-02 23:56:18 -03:00