DaanHoogland commented on code in PR #7878:
URL: https://github.com/apache/cloudstack/pull/7878#discussion_r1302589971


##########
engine/orchestration/src/main/java/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java:
##########
@@ -162,6 +177,8 @@ private void processReport(long hostId, Map<Long, 
VirtualMachine.PowerState> tra
                         }
 
                         _messageBus.publish(null, 
VirtualMachineManager.Topics.VM_POWER_STATE, PublishScope.GLOBAL, 
instance.getId());
+                        ActionEventUtils.onActionEvent(User.UID_SYSTEM, 
Account.ACCOUNT_ID_SYSTEM,instance.getDomainId(),
+                                EventTypes.EVENT_VM_STOP, "Out of band VM 
power off", instance.getId(), ApiCommandResourceType.VirtualMachine.toString());

Review Comment:
   I think this event should be spewed at 
`handlePowerOffReportWithNoPendingJobsOnVM` and countered by a `EVENT_VM_START` 
in `handlePowerOnReportWithNoPendingJobsOnVM` both in 
`VirtualMachineManagerImpl`. Or alternatively a proper place to handle the OOB 
start event in this class should be found. I think this is not a big deal for 
you @mlsorensen , but for people using event/usgae server based billing it 
would be. If an OOB migration happens their billing for this VM would/could 
stop or continue based on the order of events.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to