-
Bug
-
Resolution: Done
-
Normal
-
None
-
None
-
None
-
None
-
5
-
False
-
None
-
False
-
COST-3875 - Cloud: Show individual VM cost
-
-
EC2 report is supposed to display the latest values in case that some instance attributes change over time (instance name, account alias, inst. type, memory or vcpu).
When I tested this, it seemed to work fine but I was probably just lucky - the automated test sometimes fails because the report shows the "old" value
UPDATE:
It looks like max value is always picked, e.g. vcpu 16 over vcpu 2, instance z.abc over m.abc etc.
We need to pick values with corresponding to the latest timestamps not the max values of individual attributes
Steps to reproduce:
- use iqe branch: esebesto/reproducer_
COST-5558 - run test_api_aws_ec2_report_content test multiple times until you hit the issue
ENV_FOR_DYNACONF=local iqe tests plugin cost_management -k "test_api_aws_ec2_report_content" -vv --pdb
Example:
In the example below, we have two records in the db,
- RECORD 2 for 2024-10-01: t3.small instance with 7.5 GiB memory, name instance_name_test_10
- RECORD 1 for 2024-10-02: m3.large instance with 1.5 GiB memory, name instance_name_test_101
postgres=# select * from reporting_awscostentrylineitem_summary_by_ec2_compute_p_2024_10 where resource_id = 'i-88883333';
-[ RECORD 1 ]--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------
uuid | accdd598-1691-4534-88f4-cc845f9e4f6b
usage_start | 2024-10-02
usage_end | 2024-10-02
usage_account_id | 0088883333999
resource_id | i-88883333
instance_name | instance_name_test_101
instance_type | m3.large
operating_system | Fedora CoreOS
region | us-west-1
vcpu |
memory | 1.5 GiB
unit | Hrs
usage_amount | 5.000000000
normalization_factor | 0
normalized_usage_amount | 0
currency_code | USD
... SHORTENED ...
-[ RECORD 2 ]--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------
uuid | 722f033b-35ef-4dff-bf71-9d83713a254b
usage_start | 2024-10-01
usage_end | 2024-10-01
usage_account_id | 0088883333999
resource_id | i-88883333
instance_name | instance_name_test_10
instance_type | t3.small
operating_system | Fedora CoreOS
region | us-west-1
vcpu |
memory | 7.5 GiB
unit | Hrs
usage_amount | 12.000000000
normalization_factor | 0
normalized_usage_amount | 0
currency_code | USD
... SHORTENED ...
Thus we expect to see m3.large instance with 1.5 GiB memory in the EC2 report for current month. Which was not the case. interestingly enough, instance_name was instance_name_test_101 as expected
"date": "2024-10", "resource_ids": [ { "resource_id": "i-88883333", "values": [ { "resource_id": "i-88883333", "date": "2024-10", "usage": { "value": 17.0, "units": "Hrs" }, "source_uuid": [ "0d6fd06a-5484-47f7-8b70-4c30c11206fd" ], "account_alias": "0088883333999", "account": "0088883333999", "instance_name": "instance_name_test_101", "instance_type": "t3.small", "operating_system": "Fedora CoreOS", "region": "us-west-1", "vcpu": null, "memory": "7.5 GiB", ... SHORTENED ...
- is related to
-
COST-4403 AWS: Show individual VM cost (EC2 Service) - PNT Only
- Closed