From ee82870aa25b4202d2fbed21a41956cc1870d776 Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Wed, 4 Dec 2013 10:53:42 -0800 Subject: [PATCH] CLOUDSTACK-5349: Volume create usage event and resource count werent getting registered. Check its type rather than it is UserVm since the code is coming from VirtualMachineManager. --- .../cloudstack/engine/orchestration/VolumeOrchestrator.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java index 6a74912c7ce..0f9e1e4a954 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java @@ -567,8 +567,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati vol = _volsDao.persist(vol); // Save usage event and update resource count for user vm volumes - if (vm instanceof UserVm) { - + if (vm.getType() == VirtualMachine.Type.User) { UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, vol.getAccountId(), vol.getDataCenterId(), @@ -619,7 +618,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati vol = _volsDao.persist(vol); // Create event and update resource count for volumes if vm is a user vm - if (vm instanceof UserVm) { + if (vm.getType() == VirtualMachine.Type.User) { Long offeringId = null;