Skip to content

Conversation

@joseflauzino
Copy link
Contributor

Description

This PR addresses issue #5935.

In summary, this PR makes ACS persist VM stats in the database to provide more consistency and make it possible to obtain historical data.

For more information, please refer to the spec contained in issue #5935.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Screenshots

New API

  • Getting all available stats:
    sem-filtro

  • Filtering by start and end date:
    com filtro

UI changes

  • Metrics disabled. It shows all VMs:
    0

  • Metrics enabled. It shows only running VMs and their current stats:
    1

  • Metrics enabled and filtering by stopped VMs. It forces the display of stopped VMs and their latest stats collected (not reflecting their current stats):
    2

How Has This Been Tested?

I added unit tests to several methods.

Also, in a local lab, I performed the following tests:

  • I tested different combinations of the global settings vm.stats.increment.metrics, vm.stats.max.retention.time, and vm.stats.interval. All tests resulted in the expected behavior, as described in section 2.2 of the spec.
  • I tested the listVirtualMachinesMetrics API with different combinations of its new accumulate parameter with the global configuration vm.stats.increment.metrics, and everything worked as expected. See sections 2.2 and 3.3 of the spec for more details.
  • I tested the UI modifications mentioned in section 3.4 of the spec. The obtained behavior was as follows:
    • When clicking on the "Metrics" button only running VMs and their respective stats were listed;
    • Then it was possible to "force" the listing of stopped VMs by changing the filter from "All" to "Stopped".
  • I tested the new listVirtualMachinesUsageHistory API by filtering by different time periods and VMs. All the filtering described in section 2.4 of the spec was successfully tested.

@nvazquez nvazquez linked an issue Feb 11, 2022 that may be closed by this pull request
@nvazquez nvazquez added this to the 4.17.0.0 milestone Feb 11, 2022
@DaanHoogland
Copy link
Contributor

Looks good @joseflauzino . Can you confirm it is ready for review and testing, please?

@joseflauzino
Copy link
Contributor Author

@DaanHoogland Yes, it's ready.

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@joseflauzino
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@joseflauzino a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2685

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-3412)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 33543 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5984-t3412-kvm-centos7.zip
Smoke tests completed. 92 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

cltgm, needs some testing by third party though

@DaanHoogland
Copy link
Contributor

@borisstoyanov @rohityadavcloud care to review?

Copy link
Contributor

@GutoVeronezi GutoVeronezi left a comment

Choose a reason for hiding this comment

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

CLGTM, I pointed some minor improvements though.

I'll test it in my local lab and I'll post the results.

@GutoVeronezi
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@GutoVeronezi a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2787

@GutoVeronezi GutoVeronezi self-requested a review March 8, 2022 17:17
@GutoVeronezi
Copy link
Contributor

