Conversation
|
@blueorangutan package |
|
@vishesh92 a [SL] 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. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## 4.19 #8545 +/- ##
============================================
+ Coverage 20.99% 30.83% +9.83%
- Complexity 19683 34073 +14390
============================================
Files 4849 5346 +497
Lines 324441 375431 +50990
Branches 45573 54600 +9027
============================================
+ Hits 68121 115763 +47642
+ Misses 246563 244370 -2193
- Partials 9757 15298 +5541
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8409 |
|
@blueorangutan test |
|
@vishesh92 a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
engine/schema/src/main/java/com/cloud/vm/dao/VMInstanceDaoImpl.java
Outdated
Show resolved
Hide resolved
|
@blueorangutan package |
87a543b to
bb812aa
Compare
|
@vishesh92 a [SL] 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. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8493 |
|
@blueorangutan test matrix |
|
@sureshanaparti a [SL] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-9045)
|
|
[SF] Trillian test result (tid-9044)
|
…n' is kept after vm stop and not updated later)
…tate sync to proper state / host
bb812aa to
007b0a8
Compare
|
@blueorangutan package |
|
@vishesh92 a [SL] 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. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8535 |
|
@blueorangutan test |
|
@blueorangutan test |
|
@vishesh92 a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-9130)
|
kiranchavala
left a comment
There was a problem hiding this comment.
LGTM , Tested manually using the sql query with all hypervisors types kvm,vmware
mysql>update vm_instance set state="Stopped",host_id=null,last_host_id=1 where id=3;
Logs before the fix
2024-02-14 08:39:56,563 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-18:null) (logid:) Process host VM state report from ping process. host: 1
2024-02-14 08:39:56,568 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-18:null) (logid:) Process VM state report. host: 1, number of records in report: 4
2024-02-14 08:39:56,568 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-18:null) (logid:) VM state report. host: 1, vm id: 1, power state: PowerOn
2024-02-14 08:39:56,570 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-18:null) (logid:) VM state report. host: 1, vm id: 2, power state: PowerOn
2024-02-14 08:39:56,571 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-18:null) (logid:) VM state report. host: 1, vm id: 3, power state: PowerOn
2024-02-14 08:39:56,572 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-18:null) (logid:) VM state report. host: 1, vm id: 4, power state: PowerOn
2024-02-14 08:39:56,574 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-18:null) (logid:) Done with process of VM state report. host: 1
2024-02-14 08:40:56,567 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-13:null) (logid:) Process host VM state report from ping process. host: 1
2024-02-14 08:40:56,573 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-13:null) (logid:) Process VM state report. host: 1, number of records in report: 4
2024-02-14 08:40:56,573 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-13:null) (logid:) VM state report. host: 1, vm id: 1, power state: PowerOn
2024-02-14 08:40:56,574 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-13:null) (logid:) VM state report. host: 1, vm id: 2, power state: PowerOn
2024-02-14 08:40:56,576 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-13:null) (logid:) VM state report. host: 1, vm id: 3, power state: PowerOn
2024-02-14 08:40:56,578 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-13:null) (logid:) VM state report. host: 1, vm id: 4, power state: PowerOn
2024-02-14 08:40:56,580 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-13:null) (logid:) Done with process of VM state report. host: 1
Logs after fix
[root@ol8 ~]# tail -f /var/log/cloudstack/management/management-server.log |grep -i "c.c.v.VirtualMachinePowerStateSyncImpl"
2024-02-14 08:43:37,084 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-4:null) (logid:) Process host VM state report from ping process. host: 2
2024-02-14 08:43:37,088 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-4:null) (logid:) Process VM state report. host: 2, number of records in report: 3
2024-02-14 08:43:37,088 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-4:null) (logid:) VM state report. host: 2, vm id: 1, power state: PowerOn
2024-02-14 08:43:37,089 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-4:null) (logid:) VM state report. host: 2, vm id: 2, power state: PowerOn
2024-02-14 08:43:37,090 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-4:null) (logid:) VM state report. host: 2, vm id: 3, power state: PowerOn
2024-02-14 08:43:37,092 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-4:null) (logid:) Done with process of VM state report. host: 2
2024-02-14 08:44:26,830 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-17:null) (logid:) Process host VM state report from ping process. host: 1
2024-02-14 08:44:26,832 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-17:null) (logid:) Process VM state report. host: 1, number of records in report: 1
2024-02-14 08:44:26,832 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-17:null) (logid:) VM state report. host: 1, vm id: 4, power state: PowerOn
2024-02-14 08:44:26,835 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-17:null) (logid:) Done with process of VM state report. host: 1
2024-02-14 08:44:37,059 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-2:null) (logid:) Process host VM state report from ping process. host: 2
2024-02-14 08:44:37,063 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-2:null) (logid:) Process VM state report. host: 2, number of records in report: 3
2024-02-14 08:44:37,063 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-2:null) (logid:) VM state report. host: 2, vm id: 1, power state: PowerOn
2024-02-14 08:44:37,064 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-2:null) (logid:) VM state report. host: 2, vm id: 2, power state: PowerOn
2024-02-14 08:44:37,066 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-2:null) (logid:) VM state report. host: 2, vm id: 3, power state: PowerOn
2024-02-14 08:44:37,070 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-2:null) (logid:) VM state report is updated. host: 2, vm id: 3, power state: PowerOn
2024-02-14 08:44:37,117 DEBUG [c.c.v.VirtualMachinePowerStateSyncImpl] (AgentManager-Handler-2:null) (logid:) Done with process of VM state report. host: 2
|
Many smoketests are failing @vishesh92 @kiranchavala |
|
@blueorangutan package |
|
@rohityadavcloud a [SL] 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. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8659 |
|
@blueorangutan test matrix |
|
@vishesh92 a [SL] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests |
| if (VirtualMachine.Type.User.equals(vm.type) && ResourceCountRunningVMsonly.value()) { | ||
| ServiceOfferingVO offering = _offeringDao.findById(vm.getId(), vm.getServiceOfferingId()); | ||
| resourceCountDecrement(vm.getAccountId(),new Long(offering.getCpu()), new Long(offering.getRamSize())); | ||
| resourceCountDecrement(vm.getAccountId(), offering.getCpu().longValue(), offering.getRamSize().longValue()); |
There was a problem hiding this comment.
in the database these fields are nullable. Are we sure these are not potential NPE´s?
There was a problem hiding this comment.
The code below gets cpu/ram from user_vm_details if it is null in service offering.
ServiceOfferingVO offering = _offeringDao.findById(vm.getId(), vm.getServiceOfferingId());
There was a problem hiding this comment.
As Wei said, it's handled in OfferingDao's findById.
There was a problem hiding this comment.
new Long(null) also throws a NPE. So, this is not really relevant to this PR but a minor code improvement.
There was a problem hiding this comment.
yes, the method has been used in many places, it works well.
No need to add a null check I think.
anyway , good question @DaanHoogland
There was a problem hiding this comment.
ok, guys, I agree i think, if we get an NPE a check would not help us take measure against it. decreasing by 0 (zero) does not make sense either.
Any improvement on this would be out of scope for this PR and I think it might not be high prio (just good to keep in mind)
There was a problem hiding this comment.
yeah
A check can be added in the code Vishesh shared above.
For example
return validateOfferingParameters(offering)
|
[SF] Trillian test result (tid-9217)
|
|
[SF] Trillian test result (tid-9219)
|
|
[SF] Trillian test result (tid-9218)
|
Co-authored-by: Suresh Kumar Anaparti <suresh.anaparti@shapeblue.com>
…ent NPE followup of discussion in apache#8545 (comment)
Description
We discovered this issue in one of our envs where a VM was running on the host but the state of the VM in the host was Stopped. Ideally power reports should have fixed this, but it didn't.
This PR addresses below, to ensure power state in sync with the instance state.
It sends an update (publishes a message on Topic
VM_POWER_STATE). The subscriber on this topic transits the VM as per the state & powerstate.I wasn't able to reproduce the issue. But updating the entry for vm_instance in the database helps.
It should switch back to 'Running' after next power state update, but it doesn't happen.
Types of changes
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
After these changes, I was not able to reproduce the issue by running update query mentioned above.
How did you try to break this feature and the system with this change?