Fix metrics stats for VMs not running#5633
Fix metrics stats for VMs not running#5633GutoVeronezi merged 4 commits intoapache:mainapache/cloudstack:mainfrom scclouds:fix-metrics-stats-for-vms-not-runningscclouds/cloudstack:fix-metrics-stats-for-vms-not-runningCopy head branch name to clipboard
Conversation
|
@sureshanaparti and @DaanHoogland |
fc07f07 to
a78af60
Compare
|
@blueorangutan package |
|
@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 1646 |
|
@blueorangutan test |
|
@sureshanaparti a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-2502)
|
| */ | ||
| protected void cleanUpVirtualMachineStats() { | ||
| List<Long> allRunningVmIds = new ArrayList<Long>(); | ||
| for (UserVmVO vm : _userVmDao.listAllRunning()) { |
There was a problem hiding this comment.
VM stats are captured for running VMs only
removeVirtualMachineStats() removes the vm stat if the VM is stopped/destroyed after adding to the stats, so no need for this cleanup method.
There was a problem hiding this comment.
Thanks for the review @sureshanaparti!
The cleanUpVirtualMachineStats() method is important to maintain consistency of the metric stats shown by ACS even when there are cases of VMs changing state unexpectedly (e.g., when a VM crashes; or when the VM is stopped directly by the hypervisor interface, etc). In these cases the removeVirtualMachineStats() method is not executed, so the cleanUpVirtualMachineStats() method does its job.
|
Any update about this PR? |
|
code looks good, let's retest |
|
@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✖️ el7 ✖️ el8 ✔️ debian ✖️ suse15. SL-JID 1734 |
|
@blueorangutan package |
|
@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✖️ el8 ✔️ debian ✖️ suse15. SL-JID 1739 |
…metrics-stats-for-vms-not-running
|
@blueorangutan package |
|
@joseflauzino a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 1749 |
|
@blueorangutan test |
|
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-2572)
|
GutoVeronezi
left a comment
There was a problem hiding this comment.
LGTM
@DaanHoogland can we merge this?
|
@GutoVeronezi yes, I think @sureshanaparti's question was answered to satisfaction as well. let's merge. |
|
@joseflauzino Is this good to go in 4.16.1? If so, please rebase with '4.16'. |
|
@sureshanaparti for me we can keep it in the main (4.17). |
* Fix metrics stats for VMs that are not running * Improves the way to get vmIdsToRemoveStats * Improves test Co-authored-by: José Flauzino <jose@scclouds.com.br>
Description
This PR fixes the behavior of the stats collector with respect to VMs that are not running. The need for this is that if a running VM has a state change for some reason, ACS keeps showing the latest metrics stats collected.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
How Has This Been Tested?
Using ACS UI, I performed the following steps: