mirror of https://github.com/apache/cloudstack.git
Add pre/post-state transition status to messages published on event bus by UserVmStateListener. Allow system VM resource state post-transitions to be published.
This commit is contained in:
parent
06d510abcc
commit
9c4de764f7
|
|
@ -77,12 +77,12 @@ public class UserVmStateListener implements StateListener<State, VirtualMachine.
|
|||
return false;
|
||||
}
|
||||
|
||||
pubishOnEventBus(event.name(), "postStateTransitionEvent", vo, oldState, newState);
|
||||
|
||||
if (vo.getType() != VirtualMachine.Type.User) {
|
||||
return true;
|
||||
}
|
||||
|
||||
pubishOnEventBus(event.name(), "postStateTransitionEvent", vo, oldState, newState);
|
||||
|
||||
if (VirtualMachine.State.isVmCreated(oldState, event, newState)) {
|
||||
generateUsageEvent(vo.getServiceOfferingId(), vo, EventTypes.EVENT_VM_CREATE);
|
||||
} else if (VirtualMachine.State.isVmStarted(oldState, event, newState)) {
|
||||
|
|
@ -128,6 +128,7 @@ public class UserVmStateListener implements StateListener<State, VirtualMachine.
|
|||
eventDescription.put("id", vo.getUuid());
|
||||
eventDescription.put("old-state", oldState.name());
|
||||
eventDescription.put("new-state", newState.name());
|
||||
eventDescription.put("status", status);
|
||||
|
||||
String eventDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").format(new Date());
|
||||
eventDescription.put("eventDateTime", eventDate);
|
||||
|
|
|
|||
Loading…
Reference in New Issue