use of com.cloud.consoleproxy.RunningHostInfoAgregator.ZoneHostInfo in project cosmic by MissionCriticalCloud.
the class ConsoleProxyManagerImpl method isZoneReady.
public boolean isZoneReady(final Map<Long, ZoneHostInfo> zoneHostInfoMap, final long dataCenterId) {
final ZoneHostInfo zoneHostInfo = zoneHostInfoMap.get(dataCenterId);
if (zoneHostInfo != null && isZoneHostReady(zoneHostInfo)) {
final VMTemplateVO template = this._templateDao.findSystemVMReadyTemplate(dataCenterId, HypervisorType.Any);
if (template == null) {
logger.debug("System vm template is not ready at data center " + dataCenterId + ", wait until it is ready to launch console proxy vm");
return false;
}
final TemplateDataStoreVO templateHostRef = this._vmTemplateStoreDao.findByTemplateZoneDownloadStatus(template.getId(), dataCenterId, VMTemplateStatus.DOWNLOADED);
if (templateHostRef != null) {
boolean useLocalStorage = false;
final Boolean useLocal = ConfigurationManagerImpl.SystemVMUseLocalStorage.valueIn(dataCenterId);
if (useLocal != null) {
useLocalStorage = useLocal.booleanValue();
}
final List<Pair<Long, Integer>> l = this._consoleProxyDao.getDatacenterStoragePoolHostInfo(dataCenterId, useLocalStorage);
if (l != null && l.size() > 0 && l.get(0).second().intValue() > 0) {
return true;
} else {
logger.debug("Primary storage is not ready, wait until it is ready to launch console proxy");
}
} else {
logger.debug("Zone host is ready, but console proxy template: " + template.getId() + " is not ready on secondary storage.");
}
}
return false;
}
use of com.cloud.consoleproxy.RunningHostInfoAgregator.ZoneHostInfo in project cosmic by MissionCriticalCloud.
the class SecondaryStorageManagerImpl method isZoneReady.
public boolean isZoneReady(final Map<Long, ZoneHostInfo> zoneHostInfoMap, final long dataCenterId) {
final ZoneHostInfo zoneHostInfo = zoneHostInfoMap.get(dataCenterId);
if (zoneHostInfo != null && (zoneHostInfo.getFlags() & RunningHostInfoAgregator.ZoneHostInfo.ROUTING_HOST_MASK) != 0) {
final VMTemplateVO template = this._templateDao.findSystemVMReadyTemplate(dataCenterId, HypervisorType.Any);
if (template == null) {
logger.debug("System vm template is not ready at data center " + dataCenterId + ", wait until it is ready to launch secondary storage vm");
return false;
}
final List<DataStore> stores = this._dataStoreMgr.getImageStoresByScope(new ZoneScope(dataCenterId));
if (stores.size() < 1) {
logger.debug("No image store added in zone " + dataCenterId + ", wait until it is ready to launch secondary storage vm");
return false;
}
final DataStore store = this.templateMgr.getImageStore(dataCenterId, template.getId());
if (store == null) {
logger.debug("No secondary storage available in zone " + dataCenterId + ", wait until it is ready to launch secondary storage vm");
return false;
}
boolean useLocalStorage = false;
final Boolean useLocal = ConfigurationManagerImpl.SystemVMUseLocalStorage.valueIn(dataCenterId);
if (useLocal != null) {
useLocalStorage = useLocal.booleanValue();
}
final List<Pair<Long, Integer>> l = this._storagePoolHostDao.getDatacenterStoragePoolHostInfo(dataCenterId, !useLocalStorage);
if (l != null && l.size() > 0 && l.get(0).second().intValue() > 0) {
return true;
} else {
logger.debug("Primary storage is not ready, wait until it is ready to launch secondary storage vm. dcId: " + dataCenterId + ", " + ConfigurationManagerImpl.SystemVMUseLocalStorage.key() + ": " + useLocalStorage + ". " + "If you want to use local storage to start SSVM, need to set " + ConfigurationManagerImpl.SystemVMUseLocalStorage.key() + " to true");
}
}
return false;
}
Aggregations