Skip to content

Log previous and new value of configuration when reset/update API is called - #10769

Merged
DaanHoogland merged 4 commits into
apache:mainfrom
shapeblue:logConfigUpdate
Jun 4, 2025
Merged

Log previous and new value of configuration when reset/update API is called#10769
DaanHoogland merged 4 commits into
apache:mainfrom
shapeblue:logConfigUpdate

Conversation

@sudo87

@sudo87sudo87 commented Apr 24, 2025

Copy link
Copy Markdown
Contributor

Description

This PR handles 5th scenario mentioned in #6880
During reset and update configuration, system will log existing and incoming value.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

Screenshot from 2025-04-22 18-09-00

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@sudo87sudo87 changed the title Log previous and new value of configuration before reset/updateLog previous and new value of configuration when reset/update API is calledApr 24, 2025
@codecov

codecovBot commented Apr 24, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 43.47826% with 26 lines in your changes missing coverage. Please review.

Project coverage is 16.95%. Comparing base (64828f6) to head (fd401eb).
Report is 53 commits behind head on main.

Files with missing linesPatch %Lines
.../cloud/configuration/ConfigurationManagerImpl.java43.47%22 Missing and 4 partials ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #10769 +/- ##
============================================
+ Coverage 16.40% 16.95% +0.54% - Complexity 13630 14422 +792 
============================================
Files 5705 5719 +14 Lines 503722 531340 +27618 Branches 61034 71603 +10569 ============================================
+ Hits 82647 90075 +7428 - Misses 411889 431175 +19286 - Partials 9186 10090 +904 
FlagCoverage Δ
uitests4.16% <ø> (+0.16%)⬆️
unittests17.81% <43.47%> (+0.55%)⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shwstppr

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

Comment threadserver/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java Outdated
@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13162

1. Change type for scope paramter for method updateConfiguration and validateConfigurationValue
2. Standardize scope variable to be of ConfigKey type and scopeVal as string

@DaanHooglandDaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@sudo87

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13168

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@shwstpprshwstppr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-13269)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 56812 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10769-t13269-kvm-ol8.zip
Smoke tests completed. 124 look OK, 17 have errors, 0 did not run
Only failed and skipped tests results shown below:

TestResultTime (s)Test File
test_2FA_enabledError0.03test_2fa.py
test_2FA_setupError0.03test_2fa.py
test_UpdateConfigParamWithScopeError0.06test_global_settings.py
test_UpdateConfigParamWithScopeError0.06test_global_settings.py
test_01_deploy_vm_with_extraconfig_throws_exception_kvmError0.04test_deploy_vm_extra_config_data.py
test_02_deploy_vm_with_extraconfig_kvmError0.04test_deploy_vm_extra_config_data.py
test_03_update_vm_with_extraconfig_kvmError0.05test_deploy_vm_extra_config_data.py
test_04_deploy_vm_with_extraconfig_throws_exception_vmwareError0.04test_deploy_vm_extra_config_data.py
test_05_deploy_vm_with_extraconfig_vmwareError0.03test_deploy_vm_extra_config_data.py
test_06_deploy_vm_with_extraconfig_throws_exception_xenserverError0.03test_deploy_vm_extra_config_data.py
test_07_deploy_vm_with_extraconfig_xenserverError0.03test_deploy_vm_extra_config_data.py
test_03_vpc_internallb_haproxy_stats_on_all_interfacesError2.40test_internal_lb.py
test_04_rvpc_internallb_haproxy_stats_on_all_interfacesError2.43test_internal_lb.py
test_01_disable_account_settings_for_domainError8.62test_enable_account_settings_for_domain.py
test_02_enable_account_settings_for_domainError9.35test_enable_account_settings_for_domain.py
test_03_enable_account_settings_for_domainError8.34test_enable_account_settings_for_domain.py
test_01_auto_enable_disable_kvm_hostError0.11test_host_control_state.py
test_02_disable_host_overrides_auto_enable_kvm_hostError0.10test_host_control_state.py
test_03_enable_host_does_not_override_auto_disable_kvm_hostError0.10test_host_control_state.py
ContextSuite context=TestMetrics>:setupError0.00test_metrics_api.py
test_01_non_strict_host_anti_affinityFailure146.08test_nonstrict_affinity_group.py
test_02_non_strict_host_affinityError87.28test_nonstrict_affinity_group.py
test_01_add_primary_storage_disabled_hostError40.10test_primary_storage.py
test_01_primary_storage_scope_changeError0.11test_primary_storage_scope.py
test_another_user_can_allocate_ip_after_quarantined_has_ended_networkError9.09test_quarantined_ips.py
test_another_user_can_allocate_ip_after_quarantined_has_ended_vpcError0.45test_quarantined_ips.py
test_only_owner_can_allocate_ip_in_quarantine_networkError0.52test_quarantined_ips.py
test_only_owner_can_allocate_ip_in_quarantine_vpcError0.50test_quarantined_ips.py
ContextSuite context=TestScaleVm>:teardownError0.03test_scale_vm.py
test_01_sys_vm_startFailure0.13test_secondary_storage.py
ContextSuite context=TestCpuCapServiceOfferings>:setupError0.00test_service_offerings.py
ContextSuite context=TestVmAutoScaling>:setupError0.00test_vm_autoscaling.py
test_01_deploy_vm_on_specific_hostError0.11test_vm_deployment_planner.py
test_04_deploy_vm_on_host_override_pod_and_clusterError0.15test_vm_deployment_planner.py
test_02_restore_vm_strict_tags_failureFailure54.72test_vm_strict_host_tags.py
test_02_scale_vm_strict_tags_failureFailure59.98test_vm_strict_host_tags.py
test_06_deploy_vm_on_any_host_with_strict_tags_failureFailure6.83test_vm_strict_host_tags.py

@sudo87

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@sudo87 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-13290)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 53732 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10769-t13290-kvm-ol8.zip
Smoke tests completed. 130 look OK, 11 have errors, 0 did not run
Only failed and skipped tests results shown below:

TestResultTime (s)Test File
test_2FA_enabledError0.04test_2fa.py
test_2FA_setupError0.04test_2fa.py
test_UpdateConfigParamWithScopeError0.07test_global_settings.py
test_UpdateConfigParamWithScopeError0.07test_global_settings.py
test_01_deploy_vm_with_extraconfig_throws_exception_kvmError0.03test_deploy_vm_extra_config_data.py
test_02_deploy_vm_with_extraconfig_kvmError0.03test_deploy_vm_extra_config_data.py
test_03_update_vm_with_extraconfig_kvmError0.04test_deploy_vm_extra_config_data.py
test_04_deploy_vm_with_extraconfig_throws_exception_vmwareError0.03test_deploy_vm_extra_config_data.py
test_05_deploy_vm_with_extraconfig_vmwareError0.03test_deploy_vm_extra_config_data.py
test_06_deploy_vm_with_extraconfig_throws_exception_xenserverError0.03test_deploy_vm_extra_config_data.py
test_07_deploy_vm_with_extraconfig_xenserverError0.03test_deploy_vm_extra_config_data.py
test_03_vpc_internallb_haproxy_stats_on_all_interfacesError1.44test_internal_lb.py
test_04_rvpc_internallb_haproxy_stats_on_all_interfacesError2.45test_internal_lb.py
test_01_disable_account_settings_for_domainError8.54test_enable_account_settings_for_domain.py
test_02_enable_account_settings_for_domainError8.89test_enable_account_settings_for_domain.py
test_03_enable_account_settings_for_domainError8.18test_enable_account_settings_for_domain.py
test_01_auto_enable_disable_kvm_hostError0.09test_host_control_state.py
test_02_disable_host_overrides_auto_enable_kvm_hostError0.09test_host_control_state.py
test_03_enable_host_does_not_override_auto_disable_kvm_hostError0.08test_host_control_state.py
ContextSuite context=TestMetrics>:setupError0.00test_metrics_api.py
test_another_user_can_allocate_ip_after_quarantined_has_ended_networkError8.82test_quarantined_ips.py
test_another_user_can_allocate_ip_after_quarantined_has_ended_vpcError0.46test_quarantined_ips.py
test_only_owner_can_allocate_ip_in_quarantine_networkError0.42test_quarantined_ips.py
test_only_owner_can_allocate_ip_in_quarantine_vpcError0.41test_quarantined_ips.py
ContextSuite context=TestScaleVm>:teardownError0.03test_scale_vm.py
ContextSuite context=TestVmAutoScaling>:setupError0.00test_vm_autoscaling.py
test_02_restore_vm_strict_tags_failureFailure61.87test_vm_strict_host_tags.py
test_02_scale_vm_strict_tags_failureFailure63.19test_vm_strict_host_tags.py
test_06_deploy_vm_on_any_host_with_strict_tags_failureFailure3.83test_vm_strict_host_tags.py

@shwstppr

Copy link
Copy Markdown
Contributor

@sudo87 changes seem to be causing some issues with configuration behaviour. Please check

@sudo87

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13400

@sudo87

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@sudo87 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-13326)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 55396 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10769-t13326-kvm-ol8.zip
Smoke tests completed. 140 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

TestResultTime (s)Test File
test_01_deployVMInSharedNetworkFailure60.92test_network.py
ContextSuite context=TestSharedNetworkWithConfigDrive>:teardownError62.03test_network.py

@borisstoyanovborisstoyanov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
at change:

