Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix aggregate_cpu/memory utilization methods for Containers #22951

Conversation

agrare
Copy link
Member

@agrare agrare commented Mar 20, 2024

The default aggregate_cpu/memory utilization methods use Hosts not ContainerNodes which doesn't work for ContainerManagers.

These are the methods being used for the table, https://github.com/ManageIQ/manageiq/blob/master/app/models/mixins/aggregation_mixin.rb#L5 which use :host_hardwares which won't be valid for ContainerManagers.

Before:
image

After:
image

Follow-up, what do other providers without Hosts do (thinking PhysicalInfraManagers that have PhysicalServers) It seems like Infra and Container are the only two manager types that show aggregate cpu/memory on the UI.

The default aggregate_cpu/memory utilization methods use Hosts not
ContainerNodes which doesn't work for ContainerManagers.
@miq-bot
Copy link
Member

miq-bot commented Mar 20, 2024

Checked commit agrare@bfa1249 with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
1 file checked, 0 offenses detected
Everything looks fine. 🍰

Copy link
Member

@GilbertCherrie GilbertCherrie left a comment

Choose a reason for hiding this comment

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

Tested locally and it is working

Copy link
Member

@kbrock kbrock left a comment

Choose a reason for hiding this comment

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

nice fix.

this will also use the database and can be inlined. so super kudos

@agrare
Copy link
Member Author

agrare commented Mar 28, 2024

ping @Fryguy

@Fryguy Fryguy merged commit 5a25f61 into ManageIQ:master Mar 28, 2024
8 checks passed
@agrare agrare deleted the fix_container_manager_aggregate_cpu_memory_methods branch March 28, 2024 14:03
@Fryguy
Copy link
Member

Fryguy commented Mar 28, 2024

Backported to radjabov in commit e4479a1.

commit e4479a172891816e78419ce2663a7f0377de25d4
Author: Jason Frey <[email protected]>
Date:   Thu Mar 28 10:02:59 2024 -0400

    Merge pull request #22951 from agrare/fix_container_manager_aggregate_cpu_memory_methods
    
    Fix aggregate_cpu/memory utilization methods for Containers
    
    (cherry picked from commit 5a25f61674c0601682e5417eb7da82889a39e7b8)

Fryguy added a commit that referenced this pull request Mar 28, 2024
…_cpu_memory_methods

Fix aggregate_cpu/memory utilization methods for Containers

(cherry picked from commit 5a25f61)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants