mirror of https://github.com/apache/cloudstack.git
bug 7034,6869: fixing the storage pools issue, and the npe at load balancer if the router is not found.
status 7034, 6869: resolved fixed
This commit is contained in:
parent
1eef924c6c
commit
364e1e1c4a
|
|
@ -1180,8 +1180,13 @@ public class NetworkManagerImpl implements NetworkManager, DomainRouterService {
|
|||
}
|
||||
|
||||
DomainRouterVO syncObject = _routerMgr.getRouter(loadBalancer.getIpAddress());
|
||||
cmd.synchronizeCommand("Router", syncObject.getId());
|
||||
|
||||
if(syncObject == null){
|
||||
throw new InvalidParameterValueException("Failed to assign to load balancer " + loadBalancerId + ", the domain router was not found at "+loadBalancer.getIpAddress());
|
||||
}
|
||||
else{
|
||||
cmd.synchronizeCommand("Router", syncObject.getId());
|
||||
}
|
||||
|
||||
// Permission check...
|
||||
Account account = UserContext.current().getAccount();
|
||||
if (account != null) {
|
||||
|
|
|
|||
|
|
@ -2160,17 +2160,10 @@ public class StorageManagerImpl implements StorageManager {
|
|||
s_logger.error(msg);
|
||||
throw new ResourceUnavailableException(msg);
|
||||
}
|
||||
|
||||
primaryStorage = _storagePoolDao.findById(primaryStorageId);
|
||||
if(primaryStorage == null)
|
||||
{
|
||||
s_logger.warn("The primary storage does not exist");
|
||||
throw new InvalidParameterValueException("Primary storage doesn't exist");
|
||||
}
|
||||
|
||||
// if (!primaryStorage.getStatus().equals(Status.Up)) {
|
||||
// throw new InvalidParameterValueException("Primary storage with id " + primaryStorageId + " is not ready for migration, as the status is:" + primaryStorage.getStatus().toString());
|
||||
// }
|
||||
if (!primaryStorage.getStatus().equals(Status.Up) && !primaryStorage.getStatus().equals(Status.ErrorInMaintenance)) {
|
||||
throw new InvalidParameterValueException("Primary storage with id " + primaryStorageId + " is not ready for migration, as the status is:" + primaryStorage.getStatus().toString());
|
||||
}
|
||||
//set the pool state to prepare for maintenance
|
||||
primaryStorage.setStatus(Status.PrepareForMaintenance);
|
||||
_storagePoolDao.persist(primaryStorage);
|
||||
|
|
@ -2195,7 +2188,7 @@ public class StorageManagerImpl implements StorageManager {
|
|||
continue;
|
||||
|
||||
//shut down the running vms
|
||||
if(vmInstance.getState().equals(State.Running) || vmInstance.getState().equals(State.Stopped) || vmInstance.getState().equals(State.Stopping) || vmInstance.getState().equals(State.Starting))
|
||||
if(vmInstance.getState().equals(State.Running) || vmInstance.getState().equals(State.Starting))
|
||||
{
|
||||
|
||||
//if the instance is of type consoleproxy, call the console proxy
|
||||
|
|
|
|||
Loading…
Reference in New Issue