2025-05-27 13:48:28,627 DEBUG [c.c.a.ApiServlet] (qtp1390913202-20:[ctx-66866e36]) (logid:8c585b80) ===START=== 10.0.3.251 -- GET name=account.cleanup.interval&value=86401&command=updateConfiguration&response=json&sessionkey=utE1RMWP4uWKuF4-zwHxMF02YAA
2025-05-27 13:48:28,627 DEBUG [c.c.a.ApiServlet] (qtp1390913202-20:[ctx-66866e36]) (logid:8c585b80) Two factor authentication is already verified for the user 2, so skipping
2025-05-27 13:48:28,634 DEBUG [c.c.a.ApiServer] (qtp1390913202-20:[ctx-66866e36, ctx-24c069b4]) (logid:8c585b80) CIDRs from which account 'Account [{"accountName":"admin","id":2,"uuid":"a32bf6a3-3afd-11f0-928a-1e00fe0001d8"}]' is allowed to perform API calls: 0.0.0.0/0,::/0
2025-05-27 13:48:28,636 INFO [o.a.c.a.DynamicRoleBasedAPIAccessChecker] (qtp1390913202-20:[ctx-66866e36, ctx-24c069b4]) (logid:8c585b80) Account for user id a32cc71b-3afd-11f0-928a-1e00fe0001d8 is Root Admin or Domain Admin, all APIs are allowed.
2025-05-27 13:48:28,636 DEBUG [o.a.c.a.StaticRoleBasedAPIAccessChecker] (qtp1390913202-20:[ctx-66866e36, ctx-24c069b4]) (logid:8c585b80) RoleService is enabled. We will use it instead of StaticRoleBasedAPIAccessChecker.
2025-05-27 13:48:28,636 DEBUG [o.a.c.r.ApiRateLimitServiceImpl] (qtp1390913202-20:[ctx-66866e36, ctx-24c069b4]) (logid:8c585b80) API rate limiting is disabled. We will not use ApiRateLimitService.
2025-05-27 13:48:28,642 DEBUG [c.c.c.ConfigurationManagerImpl] (qtp1390913202-20:[ctx-66866e36, ctx-24c069b4]) (logid:8c585b80) Not proceeding with configuration [account.cleanup.interval]'s range validation, as it does not have a specified range.
2025-05-27 13:48:28,650 DEBUG [c.c.c.ConfigurationManagerImpl] (qtp1390913202-20:[ctx-66866e36, ctx-24c069b4]) (logid:8c585b80) Config: account.cleanup.interval value is updated from: 86400 to 86401 for scope: Global
2025-05-27 13:48:28,651 WARN [o.a.c.m.w.WebhookServiceImpl] (qtp1390913202-20:[ctx-66866e36, ctx-24c069b4]) (logid:8c585b80) Skipping delivering event Event {"description":"{\"details\":\" Name: account.cleanup.interval New Value: 86401\",\"event\":\"CONFIGURATION.VALUE.EDIT\",\"status\":\"Completed\"}","eventId":null,"eventType":"CONFIGURATION.VALUE.EDIT","eventUuid":null,"resourceType":"Configuration","resourceUUID":null} to any webhook as account ID is missing
2025-05-27 13:48:28,652 WARN [o.a.c.f.e.EventDistributorImpl] (qtp1390913202-20:[ctx-66866e36, ctx-24c069b4]) (logid:8c585b80) Failed to publish event [category: ActionEvent, type: CONFIGURATION.VALUE.EDIT] on bus webhookEventBus
2025-05-27 13:48:28,661 DEBUG [c.c.a.ApiServlet] (qtp1390913202-20:[ctx-66866e36, ctx-24c069b4]) (logid:8c585b80) ===END=== 10.0.3.251 -- GET name=account.cleanup.interval&value=86401&command=updateConfiguration&response=json&sessionkey=utE1RMWP4uWKuF4-zwHxMF02YAA

at reset:

2025-05-27 13:49:07,619 DEBUG [c.c.c.ConfigurationManagerImpl] (qtp1390913202-20:[ctx-8d531200, ctx-f988c6e7]) (logid:49586a24) Config: account.cleanup.interval value is updated from: 86401 to 86400 for scope: Global
2025-05-27 13:49:07,621 WARN [o.a.c.m.w.WebhookServiceImpl] (qtp1390913202-20:[ctx-8d531200, ctx-f988c6e7]) (logid:49586a24) Skipping delivering event Event {"description":"{\"details\":\" Name: account.cleanup.interval New Value: 86400\",\"event\":\"CONFIGURATION.VALUE.EDIT\",\"status\":\"Completed\"}","eventId":null,"eventType":"CONFIGURATION.VALUE.EDIT","eventUuid":null,"resourceType":"Configuration","resourceUUID":null} to any webhook as account ID is missing

@sudo87sudo87 assigned yadvr and unassigned borisstoyanovMay 30, 2025
@yadvryadvr modified the milestones: 4.20.2, 4.21.0Jun 3, 2025
@shwstppr

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@shwstpprshwstppr closed this Jun 3, 2025
@shwstpprshwstppr reopened this Jun 3, 2025
@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13593

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-13464)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 56690 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10769-t13464-kvm-ol8.zip
Smoke tests completed. 140 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

TestResultTime (s)Test File
test_router_dhcphostsFailure27.21test_router_dhcphosts.py

@DaanHoogland
DaanHoogland merged commit fa85a75 into apache:mainJun 4, 2025
@sudo87
sudo87 deleted the logConfigUpdate branch June 4, 2025 10:27
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jun 19, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants

@sudo87@shwstppr@blueorangutan@DaanHoogland@borisstoyanov@yadvr@sureshanaparti