mirror of https://github.com/apache/cloudstack.git
bug 8124: log VM.STOP usage event for user Vms only
status 8124: resolved fixed
This commit is contained in:
parent
00ebbbed6d
commit
e5b2b396ec
|
|
@ -824,8 +824,10 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager {
|
|||
if (!stopped) {
|
||||
throw new CloudRuntimeException("Unable to stop the virtual machine due to " + answer.getDetails());
|
||||
} else {
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VM_STOP, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getName(), vm.getServiceOfferingId(), vm.getTemplateId(), null);
|
||||
_usageEventDao.persist(usageEvent);
|
||||
if(vm.getType() == VirtualMachine.Type.User){
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VM_STOP, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getName(), vm.getServiceOfferingId(), vm.getTemplateId(), null);
|
||||
_usageEventDao.persist(usageEvent);
|
||||
}
|
||||
}
|
||||
vmGuru.finalizeStop(profile, answer);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue