8672 Commits

Author SHA1 Message Date
Abhishek Kumar
9192027973 ui: use *metrics apis only when metrics enabled for list
In UI for the list views it is regular API view by default and *Metrics
API response may not be needed. *Metrics APIs will take more time to
return response so this PR tries to improve the behaviour and enables
calling regular API without metrics when metrics toggle is not enabled.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-10-18 12:51:29 +05:30
Abhishek Kumar
47333a7077 Merge remote-tracking branch 'apple/apple-base418' into scalability-improvements 2024-10-11 13:37:12 +05:30
Wei Zhou
85076cb0f8
Resize volume: add pool capacity disablethreshold for resize and allow volume auto migration (#492)
* server: add global settings for volume resize

* resizeVolume: support automigrate

* server: fix build errors as it is backported from 4.20/main

* Address Suresh's comments

* Update api/src/main/java/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java

Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>

* Apple issue-299: address Suresh's comments

* Update api/src/main/java/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java

* UI: add autoMigrate to resizeVolume

---------

Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
2024-10-09 16:36:33 +05:30
Abhishek Kumar
22227b0d01 ui: refactor config update/reset notification
Follow up from https://github.com/apache/cloudstack/pull/9628#discussion_r1743492807

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-05 12:47:36 +05:30
Abhishek Kumar
4400e02a1b
framework/config,server: configkey caching (#472)
Added caching for ConfigKey value retrievals based on the Caffeine
in-memory caching library.
https://github.com/ben-manes/caffeine
Currently, expire time for a cache is 1 minute and each update of the
config key invalidates the cache.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2024-09-03 15:53:08 +05:30
Abhishek Kumar
5e98405b38 Merge remote-tracking branch 'apple/apple-base418' into scalability-improvements 2024-07-22 16:12:19 +05:30
Abhishek Kumar
8f88103a29
FR72 - api,server: purge expunged resources (#405)
This PR introduces the functionality of purging removed DB entries for CloudStack entities (currently only for VirtualMachine).
There would be three mechanisms for purging removed resources:
- Background task - CloudStack will run a background task which runs at a defined interval. Other parameters for this task can be controlled with new global settings.
- API - New API `purgeExpungedResources`. It will allow passing the following parameters - resourcetype, batchsize, startdate, enddate
- Config for service offering. Service offerings can be created with purgeresources parameter which would allow purging resources immediately on expunge.

Following new global settings have been added:
- `expunged.resources.purge.enabled`: Default: false. Whether to run a background task to purge the DB records of the expunged resources.
- `expunged.resources.purge.resources`: Default: (empty). A comma-separated list of resource types that will be considered by the background task to purge the DB records of the expunged resources. Currently only VirtualMachine is supported. An empty value will result in considering all resource types for purging.
- `expunged.resources.purge.interval`: Default: 86400. Interval (in seconds) for the background task to purge the DB records of the expunged resources.
- `expunged.resources.purge.delay`: Default: 300. Initial delay (in seconds) to start the background task to purge the DB records of the expunged resources task.
- `expunged.resources.purge.batch.size`: Default: 50. Batch size to be used during purging of the DB records of the expunged resources.
- `expunged.resources.purge.start.time`: Default: (empty). Start time to be used by the background task to purge the DB records of the expunged resources. Use format `yyyy-MM-dd` or `yyyy-MM-dd HH:mm:ss`.
- `expunged.resources.purge.keep.past.days`: Default: 30. The number of days in the past from the execution time of the background task to purge the DB records of the expunged resources for which the expunged resources must not be purged. To enable purging DB records of the expunged resource till the execution of the background task, set the value to zero.
- `expunged.resource.purge.job.delay`: Default: 180. Delay (in seconds) to execute the purging of the DB records of an expunged resource initiated by the configuration in the offering. Minimum value should be 180 seconds and if a lower value is set then the minimum value will be used.

Upstream PRs:
https://github.com/apache/cloudstack/pull/8999
https://github.com/apache/cloudstack-documentation/pull/397

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
2024-06-19 12:59:50 +05:30
Suresh Kumar Anaparti
04091abc0d
User data content size validation, register managed user data using POST call from UI, and related code improvements (#361)
* Validate user data with actual length, and some code improvements

* Ignore if user data is not set (don't fail)

* Validate user data after finalizing it

* Updated registerUserData API using POST call from UI, to support user data upto 1048576 bytes

* Apply suggestions from code review

* Added logs for user data

* Addressed review comments

* Check user data length with base64 encoded data, and some code improvements
2024-06-19 12:54:32 +05:30
Wei Zhou
e065c93c3f
Apple FR76: Implicit host tags (#427)
* Merge two HostTagVO and HostTagDaoImpl

* Apple FR76: dynamic host tags

* Revert "Apple FR76: dynamic host tags"

This reverts commit 01b93a873f167018c4fafd0744c0de07ae4de4ed.

* Apple FR76: Implicit host tags

* Apple FR76: address Abhishek's comments

* Apple FR76: move updateImplicitTags

* Apple FR76: add since to other two responses

* Update 8929: add unit test in LibvirtComputingResourceTest

* Update variable names

* Update FR76: add explicithosttags in response

* Update FR76 UI: Update explicit host tags

* Update 8929: remove host tags and change labels on UI

* Update: ui polish for host tags

* fix since in responses

* Update 8929: fix UI error if no host tags
2024-05-30 17:20:37 +05:30
Rohit Yadav
72b841567e ui: add disconnected hosts filter and improve admin dashboard
Adds disconnected as a host filter in the UI
Improve capacity dashboard for admins for large env.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2024-05-22 20:22:38 +05:30
Vishesh
7fae1fc747
Fix restore VM with allocated root disk (#441)
* Fix restore VM with allocated root disk

* Add e2e test for restore vm

* Add more checks for e2e test
2024-04-29 12:18:55 +05:30
Vishesh
0501678478
Allow overriding root diskoffering id & size, and expunge old root disk while restoring VM (#401)
* Allow overriding root diskoffering id & size while restoring VM

* UI changes

* Allow expunging of old disk while restoring a VM

* Apply suggestions from code review

Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>

* resolve comments

* Fixup

* Rename some variables

* Resolve comments

* Address comments

* Duplicate volume's details while duplicating volume

* Allow setting IOPS for the new volume

* minor cleanup

* fixup

* Add checks for template size

* Replace strings for IOPS with constants

* Fix saveVolumeDetails method

* Fixup

* Fixup UI styling

---------

Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
2024-04-12 17:47:16 +05:30
Wei Zhou
2b93886934 server: fix security issues caused by extraconfig on KVM
- Move allow.additional.vm.configuration.list.kvm from Global to Account setting
- Disallow VM details start with "extraconfig" when deploy VMs
- Skip changes on VM details start with "extraconfig" when update VM settings
- Allow only extraconfig for DPDK in service offering details
- Check if extraconfig values in vm details are supported when start VMs
- Check if extraconfig values in service offering details are supported when start VMs
- Disallow add/edit/update VM setting for extraconfig on UI

(cherry picked from commit e6e4fe16fb1ee428c3664b6b57384514e5a9252e)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2024-03-31 22:02:26 +05:30
Abhishek Kumar
6a9cdedda4
api,server,ui: tagged resource limits (#327)
Introduces the concept of tagged resource limits. Limits can be enforced on accounts and domains for the deployment of entities for a tagged resource. Current tagged resource limits can be used for the following resource types,

Host limits

    user_vm
    cpu
    memory

Storage limits

    volume
    primary_storage

Following global settings can used to specify tags for which limit needs to be enforced,

    Host: resource.limit.host.tags
    Storage: resource.limit.storage.tags

Option for specifying tagged resource limits and viewing tagged resource usage are made available in the UI.

Enhances use of templatetag for VM deployment and template creation

Adds option to list disk offering with suitability flag for a virtualmachine. A new parameter named virtualmachineid has been added to the listDiskOfferings API which when passed returns suitableforvirtualmachine param in the reponse.
2024-02-07 17:35:15 +05:30
Wei Zhou
c32d2fa990 CKS: fix wrong format of cluster size on UI (#8182)
(cherry picked from commit e6f048bc2e830f43ef925dcec0374babfa410afd)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-11-07 21:00:23 +05:30
Rohit Yadav
7260204447 ui: Admin, account and project dashboard improvements
This backports only the dashboard changes from
https://github.com/apache/cloudstack/pull/7956 and
5d9ae31f1b0dcf74dae722c2f22f895b85083002

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 3376f9488649db7b09e8d77878c1d71bf99810c2)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-11-07 20:59:10 +05:30
Abhishek Kumar
42131fdd16 ui: fix bulk delete template from zones (#8118)
Fixes #8083

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
(cherry picked from commit e199678101e0d8b55ae4e2f5266aaf9ddb403fbe)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-10-26 12:21:07 +05:30
Abhishek Kumar
0c96202c7d ui: correctly show volume physical size (#8119)
Fixes #8073

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
(cherry picked from commit f62b63403341d109836df28b11d86138669dfdff)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-10-26 12:20:57 +05:30
Harikrishna
84fee7b896 ui: Fix non admin logouts (#8065)
If a user (non-admin) logs out from a session, then login page is not loading completely. Few starter APIs like listIds are failing and showing unauthorised access notification in Login Page. Also if SAML is enabled, it is not getting enabled since the corresponding API are failed. User needs to refresh the browser to get it back.

(cherry picked from commit 8b281284a26d4d21cae031e7f8dcb789383785f3)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-10-11 21:03:09 +05:30
Nicolas Vazquez
c6c32776b5 UI: Fix user role login due to missing API access on custom hypervisor name (#7939)
* UI: Fix user role login due to missing API access on custom hypervisor name

* Refactor to include the custom HW display name as part of the response of listCapabilities API

* Add since parameter

(cherry picked from commit 940733cedfb1b46930d280c76a5f436d9c01f553)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-09-27 16:19:51 +05:30
Nicolas Vazquez
4dfa38aae9 plugins: Add Custom hypervisor minimal changes (#7692)
Design document: https://cwiki.apache.org/confluence/display/CLOUDSTACK/%5BDRAFT%5D+Minimal+changes+to+allow+new+dynamic+hypervisor+type%3A+Custom+Hypervisor

This PR introduces the minimal changes to add a new hypervisor type (internally named Custom in the codebase, and configurable display name), allowing to write an external hypervisor plugin as a Custom Hypervisor to CloudStack

The custom hypervisor name is set by the setting: 'hypervisor.custom.display.name'. The new hypervisor type does not affect the behaviour of any CloudStack operation, it simply introduces a new hypervisor type into the system.

CloudStack does not have any means to dynamically add new hypervisor types. The hypervisor types are internally preset by an enum defined within the CloudStack codebase and unless a new version supports a new hypervisor it is not possible to add a host of a hypervisor that is not in part of the enum. It is possible to implement minimal changes in CloudStack to support a new hypervisor plugin that may be developed privately

This PR is an initial work on allowing new dynamic hypervisor types (adds a new element to the HypervisorType enum, but allows variable display name for the hypervisor)

Replace the HypervisorType from a fixed enum to an extensible registry mechanism, registered from the hypervisor plugin

- The new hypervisor type is internally named 'Custom' to the CloudStack services (management server and agent services, database records).
- A new global setting ‘hypervisor.custom.display.name’ allows administrators to set the display name of the hypervisor type. The display name will be shown in the CloudStack UI and API.
   - In case the ‘hypervisor.list’ setting contains the display name of the new hypervisor type, the setting value is automatically updated after the ‘hypervisor.custom.display.name’ setting is updated.
- The new Custom hypervisor type supports:
   - Direct downloads (the ability to download templates into primary storage from the hypervisor hosts without using secondary storage)
   - Local storage (use hypervisor hosts local storage as primary storage)
   - Template format: RAW format (the templates to be registered on the new hypervisor type must be in RAW format)
- The UI is also extended to display the new hypervisor type and the supported features listed above.
- The above are the minimal changes for CloudStack to support the new hypervisor type, which can be tested by integrating the plugin codebase with this feature.

This PR allows the cloud administrators to test custom hypervisor plugins implementations in CloudStack and easily integrate it into CloudStack as a new hypervisor type ("Custom"), reducing the implementation to only the hypervisor supported specific storage/networking and the hypervisor resource to communicate with the management server.

- CloudStack admin should be able to create a zone for the new custom hypervisor and add clusters, hosts into the zone with normal operations
- CloudStack users should be able to execute normal VMs/volumes/network/storage operations on VMs/volumes running on the custom hypervisor hosts

(cherry picked from commit 8b5ba13b817e7d53beb0e0012c27d065e96a708c)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-09-27 16:19:42 +05:30
Nicolas Vazquez
20952b4842 Auto Enable/Disable KVM hosts (#7170)
* Auto Enable Disable KVM hosts

* Improve health check result

* Fix corner cases

* Script path refactor

* Fix sonar cloud reports

* Fix last code smells

* Add marvin tests

* Fix new line on agent.properties to prevent host add failures

* Send alert on auto-enable-disable and add annotations when the setting is enabled

* Address reviews

* Add a reason for enabling or disabling a host when the automatic feature is enabled

* Fix comment on the marvin test description

* Fix for disabling the feature if the admin has manually updated the host resource state before any health check result

(cherry picked from commit be66eb2a35bd6a5aae74f97a9140a9ec01f2a838)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-09-15 13:15:59 +05:30
Rohit Yadav
0bb05f7871
ui: don't skip if dataview has multiple items in response (#7947)
This would fix the case of multiple items return in API response for a
resource such as a template or ISO in case of multi-zone env.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-09-06 16:41:41 +02:00
Fabricio Duarte
57d4d0d94a
UI: Infer template settings in the deploy VM wizard (#7867) 2023-08-25 16:36:35 +02:00
Rohit Yadav
93bd5b7a69
ui: speed up compute instance listing (#7911)
* ui: speed up compute instance listing

The default listVirtualMachinesMetrics APIs assumings details=all which
isn't really used in the list view. By changing this to a subset of
details, we can see gains upto 10x in listing speed in the UI. When
moving to the resource/detail view of the UI, don't pass state or
details so `all` the details of the instance are returned.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

* Update AutogenView.vue

---------

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-08-25 13:57:44 +02:00
Rohit Yadav
6f7725ab35
ui: Fix refresh and re-route behaviour (#7846)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Co-authored-by: dahn <daan.hoogland@gmail.com>
2023-08-25 13:45:35 +02:00
Wei Zhou
8dc5fdd067
server: fix cannot get systemvm ips in dedicated ranges (#7144)
This fixes #6698
2023-08-25 11:36:39 +02:00
Abhishek Kumar
8ad1009ad2
ui: fix notification list reordering intermittently (#7609)
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2023-08-24 11:29:25 +02:00
Charles Queiroz
2e1c2821a8
UI: Add central project store and watch functionality (#7900)
Added a new getter 'allProjects' and mutation 'RELOAD_ALL_PROJECTS' to centralize the tracking of available projects in the state.
This eliminates direct manipulation of the Project list in separate components and improves data consistency across the application.
A watcher in ProjectMenu.vue has been implemented to handle changes to the 'allProjects' getter.
The 'RELOAD_ALL_PROJECTS' mutation was also added where necessary to ensure projects list is updated in the state whenever changes occur.
2023-08-24 10:13:47 +02:00
Rohit Yadav
b37834fe75
ui: bump UI pkg version to match CloudStacks (#7894)
This uses the version in UI's package.json same as CloudStack's. The idea
is that static assets aren't cached per discussion on
https://github.com/apache/cloudstack/issues/7546

Fixes #7546

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-08-23 13:07:07 +02:00
Rohit Yadav
d87f39ad27
ui: make it clear that deletion of a volume will not delete any snapshots (#7897)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-08-23 16:07:17 +05:30
Wei Zhou
8cb30551d5
UI: update ip ranges of shared networks (#7896)
* UI: update ip ranges of shared networks

* UI: remove ip6gateway and ip6cidr from GuestIpRanges.vue
2023-08-23 16:06:16 +05:30
Rohit Yadav
0e9a19f24d
ui: Fix project theme on reload or refresh (#7893)
* css fixes from main

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

* component: when in project, toggle the theme also

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

---------

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-08-22 14:20:45 +02:00
Wei Zhou
5097d2aa8b
ui: fix creating zone with vxlan if Guest physical network is not the last (#7801)
This fixes #7790
2023-08-22 14:45:30 +05:30
Wei Zhou
78bdde9e98
AutoScaling: support Managed User Data (#7769) 2023-08-22 11:07:16 +02:00
Nicolas Vazquez
405ef82aef
UI: Fix hide delete button for templates that are in Installing template state (#7882)
This PR hides the Delete Template button when a template is installing

Fixes: #7865
2023-08-22 14:32:54 +05:30
Nicolas Vazquez
ddc2a362a8
UI: Add missing tooltips to Register/Upload Templates/ISOs views (#7879) 2023-08-21 11:13:25 +02:00
dahn
19aacad46b
UI: Show iso urls (#7869)
* add url to details

* some cleanup
2023-08-15 13:51:53 +02:00
Rohit Yadav
feb9509547
ui: assorted improvements (#7833)
This PR aims to polish the UI with following tweaks and changes:

- Increase resource and os-logo icons both in list view, user-menu bar and VM deployment form
- Fix css issues in VM deployment form when resource icons are on some of the templates/isos but not all
- Replace edit icon in the resource icon editting button on the infocard, in resource view
- Fix css marging/padding issue for nav bar and left-branding/logo
- Introduce a new Limits option in the user menu, to allow users to see their own limits when they log in
- Rename resource tab to limits tab for accounts, project and domains
- Introduce a new copy-label component, that can be clicked to copy strings; use in info-card and list view for entites such as IP addresses and UUIDs
- Add router-link to /zones/ in case of user-accounts (when /zone isn't routable in the UI)
- Show better list of nics and ssh keys pairs in infocard for VM resource view
- Standardise most resources to show state/status columns right after resource name (wherever applicable)
- Remove displayname column in VM list view, add cpu number and memory by default
- Add k8s version column in k8s list view
- Add size and phy size columns in case of template and ISOs list view, only for root/domain admins
- Add phy network router-link in case of guest VLAN list view; rearrange columns list for consistency
- Add snapshot phy size column in the snapshot list view; and router-link for volume in the snapshot list view; and missing/useful details in the volume snapshot details view
- Add a create and add data disk feature in Instances tab, just like we've add nic feature in the same

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2023-08-11 14:00:04 +05:30
dahn
c86684fbdd
UI: allow new keys for VM details (#7793) 2023-08-03 04:58:22 +02:00
Wei Zhou
87f218c68c
UI: decode userdata in EditVM dialog (#7796) 2023-08-01 09:10:26 +02:00
dahn
fd13184dda
UI unit test: fix expected values (#7792) 2023-07-31 12:46:22 +02:00
dahn
a2eb10304f
UI: Filter templates by zone and hypervisor type when reinstall a VM (#7739) 2023-07-31 07:30:24 +02:00
dahn
01e5c25523
search in (too) large result sets (#7766)
Co-authored-by: Pearl Dsilva <pearl1594@gmail.com>
2023-07-27 15:03:12 +02:00
Wei Zhou
cdf01879ec
ui: fix 404 error when list volumes of system vms (#7772)
This PR fixes #7662
2023-07-26 15:59:45 +05:30
Wei Zhou
4000fd09f1
UI: fix userdataid or userdata content is passed when userdata append/override is unchecked (#7758) 2023-07-25 10:01:53 +02:00
Wei Zhou
6dd2ce86b5
UI: add step to create bearer token for kubernetes dashboard (#7764)
Since Kubernetes v1.24.0, there is no auto-generation of secret-based service account token due to security reason. see https://github.com/kubernetes/kubernetes/pull/108309

To access kubernetes dashboard, users need to create a service account and an optional long-lived Bearer Token for the service account.
2023-07-25 03:32:58 +02:00
Wei Zhou
90baae3dcd
utils: fix RBD URI if credentials contains slash (#7708) 2023-07-24 08:29:01 +02:00
Abhishek Kumar
f057f4b412
ui: fix userdata base64 encoding (#7749)
* ui: fix userdata abse64 encoding

Fixes #7748

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2023-07-21 12:38:08 +02:00
Ben
981d74825a
Add L2 networks to Zones with SG (#7719) 2023-07-11 09:11:23 +02:00