From 5f16bf746bdb98f4efdef0f17fed0a192a03f3cb Mon Sep 17 00:00:00 2001 From: Mike Tutkowski Date: Thu, 29 Jan 2015 23:11:29 -0700 Subject: [PATCH] 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. --- server/src/com/cloud/storage/StoragePoolAutomationImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/storage/StoragePoolAutomationImpl.java b/server/src/com/cloud/storage/StoragePoolAutomationImpl.java index e08646704ce..92ed114a3a4 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);