The tests were performed based on the code changes and the spec (#5935).

I tested the situations with an environment without the changes (ENV-1) and another one with the changes (ENV-2). I separeted the CloudMonkey results in files to avoid posting a big comment.

Situations

✔️ I created a VM, waited for management to gather the information and restarted it. After restart it, ENV-1 was without the informations. ENV-2 had the last collected information.

✔️ I created a VM and verified in two management nodes. ENV-1 presented divergent informations. ENV-2 persented the same information for both nodes.

✔️ I tested some combinations of the global configs:

✔️ UI not showing stopped VMs when seeing metrics unless we filter only stopped:

  • test-do-not-show-metrics-of-stopped-vms
  • test-show-metrics-of-stopped-vms

❌ Analyzing the database, the column vm_stats.mgmt_server_id is storing the node's MacAddress, not the management's id.


@joseflauzino Analyzing the new API's return, I think it would be better if the element stats was ordered by its inner element timestamp.

@GutoVeronezi
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@GutoVeronezi a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 3052

@joseflauzino
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@joseflauzino a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 3071

@GutoVeronezi
Copy link
Contributor

I re-ran the manual tests (one of the results below). The feature seems working fine to me.


Test with 15 seconds of interval and 1 minute of retention, with 2 MGMT:

Note: the stats are ordered by the field timestamp now.

(lab) 🐱 > list configurations name=vm.stats
{
  "configuration": [
    {
      "category": "Advanced",
      "description": "When set to 'true', VM metrics(NetworkReadKBs, NetworkWriteKBs, DiskWriteKBs, DiskReadKBs, DiskReadIOs and DiskWriteIOs) that are collected from the hypervisor are summed before being returned.On the other hand, when set to 'false', the VM metrics API will just display the latest metrics collected.",
      "isdynamic": true,
      "name": "vm.stats.increment.metrics",
      "value": "true"
    },
    {
      "category": "Advanced",
      "description": "The interval (in milliseconds) when vm stats are retrieved from agents.",
      "isdynamic": false,
      "name": "vm.stats.interval",
      "value": "15000"
    },
    {
      "category": "Advanced",
      "description": "The maximum time (in minutes) for keeping VM stats records in the database. The VM stats cleanup process will be disabled if this is set to 0 or less than 0.",
      "isdynamic": true,
      "name": "vm.stats.max.retention.time",
      "value": "1"
    }
  ],
  "count": 3
}
(lab) 🐱 > list virtualmachinesusagehistory id=167e5918-4762-4536-a526-942fa2fc62cb 
{
  "count": 1,
  "virtualmachine": [
    {
      "id": "167e5918-4762-4536-a526-942fa2fc62cb",
      "name": "i-2-113-VM",
      "stats": [
        {
          "cpuused": "15.78%",
          "diskiopstotal": 0,
          "diskioread": 0,
          "diskiowrite": 0,
          "diskkbsread": 0,
          "diskkbswrite": 0,
          "memoryintfreekbs": 0,
          "memorykbs": 524288,
          "memorytargetkbs": 524288,
          "networkkbsread": 0,
          "networkkbswrite": 0,
          "networkread": "0.00 MB",
          "networkwrite": "0.00 MB",
          "timestamp": "2022-04-05T17:37:26+0000"
        },
        {
          "cpuused": "16.8%",
          "diskiopstotal": 0,
          "diskioread": 0,
          "diskiowrite": 0,
          "diskkbsread": 0,
          "diskkbswrite": 0,
          "memoryintfreekbs": 0,
          "memorykbs": 524288,
          "memorytargetkbs": 524288,
          "networkkbsread": 0,
          "networkkbswrite": 0,
          "networkread": "0.00 MB",
          "networkwrite": "0.00 MB",
          "timestamp": "2022-04-05T17:37:29+0000"
        },
        {
          "cpuused": "16.08%",
          "diskiopstotal": 0,
          "diskioread": 0,
          "diskiowrite": 0,
          "diskkbsread": 0,
          "diskkbswrite": 0,
          "memoryintfreekbs": 0,
          "memorykbs": 524288,
          "memorytargetkbs": 524288,
          "networkkbsread": 0,
          "networkkbswrite": 0,
          "networkread": "0.00 MB",
          "networkwrite": "0.00 MB",
          "timestamp": "2022-04-05T17:37:41+0000"
        },
        {
          "cpuused": "16.18%",
          "diskiopstotal": 0,
          "diskioread": 0,
          "diskiowrite": 0,
          "diskkbsread": 0,
          "diskkbswrite": 0,
          "memoryintfreekbs": 0,
          "memorykbs": 524288,
          "memorytargetkbs": 524288,
          "networkkbsread": 0,
          "networkkbswrite": 0,
          "networkread": "0.00 MB",
          "networkwrite": "0.00 MB",
          "timestamp": "2022-04-05T17:37:44+0000"
        },
        {
          "cpuused": "16.2%",
          "diskiopstotal": 0,
          "diskioread": 0,
          "diskiowrite": 0,
          "diskkbsread": 0,
          "diskkbswrite": 0,
          "memoryintfreekbs": 0,
          "memorykbs": 524288,
          "memorytargetkbs": 524288,
          "networkkbsread": 0,
          "networkkbswrite": 0,
          "networkread": "0.00 MB",
          "networkwrite": "0.00 MB",
          "timestamp": "2022-04-05T17:37:57+0000"
        },
        {
          "cpuused": "16.88%",
          "diskiopstotal": 0,
          "diskioread": 0,
          "diskiowrite": 0,
          "diskkbsread": 0,
          "diskkbswrite": 0,
          "memoryintfreekbs": 0,
          "memorykbs": 524288,
          "memorytargetkbs": 524288,
          "networkkbsread": 0,
          "networkkbswrite": 0,
          "networkread": "0.00 MB",
          "networkwrite": "0.00 MB",
          "timestamp": "2022-04-05T17:38:00+0000"
        },
        {
          "cpuused": "16.13%",
          "diskiopstotal": 0,
          "diskioread": 0,
          "diskiowrite": 0,
          "diskkbsread": 0,
          "diskkbswrite": 0,
          "memoryintfreekbs": 0,
          "memorykbs": 524288,
          "memorytargetkbs": 524288,
          "networkkbsread": 0,
          "networkkbswrite": 0,
          "networkread": "0.00 MB",
          "networkwrite": "0.00 MB",
          "timestamp": "2022-04-05T17:38:12+0000"
        },
        {
          "cpuused": "14.47%",
          "diskiopstotal": 0,
          "diskioread": 0,
          "diskiowrite": 0,
          "diskkbsread": 0,
          "diskkbswrite": 0,
          "memoryintfreekbs": 0,
          "memorykbs": 524288,
          "memorytargetkbs": 524288,
          "networkkbsread": 0,
          "networkkbswrite": 0,
          "networkread": "0.00 MB",
          "networkwrite": "0.00 MB",
          "timestamp": "2022-04-05T17:38:15+0000"
        }
      ]
    }
  ]
}


The column vm_stats.mgmt_server_id is storing the management server's id now:

MariaDB [cloud]> select * from mshost;
+----+----------------+---------------+-----------------------------+--------------------------------------+-------+-------------------+-----------------+--------------+---------------------+---------+-------------+
| id | msid           | runid         | name                        | uuid                                 | state | version           | service_ip      | service_port | last_update         | removed | alert_count |
+----+----------------+---------------+-----------------------------+--------------------------------------+-------+-------------------+-----------------+--------------+---------------------+---------+-------------+
|  1 | 90520745551922 | 1649179172554 | cloudstack-lab-management-1 | cd30ed1b-daed-4f23-bd5a-439ed609bf13 | Up    | 4.17.0.0-SNAPSHOT | 192.168.201.150 |         9090 | 2022-04-05 17:38:12 | NULL    |           0 |
|  3 | 90520746808830 | 1649179414017 | cloudstack-lab-management-2 | ea6b28f8-8511-43f8-bff7-03a9c3fc01d8 | Up    | 4.17.0.0-SNAPSHOT | 192.168.201.151 |         9090 | 2022-04-05 17:38:11 | NULL    |           0 |
+----+----------------+---------------+-----------------------------+--------------------------------------+-------+-------------------+-----------------+--------------+---------------------+---------+-------------+
2 rows in set (0.001 sec)

MariaDB [cloud]> select * from vm_stats;
+-----+-------+----------------+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id  | vm_id | mgmt_server_id | timestamp           | vm_stats_data                                                                                                                                                                                                                                                                   |
+-----+-------+----------------+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 136 |   113 |              1 | 2022-04-05 17:37:26 | {"vmId":113,"cpuUtilization":15.784281486353175,"networkReadKBs":0.0,"networkWriteKBs":0.0,"diskReadIOs":0.0,"diskWriteIOs":0.0,"diskReadKBs":0.0,"diskWriteKBs":0.0,"memoryKBs":524288.0,"intFreeMemoryKBs":524288.0,"targetMemoryKBs":524288.0,"numCPUs":1,"entityType":"vm"} |
| 137 |   113 |              3 | 2022-04-05 17:37:29 | {"vmId":113,"cpuUtilization":16.801075268817204,"networkReadKBs":0.0,"networkWriteKBs":0.0,"diskReadIOs":0.0,"diskWriteIOs":0.0,"diskReadKBs":0.0,"diskWriteKBs":0.0,"memoryKBs":524288.0,"intFreeMemoryKBs":524288.0,"targetMemoryKBs":524288.0,"numCPUs":1,"entityType":"vm"} |
| 138 |   113 |              1 | 2022-04-05 17:37:41 | {"vmId":113,"cpuUtilization":16.078753076292042,"networkReadKBs":0.0,"networkWriteKBs":0.0,"diskReadIOs":0.0,"diskWriteIOs":0.0,"diskReadKBs":0.0,"diskWriteKBs":0.0,"memoryKBs":524288.0,"intFreeMemoryKBs":524288.0,"targetMemoryKBs":524288.0,"numCPUs":1,"entityType":"vm"} |
| 139 |   113 |              3 | 2022-04-05 17:37:44 | {"vmId":113,"cpuUtilization":16.183412002697235,"networkReadKBs":0.0,"networkWriteKBs":0.0,"diskReadIOs":0.0,"diskWriteIOs":0.0,"diskReadKBs":0.0,"diskWriteKBs":0.0,"memoryKBs":524288.0,"intFreeMemoryKBs":524288.0,"targetMemoryKBs":524288.0,"numCPUs":1,"entityType":"vm"} |
| 140 |   113 |              1 | 2022-04-05 17:37:57 | {"vmId":113,"cpuUtilization":16.203322914953116,"networkReadKBs":0.0,"networkWriteKBs":0.0,"diskReadIOs":0.0,"diskWriteIOs":0.0,"diskReadKBs":0.0,"diskWriteKBs":0.0,"memoryKBs":524288.0,"intFreeMemoryKBs":524288.0,"targetMemoryKBs":524288.0,"numCPUs":1,"entityType":"vm"} |
| 141 |   113 |              3 | 2022-04-05 17:38:00 | {"vmId":113,"cpuUtilization":16.87624090006618,"networkReadKBs":0.0,"networkWriteKBs":0.0,"diskReadIOs":0.0,"diskWriteIOs":0.0,"diskReadKBs":0.0,"diskWriteKBs":0.0,"memoryKBs":524288.0,"intFreeMemoryKBs":524288.0,"targetMemoryKBs":524288.0,"numCPUs":1,"entityType":"vm"}  |
| 142 |   113 |              1 | 2022-04-05 17:38:12 | {"vmId":113,"cpuUtilization":16.1276982879828,"networkReadKBs":0.0,"networkWriteKBs":0.0,"diskReadIOs":0.0,"diskWriteIOs":0.0,"diskReadKBs":0.0,"diskWriteKBs":0.0,"memoryKBs":524288.0,"intFreeMemoryKBs":524288.0,"targetMemoryKBs":524288.0,"numCPUs":1,"entityType":"vm"}   |
| 143 |   113 |              3 | 2022-04-05 17:38:15 | {"vmId":113,"cpuUtilization":14.468924695823743,"networkReadKBs":0.0,"networkWriteKBs":0.0,"diskReadIOs":0.0,"diskWriteIOs":0.0,"diskReadKBs":0.0,"diskWriteKBs":0.0,"memoryKBs":524288.0,"intFreeMemoryKBs":524288.0,"targetMemoryKBs":524288.0,"numCPUs":1,"entityType":"vm"} |
+-----+-------+----------------+---------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
8 rows in set (0.001 sec)

@nvazquez can we re-run the smoke tests for this one?

@nvazquez
Copy link
Contributor

nvazquez commented Apr 6, 2022

Thanks @GutoVeronezi, sure
@blueorangutan test

@blueorangutan
Copy link

@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-3826)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 42884 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5984-t3826-kvm-centos7.zip
Smoke tests completed. 92 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@joseflauzino
Copy link
Contributor Author

