cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject git commit: updated refs/heads/master to fee2bfc
Date Thu, 14 Aug 2014 05:32:13 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 56071844d -> fee2bfce4


CLOUDSTACK-7344:VOLUME.DELETE usage event missing for VM's in ERROR
state.

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

Branch: refs/heads/master
Commit: fee2bfce4935518880e7bb029eb28625c6f8dbf1
Parents: 5607184
Author: Min Chen <min.chen@citrix.com>
Authored: Wed Aug 13 22:15:47 2014 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Wed Aug 13 22:15:47 2014 -0700

----------------------------------------------------------------------
 .../cloudstack/engine/orchestration/VolumeOrchestrator.java   | 3 +++
 server/src/com/cloud/vm/UserVmManagerImpl.java                | 7 +++----
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fee2bfce/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 098f976..e28da48 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -1373,6 +1373,9 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
             } else {
                 volService.destroyVolume(volume.getId());
             }
+            // publish usage event for the volume
+            UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_DELETE, volume.getAccountId(),
volume.getDataCenterId(), volume.getId(), volume.getName(),
+                    Volume.class.getName(), volume.getUuid(), volume.isDisplayVolume());
         } catch (Exception e) {
             s_logger.debug("Failed to destroy volume" + volume.getId(), e);
             throw new CloudRuntimeException("Failed to destroy volume" + volume.getId(),
e);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fee2bfce/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 77e7f0a..e5de11f 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -35,6 +35,9 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
+import org.apache.commons.codec.binary.Base64;
+import org.apache.log4j.Logger;
+
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.affinity.AffinityGroupService;
@@ -84,8 +87,6 @@ import org.apache.cloudstack.storage.command.DeleteCommand;
 import org.apache.cloudstack.storage.command.DettachCommand;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -4747,8 +4748,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
         // Detach, destroy and create the usage event for the old root volume.
         _volsDao.detachVolume(root.getId());
         volumeMgr.destroyVolume(root);
-        UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_DELETE, root.getAccountId(),
root.getDataCenterId(), root.getId(), root.getName(),
-                Volume.class.getName(), root.getUuid(), root.isDisplayVolume());
 
         // For VMware hypervisor since the old root volume is replaced by the new root volume,
force expunge old root volume if it has been created in storage
         if (vm.getHypervisorType() == HypervisorType.VMware) {


Mime
View raw message