CLOUDSTACK-5703: putting rdp server port value in host details

This commit is contained in:
Anshul Gangwar 2014-01-01 14:15:31 +05:30 committed by Rajesh Battala
parent 3e2f7dda9e
commit b2de225f54
2 changed files with 6 additions and 8 deletions

View File

@ -1921,6 +1921,7 @@ namespace HypervResource
string productVersion = System.Environment.OSVersion.Version.Major.ToString() + "." +
System.Environment.OSVersion.Version.Minor.ToString();
details.Add("product_version", productVersion);
details.Add("rdp.server.port", 2179);
}
// Detect CPUs, speed, memory

View File

@ -395,25 +395,22 @@ public class ConsoleProxyServlet extends HttpServlet {
private String composeConsoleAccessUrl(String rootUrl, VirtualMachine vm, HostVO hostVo) {
StringBuffer sb = new StringBuffer(rootUrl);
String host = hostVo.getPrivateIpAddress();
String username = _ms.findDetail(hostVo.getId(), "username").getValue();
String password = _ms.findDetail(hostVo.getId(), "password").getValue();
Pair<String, Integer> portInfo = _ms.getVncPort(vm);
if (s_logger.isDebugEnabled())
s_logger.debug("Port info " + portInfo.first());
Ternary<String, String, String> parsedHostInfo = parseHostInfo(portInfo.first());
int port = -1;
String sid;
if (portInfo.second() == -9) {
//for hyperv
port = 2179;
port = Integer.parseInt(_ms.findDetail(hostVo.getId(), "rdp.server.port").getValue());
} else {
port = portInfo.second();
}
sid = vm.getVncPassword();
String sid = vm.getVncPassword();
UserVmDetailVO details = _userVmDetailsDao.findDetail(vm.getId(), "keyboard");
String tag = vm.getUuid();
@ -434,8 +431,8 @@ public class ConsoleProxyServlet extends HttpServlet {
if (portInfo.second() == -9) {
//For Hyperv Clinet Host Address will send Instance id
param.setHypervHost(host);
param.setUsername(username);
param.setPassword(password);
param.setUsername(_ms.findDetail(hostVo.getId(), "username").getValue());
param.setPassword(_ms.findDetail(hostVo.getId(), "password").getValue());
}
if (parsedHostInfo.second() != null && parsedHostInfo.third() != null) {
param.setClientTunnelUrl(parsedHostInfo.second());