@GutoVeronezi @nvazquez @DaanHoogland
Can we merge this?

@DaanHoogland
Copy link
Contributor

At this stage, i'd leave that with the RM, @nvazquez ?

@GutoVeronezi @nvazquez @DaanHoogland Can we merge this?

@nvazquez
Copy link
Contributor

@joseflauzino sorry, have deleted my previous comment - have seen its been manually tested - can be merged

@nvazquez nvazquez merged commit 16f2896 into apache:main Apr 11, 2022
@joseflauzino joseflauzino mentioned this pull request May 20, 2022
7 tasks
@rohityadavcloud
Copy link
Member

Hi @joseflauzino - does the new API return the exact same API output format/keys as the deprecated listVirtualMachinesMetrics with this PR?

rohityadavcloud added a commit to shapeblue/cloudstack that referenced this pull request Apr 26, 2024
- Changes behaviour of details param handling for:
  - listVirtualMachines API: when the detail param is not provided, it
    uses `all` details except `stats`
  - listVirtualMachinesMetrics API: when the detail param is not
    provided, it uses `all` details including `stats`
- Remove ConfigKey vm.stats.increment.metrics.in.memory which was
  renamed to `vm.stats.increment.metrics` in apache#5984
- Changes default value of VM stats accumulation setting
  `vm.stats.increment.metrics` to false until a better solution emerges.
  Since apache#5984, this is true and during the execution of listVM APIs the
  stats are clubbed/calculated which can immensely slow down list VM API
  calls.
- Fix UI that uses listVirtualMachinesMetrics to not call `stats` detail
  when in list view without metrics selected.

These changes see 2-4x gains in the listVirtualMachines APIs call and in
the UI. For environment where code changes are not possible, disabling
`vm.stats.increment.metrics` global setting saw 2-4x speed gain in the
list API calls.

Signed-off-by: Rohit Yadav <[email protected]>
rohityadavcloud added a commit to shapeblue/cloudstack that referenced this pull request Apr 26, 2024
- Changes behaviour of details param handling for:
  - listVirtualMachines API: when the detail param is not provided, it
    uses `all` details except `stats`
  - listVirtualMachinesMetrics API: when the detail param is not
    provided, it uses `all` details including `stats`
- Remove ConfigKey vm.stats.increment.metrics.in.memory which was
  renamed to `vm.stats.increment.metrics` in apache#5984
- Changes default value of VM stats accumulation setting
  `vm.stats.increment.metrics` to false until a better solution emerges.
  Since apache#5984, this is true and during the execution of listVM APIs the
  stats are clubbed/calculated which can immensely slow down list VM API
  calls.
- Fix UI that uses listVirtualMachinesMetrics to not call `stats` detail
  when in list view without metrics selected.

These changes see 2-4x gains in the listVirtualMachines APIs call and in
the UI. For environment where code changes are not possible, disabling
`vm.stats.increment.metrics` global setting saw 2-4x speed gain in the
list API calls.

