bug 10423: agent in ssvm needs to add default keystore, as we copying templates through https://**realhostip.**

status 10423: resolved fixed
This commit is contained in:
Edison Su 2011-06-24 14:44:41 -04:00
parent 8da6578d76
commit 0dacd3913a
4 changed files with 22 additions and 4 deletions

View File

@ -60,4 +60,4 @@ then
maxmem=$eightypcnt
fi
java -mx${maxmem}m -cp $CP com.cloud.agent.AgentShell $keyvalues $@
java -Djavax.net.ssl.trustStore=./certs/realhostip.keystore -mx${maxmem}m -cp $CP com.cloud.agent.AgentShell $keyvalues $@

View File

@ -507,7 +507,7 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, Manager {
return ssHost;
} else if ( ssHost.getType() == Host.Type.SecondaryStorage) {
Long dcId = ssHost.getDataCenterId();
List<HostVO> ssAHosts = _hostDao.listBy(Host.Type.SecondaryStorageVM, dcId);
List<HostVO> ssAHosts = _hostDao.listSecondaryStorageVM(dcId);
if (ssAHosts == null || ssAHosts.isEmpty() ) {
return null;
}
@ -532,7 +532,7 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, Manager {
private long sendToSSVM(final long dcId, final Command cmd, final Listener listener) {
List<HostVO> ssAHosts = _hostDao.listBy(Host.Type.SecondaryStorageVM, dcId);
List<HostVO> ssAHosts = _hostDao.listSecondaryStorageVM(dcId);
if (ssAHosts == null || ssAHosts.isEmpty() ) {
return -1;
}
@ -546,7 +546,7 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, Manager {
}
private Answer sendToSSVM(final long dcId, final Command cmd) {
List<HostVO> ssAHosts = _hostDao.listByTypeDataCenter(Host.Type.SecondaryStorageVM, dcId);
List<HostVO> ssAHosts = _hostDao.listSecondaryStorageVM(dcId);
if (ssAHosts == null || ssAHosts.isEmpty() ) {
return new Answer(cmd, false, "can not find secondary storage VM agent for data center " + dcId);
}

View File

@ -182,4 +182,6 @@ public interface HostDao extends GenericDao<HostVO, Long> {
List<HostVO> listAllSecondaryStorageHosts(long dataCenterId);
List<HostVO> listByManagementServer(long msId);
List<HostVO> listSecondaryStorageVM(long dcId);
}

View File

@ -95,6 +95,7 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
protected final SearchBuilder<HostVO> DirectConnectSearch;
protected final SearchBuilder<HostVO> ManagedDirectConnectSearch;
protected final SearchBuilder<HostVO> ManagedRoutingServersSearch;
protected final SearchBuilder<HostVO> SecondaryStorageVMSearch;
protected final GenericSearchBuilder<HostVO, Long> HostsInStatusSearch;
protected final GenericSearchBuilder<HostVO, Long> CountRoutingByDc;
@ -143,6 +144,12 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
TypeDcSearch.and("type", TypeDcSearch.entity().getType(), SearchCriteria.Op.EQ);
TypeDcSearch.and("dc", TypeDcSearch.entity().getDataCenterId(), SearchCriteria.Op.EQ);
TypeDcSearch.done();
SecondaryStorageVMSearch = createSearchBuilder();
SecondaryStorageVMSearch.and("type", SecondaryStorageVMSearch.entity().getType(), SearchCriteria.Op.EQ);
SecondaryStorageVMSearch.and("dc", SecondaryStorageVMSearch.entity().getDataCenterId(), SearchCriteria.Op.EQ);
SecondaryStorageVMSearch.and("status", SecondaryStorageVMSearch.entity().getStatus(), SearchCriteria.Op.EQ);
SecondaryStorageVMSearch.done();
TypeDcStatusSearch = createSearchBuilder();
TypeDcStatusSearch.and("type", TypeDcStatusSearch.entity().getType(), SearchCriteria.Op.EQ);
@ -693,7 +700,16 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
return listBy(sc);
}
@Override
public List<HostVO> listSecondaryStorageVM(long dcId) {
SearchCriteria<HostVO> sc = SecondaryStorageVMSearch.create();
sc.setParameters("type", Type.SecondaryStorageVM);
sc.setParameters("status", Status.Up);
sc.setParameters("dc", dcId);
return listBy(sc);
}
@Override
public List<HostVO> listByType(Type type) {
SearchCriteria<HostVO> sc = TypeSearch.create();