Bug 1274557 - [RFE] Please add the real and swap memory sizes for each appliance as discrete elements in the miq_servers table
[RFE] Please add the real and swap memory sizes for each appliance as discret...
Status: CLOSED CURRENTRELEASE
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance (Show other bugs)
5.4.0
x86_64 Linux
medium Severity medium
: GA
: 5.8.0
Assigned To: Joe Rafaniello
Nandini Chandra
usability:appliance
: FutureFeature, TestOnly
Depends On:
Blocks: 1382740
  Show dependency treegraph
 
Reported: 2015-10-22 21:41 EDT by Thomas Hennessy
Modified: 2017-06-12 13:37 EDT (History)
11 users (show)

See Also:
Fixed In Version: 5.8.0.0
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
: 1382740 (view as bug list)
Environment:
Last Closed: 2017-06-12 13:37:37 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core


Attachments (Terms of Use)

  None (edit)
Description Thomas Hennessy 2015-10-22 21:41:16 EDT
Description of problem:the information in the miq_servers table is used to record the status of each active appliance, but is missing the allocated real-memory and swap memory sizes from the creation of the appliance.  As it is fairly standard practice to increase the real memory size of the appliances at a customer, having this information available in the miq_servers instances makes it much easier to get an understanding of how the appliances are configured without having to visit each appliance individually.



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



How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 3 CFME Bot 2016-10-03 15:46:04 EDT
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/ea185265f022907d53ea31bb242b5f2ec478b4ed

commit ea185265f022907d53ea31bb242b5f2ec478b4ed
Author:     Joe Rafaniello <jrafanie@redhat.com>
AuthorDate: Thu Sep 29 17:23:29 2016 -0400
Commit:     Joe Rafaniello <jrafanie@redhat.com>
CommitDate: Mon Oct 3 14:49:48 2016 -0400

    Add columns for the system memory and swap free/used bytes
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1274557
    
    We'll soon be able to monitor appliance system memory and swap usage and make
    better decisions about activating/deactivating roles on appliances to avoid
    swap invasion.

 ...0160922234606_add_mem_and_swap_free_and_used_to_miq_servers.rb | 8 ++++++++
 db/schema.yml                                                     | 4 ++++
 2 files changed, 12 insertions(+)
 create mode 100644 db/migrate/20160922234606_add_mem_and_swap_free_and_used_to_miq_servers.rb
Comment 5 CFME Bot 2016-10-04 18:31:01 EDT
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/f7c0b4d2160a057b3413ce23e5314a3dd939cb41

commit f7c0b4d2160a057b3413ce23e5314a3dd939cb41
Author:     Joe Rafaniello <jrafanie@redhat.com>
AuthorDate: Fri Sep 30 11:11:08 2016 -0400
Commit:     Joe Rafaniello <jrafanie@redhat.com>
CommitDate: Tue Oct 4 16:18:09 2016 -0400

    Get the process info from an instance method.
    
    Call the instance method from the class method.
    
    Followup to #11660
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1274557

 app/models/miq_server/status_management.rb | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)
Comment 6 CFME Bot 2016-10-04 18:31:08 EDT
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/7eae819ce8568c7a618d95464ae7de312a9bbed3

commit 7eae819ce8568c7a618d95464ae7de312a9bbed3
Author:     Joe Rafaniello <jrafanie@redhat.com>
AuthorDate: Fri Sep 30 11:12:52 2016 -0400
Commit:     Joe Rafaniello <jrafanie@redhat.com>
CommitDate: Tue Oct 4 16:18:43 2016 -0400

    status_update learned to set system used/free mem/swap
    
    Followup to #11660
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1274557

 app/models/miq_server/status_management.rb       | 11 +++++++++++
 spec/models/miq_server/status_management_spec.rb | 14 ++++++++++++++
 2 files changed, 25 insertions(+)
Comment 7 Joe Rafaniello 2016-10-04 22:53:53 EDT
We have added the following columns to the miq_servers table:

system_memory_free
system_memory_used
system_swap_free
system_swap_used

As part of the existing process that updates the miq_server process (evmserver.rb) memory(memory_size, memory_usage, percent_memory) and cpu (cpu_time, percent_cpu), we will now update the 4 new columns with the data for the whole system (appliance).  These values will be in bytes.  This information was already logged as part of the log status.

In the future, the 4 new columns will be used to help prevent extremely unbalanced distribution of roles by moving roles from really busy appliances to ones already enabled as "backup" for those roles.
Comment 8 Joe Rafaniello 2016-10-05 11:14:12 EDT
Euwe Backport details, this should be available in 5.7.0.4:

$ git log
commit 74ba5f271cd0675d9d773df337e0136661acec0a
Author: Jason Frey <fryguy9@gmail.com>
Date:   Tue Oct 4 18:28:44 2016 -0400

    Merge pull request #11690 from jrafanie/set_miq_server_memory_swap_used_free

    Set appliance "system" memory/swap information
    (cherry picked from commit 7ad381e6b0309a535447ea0eaa8024629b0e8bfa)
Comment 10 Dave Johnson 2017-04-07 22:23:50 EDT
Tom, care to verify this and make sure its providing what you need?
Comment 11 Thomas Hennessy 2017-04-24 09:11:17 EDT
The requested information is provided in the 5.8.0 codebase.  thank you.
Comment 12 Nandini Chandra 2017-04-25 11:59:00 EDT
Verified in 5.8.0.10

Note You need to log in before you can comment on or make changes to this bug.