CLOUDSTACK-2923: Delete Secondary storage of a Zone was giving NPE bcz we were still refering to the object. Instead log that the cpvm and ssvm cant be created bcz sec storage is not available

This commit is contained in:
Nitin Mehta 2012-11-23 14:11:51 +05:30
parent 63494f8dfd
commit d8a235ee31

View File

@ -945,6 +945,13 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
VMTemplateVO template = _templateDao.findSystemVMTemplate(dataCenterId);
HostVO secondaryStorageHost = this.templateMgr.getSecondaryStorageHost(dataCenterId);
boolean templateReady = false;
if (secondaryStorageHost == null) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("No secondary storage available in zone " + dataCenterId + ", wait until it is ready to launch secondary storage vm");
}
return false;
}
if (template != null && secondaryStorageHost != null) {
VMTemplateHostVO templateHostRef = _vmTemplateHostDao.findByHostTemplate(secondaryStorageHost.getId(), template.getId());