CLOUDSTACK-4651: Restarting management server when volume Snapshot is still in 
progress for root volume of a VM , then there is no way to restart VM since the 
startVM job is stuck forever since the volume is in "Snapshoting" state.

Change:
-If no volume of the VM is usable, VM cannot be deployed or started. Atleast 
ROOT volume should always be in usable state to start up the VM


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

Branch: refs/heads/master
Commit: 7416383fcd540d039b068e86d346265a25795263
Parents: f2ea699
Author: Prachi Damle <[email protected]>
Authored: Fri Sep 13 14:56:43 2013 -0700
Committer: Prachi Damle <[email protected]>
Committed: Wed Sep 18 16:52:04 2013 -0700

----------------------------------------------------------------------
 server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7416383f/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java 
b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
index cdd46ce..8b0257f 100644
--- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
+++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
@@ -1052,6 +1052,11 @@ public class DeploymentPlanningManagerImpl extends 
ManagerBase implements Deploy
         Map<Volume, List<StoragePool>> suitableVolumeStoragePools = new 
HashMap<Volume, List<StoragePool>>();
         List<Volume> readyAndReusedVolumes = new ArrayList<Volume>();
 
+        // There should be atleast the ROOT volume of the VM in usable state
+        if (volumesTobeCreated.isEmpty()) {
+            throw new CloudRuntimeException("Unable to create deployment, no 
usable volumes found for the VM");
+        }
+
         // for each volume find list of suitable storage pools by calling the
         // allocators
         for (VolumeVO toBeCreated : volumesTobeCreated) {

Reply via email to