mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-215 CPVM load balance didn't work, VNC console sessions go to one CPVM and ignore other CPVMs
This commit is contained in:
parent
77520e0bc8
commit
daeac9ec57
|
|
@ -21,6 +21,7 @@ import java.util.ArrayList;
|
|||
import java.util.Date;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
|
@ -658,6 +659,13 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
|
|||
assert (allocator != null);
|
||||
List<ConsoleProxyVO> runningList = _consoleProxyDao.getProxyListInStates(dataCenterId, State.Running);
|
||||
if (runningList != null && runningList.size() > 0) {
|
||||
Iterator<ConsoleProxyVO> it = runningList.iterator();
|
||||
while (it.hasNext()) {
|
||||
ConsoleProxyVO proxy = it.next();
|
||||
if(proxy.getActiveSession() >= _capacityPerProxy){
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
if (s_logger.isTraceEnabled()) {
|
||||
s_logger.trace("Running proxy pool size : " + runningList.size());
|
||||
for (ConsoleProxyVO proxy : runningList) {
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ public class ConsoleProxyDaoImpl extends GenericDaoBase<ConsoleProxyVO, Long> im
|
|||
private static final String GET_PROXY_ACTIVE_LOAD =
|
||||
"SELECT active_session AS count" +
|
||||
" FROM console_proxy" +
|
||||
" WHERE proxy_id=?";
|
||||
" WHERE id=?";
|
||||
|
||||
private static final String STORAGE_POOL_HOST_INFO =
|
||||
"SELECT p.data_center_id, count(ph.host_id) " +
|
||||
|
|
|
|||
Loading…
Reference in New Issue