attachISO can be done when SSVM is down

This commit is contained in:
anthony 2011-02-03 19:06:54 -08:00
parent 2ef2cc9cf9
commit 9e858992de
3 changed files with 13 additions and 2 deletions

View File

@ -137,5 +137,7 @@ public interface HostDao extends GenericDao<HostVO, Long> {
void loadDetails(HostVO host);
void loadHostTags(HostVO host);
void loadHostTags(HostVO host);
List<HostVO> listSecondaryStorageHosts(long dcId);
}

View File

@ -223,6 +223,15 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
}
}
@Override
public List<HostVO> listSecondaryStorageHosts(long dcId) {
SearchCriteria sc = TypeDcSearch.create();
sc.setParameters("type", Host.Type.SecondaryStorage);
sc.setParameters("dc", dcId);
return listActiveBy(sc);
}
@Override
public List<HostVO> listSecondaryStorageHosts() {
SearchCriteria sc = TypeSearch.create();

View File

@ -1054,7 +1054,7 @@ public class StorageManagerImpl implements StorageManager {
public String getAbsoluteIsoPath(long templateId, long dataCenterId) {
String isoPath = null;
List<HostVO> storageHosts = _hostDao.listBy(Host.Type.SecondaryStorage, dataCenterId);
List<HostVO> storageHosts = _hostDao.listSecondaryStorageHosts(dataCenterId);
if (storageHosts != null) {
for (HostVO storageHost : storageHosts) {
VMTemplateHostVO templateHostVO = _vmTemplateHostDao.findByHostTemplate(storageHost.getId(), templateId);