Skip to content

Conversation

@vishesh92
Copy link
Member

@vishesh92 vishesh92 commented Oct 30, 2024

Description

Github generated description

This pull request introduces several changes across multiple files to enhance logging, add UUID and name properties, and improve the toString methods for better debugging and clarity. Here are the most important changes:

Enhancements to Agent class:

  • Added uuid and name properties to the Agent class and updated the constructor to initialize these properties from the shell. [1] [2]
  • Updated logging statements to include uuid and name in various methods such as processStartupAnswer and processReadyCommand. [1] [2] [3]
  • Added getter and setter methods for uuid and name, including persistence logic.

Updates to LoadBalancerTO and related classes:

  • Added uuid property to CounterTO, ConditionTO, and AutoScalePolicyTO classes, along with corresponding getter methods. [1] [2] [3] [4] [5] [6]

Improvements to logging and exception handling:

  • Enhanced logging and exception messages in UpdateHostCmd and CreateSnapshotFromVMSnapshotCmd to include more detailed information. [1] [2] [3] [4]
  • Updated RemoveVpnUserCmd to use the Account object directly in method calls and logging.

Method signature changes:

  • Changed method signatures in Ipv6Service, RemoteAccessVpnService, and GlobalLoadBalancingRulesService to use more appropriate parameter types. [1] [2] [3]

Improved toString methods:

  • Added or enhanced toString methods in NetworkProfile, NicProfile, and UnmanagedInstanceTO classes for better debugging output. [1] [2] [3]

This PR updates the logging for some modules to ensure that we log more details to easily identify resources from the logs.
e.g. We use id at a lot of places in the logs and it makes it difficult to know about the resource without querying the database. This PR makes changes to include uuid or any other relevant fields to the objects in the logs so that the user can easily identify the resource.

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

Screenshots (if appropriate):

How Has This Been Tested?

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

@codecov
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 7.09970% with 1845 lines in your changes missing coverage. Please review.

Project coverage is 16.04%. Comparing base (32af4a2) to head (8af0b13).
Report is 8 commits behind head on 4.20.

Files with missing lines Patch % Lines
...tack/engine/orchestration/NetworkOrchestrator.java 6.50% 114 Missing and 1 partial ⚠️
...java/com/cloud/agent/manager/AgentManagerImpl.java 3.19% 91 Missing ⚠️
...e/cloudstack/storage/volume/VolumeServiceImpl.java 7.40% 75 Missing ⚠️
...atastore/driver/ScaleIOPrimaryDataStoreDriver.java 13.51% 63 Missing and 1 partial ⚠️
...cloud/agent/manager/ClusteredAgentManagerImpl.java 0.00% 62 Missing ⚠️
...n/java/com/cloud/vm/VirtualMachineManagerImpl.java 1.96% 49 Missing and 1 partial ⚠️
...bernetes/cluster/KubernetesClusterManagerImpl.java 4.87% 39 Missing ⚠️
...va/com/cloud/network/element/CiscoVnmcElement.java 2.56% 38 Missing ⚠️
.../cloudstack/storage/image/TemplateServiceImpl.java 2.63% 37 Missing ⚠️
...com/cloud/vm/VirtualMachinePowerStateSyncImpl.java 0.00% 35 Missing ⚠️
... and 237 more
Additional details and impacted files
@@            Coverage Diff             @@
##               4.20    #9873    +/-   ##
==========================================
  Coverage     16.04%   16.04%            
- Complexity    12835    12845    +10     
==========================================
  Files          5637     5639     +2     
  Lines        493651   493898   +247     
  Branches      59874    59883     +9     
==========================================
+ Hits          79205    79260    +55     
- Misses       405648   405832   +184     
- Partials       8798     8806     +8     
Flag Coverage Δ
uitests 4.02% <ø> (ø)
unittests 16.89% <7.09%> (+<0.01%) ⬆️

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.

@vishesh92 vishesh92 force-pushed the improve-logging branch 2 times, most recently from 355b1e5 to 6a0dc33 Compare November 5, 2024 05:35
@apache apache deleted a comment from blueorangutan Nov 5, 2024
@apache apache deleted a comment from blueorangutan Nov 5, 2024
@apache apache deleted a comment from blueorangutan Nov 5, 2024
@apache apache deleted a comment from blueorangutan Nov 5, 2024
@vishesh92
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@vishesh92 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

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

@vishesh92
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@vishesh92 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

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

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti 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

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

@vishesh92
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@vishesh92 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.

@vishesh92
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@vishesh92 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.

@vishesh92
Copy link
Member Author

you are going to hate me @vishesh92 , but can we use capitals for acronyms please? I marked it in a few places but it is all over the place. It is more in line with other discussions on the same subject (see amongst others #9132) otherwise please involve yourself in the discussion on the topic.

@DaanHoogland Making this change in this PR would be difficult due to the size of the changes. It would be better to tackle this separately once we have reached a consensus in #9132.

Also, I have raised this PR against 4.20. There might be some merge conflicts while forward merging 4.19 to 4.20 but those were going to come anyway due to the logger variable rename in 4.20 branch.

@blueorangutan
Copy link

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

@vishesh92
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File
test_10_bgp_peers Error 0.07 test_ipv4_routing.py
test_11_isolated_network_with_dynamic_routed_mode Error 0.06 test_ipv4_routing.py
test_12_vpc_and_tier_with_dynamic_routed_mode Error 1.07 test_ipv4_routing.py
test_create_pvlan_network Error 0.09 test_pvlan.py
test_02_redundant_VPC_default_routes Failure 427.72 test_vpc_redundant.py

Copy link
Contributor

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

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

LGTM , the logs contains the UUID of the resources during various operations

Test Case Execution Result
Smoketests Pass
Test powerflex setup functionality Pass
Verify changes are applicable for agent logs Pass
Verify changes are applicable for management logs Pass
Display uuid or name of entity for debugging purposes Pass

For example

Before

2025-01-03 09:41:18,961 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-11:null) (logid:) vm id: 3 - time since last state update(21960ms) has not passed graceful period yet

After

2025-01-03 08:17:42,909 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-4:null) (logid:) vm: VM instance {"id":6,"instanceName":"i-2-6-VM","type":"User","uuid":"ef5cf0d8-b63b-411c-a88f-94e57a1b6f97"} - time since last state update(50906 ms) has not passed graceful period yet

@kiranchavala
Copy link
Contributor

@blueorangutan test keepEnv

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File
test_11_isolated_network_with_dynamic_routed_mode Error 2.29 test_ipv4_routing.py
test_12_vpc_and_tier_with_dynamic_routed_mode Error 2.38 test_ipv4_routing.py
test_12_vpc_and_tier_with_dynamic_routed_mode Error 2.38 test_ipv4_routing.py

@vishesh92 vishesh92 marked this pull request as ready for review January 6, 2025 11:08
Copy link
Contributor

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

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

LGTM

@harikrishna-patnala harikrishna-patnala merged commit a4224e5 into apache:4.20 Jan 6, 2025
25 of 26 checks passed
@harikrishna-patnala harikrishna-patnala deleted the improve-logging branch January 6, 2025 11:12
DaanHoogland added a commit that referenced this pull request Jan 8, 2025
* 4.20:
  merge errors fixed
  Restrict the migration of volumes attached to VMs in Starting state (#9725)
  server, plugin: enhance storage stats for IOPS (#10034)
  Introducing granular command timeouts global setting (#9659)
  Improve logging to include more identifiable information (#9873)
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jan 10, 2025
* Improve logging to include more identifiable information for kvm plugin

* Update logging for scaleio plugin

* Improve logging to include more identifiable information for default volume storage plugin

* Improve logging to include more identifiable information for agent managers

* Improve logging to include more identifiable information for Listeners

* Replace ids with objects or uuids

* Improve logging to include more identifiable information for engine

* Improve logging to include more identifiable information for server

* Fixups in engine

* Improve logging to include more identifiable information for plugins

* Improve logging to include more identifiable information for Cmd classes

* Fix toString method for StorageFilterTO.java
@Pearl1594 Pearl1594 moved this to Done in ACS 4.20.1 Mar 17, 2025
rp- added a commit to LINBIT/cloudstack that referenced this pull request May 16, 2025
PR apache#9873 changed the default implemention of hostConnect on the
DefaultHostListener, and Linstor tried to call the none existant
default implementation. With the change in the PR a recursion was
triggered that triggered a StackOverflow and stopped
adding Linstor primary storage.
rp- added a commit to LINBIT/cloudstack that referenced this pull request May 16, 2025
PR apache#9873 changed the default implementation of hostConnect on the
DefaultHostListener, and Linstor tried to call the none existent
default implementation. With the change in the PR a recursion was
triggered that triggered a StackOverflow and stopped
adding Linstor primary storage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants