Updated Branches:
  refs/heads/4.3 dd3a511c6 -> ee82870aa

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.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ee82870a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ee82870a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ee82870a

Branch: refs/heads/4.3
Commit: ee82870aa25b4202d2fbed21a41956cc1870d776
Parents: dd3a511
Author: Nitin Mehta <[email protected]>
Authored: Wed Dec 4 10:53:42 2013 -0800
Committer: Nitin Mehta <[email protected]>
Committed: Wed Dec 4 10:53:42 2013 -0800

----------------------------------------------------------------------
 .../cloudstack/engine/orchestration/VolumeOrchestrator.java     | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ee82870a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
----------------------------------------------------------------------
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 6a74912..0f9e1e4 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;
 

Reply via email to