Bug 2219648

Summary: Satellite Web UI >> Hosts >> All Hosts page loading slow even after power isn't selected from the new option "Manage columns".
Product: Red Hat Satellite Reporter: Mohit Kushwah <mkushwah>
Component: HostsAssignee: Oleh Fedorenko <ofedoren>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.13.0CC: ahumbe, chrobert, jpasqual, lhellebr, mhulan, mjia, pcreech, rlavi, saydas
Target Milestone: 6.14.0Keywords: Regression, Triaged, UserExperience
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2238367 (view as bug list) Environment:
Last Closed: 2023-11-08 14:19:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mohit Kushwah 2023-07-04 17:46:53 UTC
Description of problem:

Within satellite 6.13.0, the URI https://satellite_uri/hosts seems to always load the powerstate of the VM via compute ressourse.


- On Satellite 6.13, remove the 'Power' option from the 'Manage columns' option on page Hosts >> All Hosts

- load the page again and check logs showing power fields.

The example below logs:

~~~
2023-07-04T22:13:53 [I|app|998da4c5] Started PUT "/api/users/4/table_preferences/hosts" for xx.xx.xx.47 at 2023-07-04 22:13:53 +0530
2023-07-04T22:13:53 [I|app|998da4c5] Processing by Api::V2::TablePreferencesController#update as JSON
2023-07-04T22:13:53 [I|app|998da4c5]   Parameters: {"columns"=>["name", "os_title", "model", "owner", "hostgroup", "last_report", "comment", "name", "os_title", "ip", "insights_recommendations_count"], "apiv"=>"v2", "user_id"=>"4", "id"=>"hosts", "table_preference"=>{"columns"=>["name", "os_title", "model", "owner", "hostgroup", "last_report", "comment", "name", "os_title", "ip", "insights_recommendations_count"]}}
2023-07-04T22:13:53 [I|app|998da4c5]   Rendered api/v2/table_preferences/update.json.rabl (Duration: 6.3ms | Allocations: 6622)
2023-07-04T22:13:53 [I|app|998da4c5] Completed 200 OK in 46ms (Views: 7.1ms | ActiveRecord: 6.1ms | Allocations: 20796)
2023-07-04T22:13:53 [I|app|f8c5f816] Started GET "/hosts" for xx.xx.xx.47 at 2023-07-04 22:13:53 +0530
2023-07-04T22:13:53 [I|app|f8c5f816] Processing by HostsController#index as HTML
2023-07-04T22:13:53 [I|app|f8c5f816]   Rendered hosts/index.html.erb within layouts/application (Duration: 186.7ms | Allocations: 312069)
2023-07-04T22:13:53 [I|app|f8c5f816]   Rendered layouts/base.html.erb (Duration: 29.7ms | Allocations: 38244)
2023-07-04T22:13:53 [I|app|f8c5f816]   Rendered layout layouts/application.html.erb (Duration: 223.3ms | Allocations: 365108)
2023-07-04T22:13:53 [I|app|f8c5f816] Completed 200 OK in 261ms (Views: 219.3ms | ActiveRecord: 11.4ms | Allocations: 377325)
2023-07-04T22:13:54 [I|app|5baf81a0] Started GET "/notification_recipients" for xx.xx.xx.47 at 2023-07-04 22:13:54 +0530
2023-07-04T22:13:54 [I|app|5baf81a0] Processing by NotificationRecipientsController#index as JSON
2023-07-04T22:13:54 [I|app|5baf81a0] Completed 200 OK in 8ms (Views: 0.1ms | ActiveRecord: 1.8ms | Allocations: 1642)
2023-07-04T22:13:54 [I|app|dfa6bf0b] Started GET "/api/v2/hosts/client.example.com/power" for xx.xx.xx.47 at 2023-07-04 22:13:54 +0530
2023-07-04T22:13:54 [I|app|dfa6bf0b] Processing by Api::V2::HostsController#power_status as JSON
2023-07-04T22:13:54 [I|app|dfa6bf0b]   Parameters: {"apiv"=>"v2", "id"=>"client.example.com"}
2023-07-04T22:13:54 [I|app|dfa6bf0b] Completed 200 OK in 14ms (Views: 0.2ms | ActiveRecord: 3.4ms | Allocations: 4243)
~~~


- However, on Satellite 6.12 if we change the setting for webUI -> Administer -> Settings -> General -> Show host power status. Set it to no, the similar logs do not appear.

- 'Show host power status' is similar to the "Manage columns", power option settings on Satellite 6.13.




Version-Release number of selected component (if applicable):

6.13




Actual results:

- Satellite is checking the power status of hosts from compute resource and delay in loading the 'All hosts' page.


Expected results:

- Satellite should not check the power status if the "Manage columns" > power option is not selected.




Additional info:

- No difference in logs if we unselect or select the power option on Satellite 6.13 however, there was one difference like the 'power' field completely vanished on Satellite 6.12 if we disable the settings.

- Attaching logs from 6.13 and 6.12 Satellite with and without power option selected.

- Customer observed the behavior and reported slow loading performance.

Comment 2 Oleh Fedorenko 2023-07-13 15:37:19 UTC
Connecting redmine issue https://projects.theforeman.org/issues/35908 from this bug

Comment 4 Lukáš Hellebrandt 2023-07-26 12:36:52 UTC
Verified with Sat 6.14.0 snap 8.0.

With Power column enabled:

# foreman-tail | grep power
<IP> - - [26/Jul/2023:08:25:24 -0400] "GET /api/v2/hosts/<FQDN>/power HTTP/2.0" 304 - "https://<FQDN>/hosts" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0"
2023-07-26T08:25:24 [I|app|3e0f8685] Started GET "/api/v2/hosts/<FQDN>/power" for <IP> at 2023-07-26 08:25:24 -0400
2023-07-26T08:25:24 [I|app|3e0f8685] Processing by Api::V2::HostsController#power_status as JSON
2023-07-26T08:25:24 [I|app|8c6c8b49] Started GET "/api/v2/hosts/<VM_FQDN>/power" for <IP> at 2023-07-26 08:25:24 -0400
2023-07-26T08:25:24 [I|app|8c6c8b49] Processing by Api::V2::HostsController#power_status as JSON
<IP> - - [26/Jul/2023:08:25:24 -0400] "GET /api/v2/hosts/<VM_FQDN>/power HTTP/2.0" 304 - "https://<FQDN>/hosts" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0"

With Power column disabled:
# foreman-tail | grep power
<empty>

Note that I haven't done performance testing where I would really register a large number of VMs to the Satellite and measure times. If this is required for some reason, I would delegate this to the performance team.

Comment 6 matt jia 2023-11-04 05:05:34 UTC
*** Bug 2247887 has been marked as a duplicate of this bug. ***

Comment 8 errata-xmlrpc 2023-11-08 14:19:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.14 security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:6818