Bug 1552288

Summary: [RFE] Metrics for memory usage of AWS instances is missing from C&U
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: ProvidersAssignee: Alexander Zagaynov <azagayno>
Status: CLOSED ERRATA QA Contact: Nandini Chandra <nachandr>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.8.0CC: aperotti, azagayno, bsorota, cpelland, gblomqui, jfrey, jhardy, kmorey, nachandr, obarenbo, rbergami, simaishi
Target Milestone: GAKeywords: FutureFeature, ZStream
Target Release: 5.9.2   
Hardware: x86_64   
OS: Other   
Whiteboard:
Fixed In Version: 5.9.2.1 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 1519872 Environment:
Last Closed: 2018-05-07 20:43:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: AWS Target Upstream Version:
Embargoed:
Bug Depends On: 1519872    
Bug Blocks:    

Comment 2 CFME Bot 2018-03-06 22:01:56 UTC
New commit detected on ManageIQ/manageiq-providers-amazon/gaprindashvili:

https://github.com/ManageIQ/manageiq-providers-amazon/commit/ccf96331b72dbee4d0ea1512732f6739f824bf0a
commit ccf96331b72dbee4d0ea1512732f6739f824bf0a
Author:     Bronagh Sorota <bsorota>
AuthorDate: Wed Jan 31 09:40:53 2018 -0500
Commit:     Bronagh Sorota <bsorota>
CommitDate: Wed Jan 31 09:40:53 2018 -0500

    Merge pull request #393 from AlexanderZagaynov/BZ-1519872

    AWS memory usage collection
    (cherry picked from commit 5909c162326b98cb1989527c4d2e4edb104a73c4)

    https://bugzilla.redhat.com/show_bug.cgi?id=1552288

 app/models/manageiq/providers/amazon/cloud_manager/metrics_capture.rb | 80 +-
 spec/models/manageiq/providers/amazon/cloud_manager/metrics_capture_spec.rb | 34 +-
 spec/vcr_cassettes/manageiq/providers/amazon/cloud_manager/metrics_capture.yml | 2342 +
 3 files changed, 2430 insertions(+), 26 deletions(-)

Comment 4 Nandini Chandra 2018-04-13 16:23:54 UTC
Could this be backported to 58?

Comment 9 Nandini Chandra 2018-05-01 14:24:52 UTC
Verified in 5.9.2.3

vmdb_production=# select mem_usage_absolute_average from metrics where resource_name = 'cu-24x7'\x\g\x

mem_usage_absolute_average | 38.99
-[ RECORD 21 ]-------------+-----------------
mem_usage_absolute_average | 38.99
-[ RECORD 22 ]-------------+-----------------
mem_usage_absolute_average | 38.99
-[ RECORD 23 ]-------------+-----------------
mem_usage_absolute_average | 35.99
-[ RECORD 24 ]-------------+-----------------

Comment 12 errata-xmlrpc 2018-05-07 20:43:18 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, 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-2018:1328

Comment 13 Alexander Zagaynov 2018-09-10 13:08:12 UTC
Notes about testing:

- ssh to VM
- make sure you have swap enabled:
-- `free -h` will show how much swap memory you have
-- if zero, let's create swapfile, you can use this instruction: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-swapspace#swap-creating-file
- install `stress` utility
- use `stress --vm-bytes $(awk '/MemAvailable/{printf "%d\n", $2 * 1.6;}' < /proc/meminfo)k --vm-keep -m 1` to utilize memory (where "1.6" is the coefficient to the memory available, it means "100% of available memory and 60% more, which should use swap")
- wait 10-20 minutes to see new metric values (because they are "average", they will not be changed immediately)