When canceling maintenance mode, the logic was looking at the id field of the 
work object instead of the id field of the VM object.

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

Branch: refs/heads/master
Commit: 5f16bf746bdb98f4efdef0f17fed0a192a03f3cb
Parents: 31f67c2
Author: Mike Tutkowski <[email protected]>
Authored: Thu Jan 29 23:11:29 2015 -0700
Committer: Mike Tutkowski <[email protected]>
Committed: Thu Jan 29 23:11:29 2015 -0700

----------------------------------------------------------------------
 server/src/com/cloud/storage/StoragePoolAutomationImpl.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5f16bf74/server/src/com/cloud/storage/StoragePoolAutomationImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StoragePoolAutomationImpl.java 
b/server/src/com/cloud/storage/StoragePoolAutomationImpl.java
index e086467..92ed114 100644
--- a/server/src/com/cloud/storage/StoragePoolAutomationImpl.java
+++ b/server/src/com/cloud/storage/StoragePoolAutomationImpl.java
@@ -371,13 +371,14 @@ public class StoragePoolAutomationImpl implements 
StoragePoolAutomation {
 
                 // if the instance is of type user vm, call the user vm manager
                 if (vmInstance.getType().equals(VirtualMachine.Type.User)) {
-                    UserVmVO userVm = userVmDao.findById(vmInstance.getId());
                     // check if the vm has a root volume. If not, remove the 
item from the queue, the vm should be
                     // started only when it has at least one root volume 
attached to it
                     // don't allow to start vm that doesn't have a root volume
-                    if (volumeDao.findByInstanceAndType(work.getId(), 
Volume.Type.ROOT).isEmpty()) {
+                    if (volumeDao.findByInstanceAndType(vmInstance.getId(), 
Volume.Type.ROOT).isEmpty()) {
                         _storagePoolWorkDao.remove(work.getId());
                     } else {
+                        UserVmVO userVm = 
userVmDao.findById(vmInstance.getId());
+
                         vmMgr.advanceStart(userVm.getUuid(), null, null);
                         work.setStartedAfterMaintenance(true);
                         _storagePoolWorkDao.update(work.getId(), work);

Reply via email to