cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [31/50] git commit: updated refs/heads/4.4 to d5220a8
Date Mon, 28 Jul 2014 14:04:43 GMT
CLOUDSTACK-6934: don't try to detach volume from host when volume was never allocated to a
primary storage

(cherry picked from commit 92fea032da08938749cde73e312370f1b9da1567)


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

Branch: refs/heads/4.4
Commit: 15ffec2632842b53811cdce4a17b3fb05b6571df
Parents: e988c91
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Wed Jun 18 09:59:23 2014 -0700
Committer: Daan Hoogland <daan@onecht.net>
Committed: Mon Jul 28 16:02:40 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/15ffec26/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 358b3bd..76281c6 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -866,9 +866,11 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         if (volumesForVm != null) {
             for (VolumeVO volumeForVm : volumesForVm) {
                 VolumeInfo volumeInfo = volFactory.getVolume(volumeForVm.getId());
-                DataStore dataStore = dataStoreMgr.getDataStore(volumeForVm.getPoolId(),
DataStoreRole.Primary);
-
-                volService.disconnectVolumeFromHost(volumeInfo, host, dataStore);
+                // pool id can be null for the VM's volumes in Allocated state
+                if (volumeForVm.getPoolId() != null) {
+                    DataStore dataStore = dataStoreMgr.getDataStore(volumeForVm.getPoolId(),
DataStoreRole.Primary);
+                    volService.disconnectVolumeFromHost(volumeInfo, host, dataStore);
+                }
             }
         }
     }


Mime
View raw message