Signed-off-by: Rohit Yadav <[email protected]>
rohityadavcloud added a commit to shapeblue/cloudstack that referenced this pull request Apr 27, 2024
- Changes behaviour of details param handling for:
  - listVirtualMachines API: when the detail param is not provided, it
    uses `all` details except `stats`
  - listVirtualMachinesMetrics API: when the detail param is not
    provided, it uses `all` details including `stats`
- Remove ConfigKey vm.stats.increment.metrics.in.memory which was
  renamed to `vm.stats.increment.metrics` in apache#5984
- Changes default value of VM stats accumulation setting
  `vm.stats.increment.metrics` to false until a better solution emerges.
  Since apache#5984, this is true and during the execution of listVM APIs the
  stats are clubbed/calculated which can immensely slow down list VM API
  calls.
- Fix UI that uses listVirtualMachinesMetrics to not call `stats` detail
  when in list view without metrics selected.

These changes see 2-4x gains in the listVirtualMachines APIs call and in
the UI. For environment where code changes are not possible, disabling
`vm.stats.increment.metrics` global setting saw 2-4x speed gain in the
list API calls.

Signed-off-by: Rohit Yadav <[email protected]>
rohityadavcloud added a commit to shapeblue/cloudstack that referenced this pull request Jun 5, 2024
- Changes behaviour of details param handling via global setting:
  - listVirtualMachines API: when the details param is not provided, it returns `all` details excluding/including `stats` which is controllable by a new global setting `list.vm.default.details.stats`
  - listVirtualMachinesMetrics API: when the details param is not provided, it uses `all` details including `stats`
- Users who are affected by the stats related change, can have backward compatibility at the higher-cost of listVirtualMachines API response time by setting `list.vm.default.details.stats` to true
- Remove ConfigKey vm.stats.increment.metrics.in.memory which was renamed to `vm.stats.increment.metrics` in apache#5984 and also remove unused/unnecessary global settings via upgrade path
- Changes default value of VM stats accumulation setting `vm.stats.increment.metrics` to false until a better solution emerges. Since apache#5984, this is true and during the execution of listVM APIs the stats are clubbed/calculated which can immensely slow down list VM API calls.
- Fix UI that uses listVirtualMachinesMetrics to not call `stats` detail when in list view without metrics selected.

Signed-off-by: Rohit Yadav <[email protected]>
rohityadavcloud added a commit that referenced this pull request Jun 14, 2024
#9177)

- Changes behaviour of details param handling via global setting:
  - listVirtualMachines API: when the details param is not provided, it returns whether stats are returned controlled by a new global setting `list.vm.default.details.stats`
  - listVirtualMachinesMetrics API: when the details param is not provided, it uses `all` details including `stats`
- Users who are affected slow performance of the listVirtualMachines API response time can set `list.vm.default.details.stats` to `false`
- Remove ConfigKey vm.stats.increment.metrics.in.memory which was renamed to `vm.stats.increment.metrics` in #5984 and also remove unused/unnecessary global settings via upgrade path
- Changes default value of VM stats accumulation setting `vm.stats.increment.metrics` to false until a better solution emerges. Since #5984, this is true and during the execution of listVM APIs the stats are clubbed/calculated which can immensely slow down list VM API calls. Any costly operations such as summing of stats shouldn't be done during the course of a synchronous API, such as the list VM API.
- Fix UI that uses listVirtualMachinesMetrics to not call `stats` detail when in list view without metrics selected.

Signed-off-by: Rohit Yadav <[email protected]>
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jun 17, 2024
apache#9177)

- Changes behaviour of details param handling via global setting:
  - listVirtualMachines API: when the details param is not provided, it returns whether stats are returned controlled by a new global setting `list.vm.default.details.stats`
  - listVirtualMachinesMetrics API: when the details param is not provided, it uses `all` details including `stats`
- Users who are affected slow performance of the listVirtualMachines API response time can set `list.vm.default.details.stats` to `false`
- Remove ConfigKey vm.stats.increment.metrics.in.memory which was renamed to `vm.stats.increment.metrics` in apache#5984 and also remove unused/unnecessary global settings via upgrade path
- Changes default value of VM stats accumulation setting `vm.stats.increment.metrics` to false until a better solution emerges. Since apache#5984, this is true and during the execution of listVM APIs the stats are clubbed/calculated which can immensely slow down list VM API calls. Any costly operations such as summing of stats shouldn't be done during the course of a synchronous API, such as the list VM API.
- Fix UI that uses listVirtualMachinesMetrics to not call `stats` detail when in list view without metrics selected.

Signed-off-by: Rohit Yadav <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Persistence of VM stats

7 participants