From 103278415ee808351159ee3b93da9b76eec636e1 Mon Sep 17 00:00:00 2001 From: abhishek Date: Thu, 4 Nov 2010 18:08:27 -0700 Subject: [PATCH] bug 7035: allowing cancel maintenance for all sp states except UP status 7035: resolved fixed --- server/src/com/cloud/storage/StorageManagerImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index 1c84aca2307..6e5c3cd23d1 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -2360,8 +2360,8 @@ public class StorageManagerImpl implements StorageManager { throw new ResourceUnavailableException(msg); } - if (!primaryStorage.getStatus().equals(Status.Maintenance)) { - throw new StorageUnavailableException("Primary storage with id " + primaryStorageId + " is not ready to complete migration, as the status is:" + primaryStorage.getStatus().toString()+".Re-run maintenance."); + if (primaryStorage.getStatus().equals(Status.Up)) { + throw new StorageUnavailableException("Primary storage with id " + primaryStorageId + " is not ready to complete migration, as the status is:" + primaryStorage.getStatus().toString()); } //2. Get a list of all the volumes within this storage pool @@ -2370,7 +2370,7 @@ public class StorageManagerImpl implements StorageManager { //3. If the volume is not removed AND not destroyed, start the vm corresponding to it for(VolumeVO volume: allVolumes) { - if((!volume.destroyed) && (volume.removed==null)) + if((!volume.destroyed) && (volume.removed == null)) { VMInstanceVO vmInstance = _vmInstanceDao.findById(volume.getInstanceId()); @@ -2383,7 +2383,7 @@ public class StorageManagerImpl implements StorageManager { //create a dummy event long eventId = saveScheduledEvent(User.UID_SYSTEM, Account.ACCOUNT_ID_SYSTEM, EventTypes.EVENT_PROXY_START, "starting console proxy with Id: "+vmInstance.getId()); - if(_consoleProxyMgr.startProxy(vmInstance.getId(), eventId)==null) + if(_consoleProxyMgr.startProxy(vmInstance.getId(), eventId) == null) { String msg = "There was an error starting the console proxy id: "+vmInstance.getId()+" on storage pool, cannot complete primary storage maintenance"; s_logger.warn(msg); @@ -2398,7 +2398,7 @@ public class StorageManagerImpl implements StorageManager { //create a dummy event long eventId = saveScheduledEvent(User.UID_SYSTEM, Account.ACCOUNT_ID_SYSTEM, EventTypes.EVENT_SSVM_START, "starting ssvm with Id: "+vmInstance.getId()); - if(_secStorageMgr.startSecStorageVm(vmInstance.getId(), eventId)==null) + if(_secStorageMgr.startSecStorageVm(vmInstance.getId(), eventId) == null) { String msg = "There was an error starting the ssvm id: "+vmInstance.getId()+" on storage pool, cannot complete primary storage maintenance"; s_logger.warn(msg); @@ -2414,7 +2414,7 @@ public class StorageManagerImpl implements StorageManager { long eventId = saveScheduledEvent(User.UID_SYSTEM, Account.ACCOUNT_ID_SYSTEM, EventTypes.EVENT_VM_START, "starting ssvm with Id: "+vmInstance.getId()); try { - if(_userVmMgr.start(vmInstance.getId(), eventId)==null) + if(_userVmMgr.start(vmInstance.getId(), eventId) == null) { String msg = "There was an error starting the ssvm id: "+vmInstance.getId()+" on storage pool, cannot complete primary storage maintenance"; s_logger.warn(msg);