Skip to content

Commit e74889a

Browse files
anshulgangwardevdeep
authored andcommitted
CLOUDSTACK-5703: putting rdp server port value in host details
1 parent a4d4d4b commit e74889a

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

‎plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1873,6 +1873,7 @@ public JContainer StartupCommand([FromBody]dynamic cmdArray)
18731873
string productVersion = System.Environment.OSVersion.Version.Major.ToString() + "." +
18741874
System.Environment.OSVersion.Version.Minor.ToString();
18751875
details.Add("product_version", productVersion);
1876+
details.Add("rdp.server.port", 2179);
18761877
}
18771878

18781879
// Detect CPUs, speed, memory

‎server/src/com/cloud/servlet/ConsoleProxyServlet.java‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -388,25 +388,22 @@ private String composeThumbnailUrl(String rootUrl, VirtualMachine vm, HostVO hos
388388
private String composeConsoleAccessUrl(String rootUrl, VirtualMachine vm, HostVO hostVo) {
389389
StringBuffer sb = new StringBuffer(rootUrl);
390390
String host = hostVo.getPrivateIpAddress();
391-
String username = _ms.findDetail(hostVo.getId(), "username").getValue();
392-
String password = _ms.findDetail(hostVo.getId(), "password").getValue();
393391

394392
Pair<String, Integer> portInfo = _ms.getVncPort(vm);
395393
if (s_logger.isDebugEnabled())
396394
s_logger.debug("Port info " + portInfo.first());
397395

398396
Ternary<String, String, String> parsedHostInfo = parseHostInfo(portInfo.first());
397+
399398
int port = -1;
400-
String sid;
401-
402399
if (portInfo.second() == -9) {
403400
//for hyperv
404-
port = 2179;
401+
port = Integer.parseInt(_ms.findDetail(hostVo.getId(), "rdp.server.port").getValue());
405402
} else {
406403
port = portInfo.second();
407404
}
408405

409-
sid = vm.getVncPassword();
406+
String sid = vm.getVncPassword();
410407
UserVmDetailVO details = _userVmDetailsDao.findDetail(vm.getId(), "keyboard");
411408

412409
String tag = vm.getUuid();
@@ -426,8 +423,8 @@ private String composeConsoleAccessUrl(String rootUrl, VirtualMachine vm, HostVO
426423
if (portInfo.second() == -9) {
427424
//For Hyperv Clinet Host Address will send Instance id
428425
param.setHypervHost(host);
429-
param.setUsername(username);
430-
param.setPassword(password);
426+
param.setUsername(_ms.findDetail(hostVo.getId(), "username").getValue());
427+
param.setPassword(_ms.findDetail(hostVo.getId(), "password").getValue());
431428
}
432429
if (parsedHostInfo.second() != null && parsedHostInfo.third() != null) {
433430
param.setClientTunnelUrl(parsedHostInfo.second());

0 commit comments

Comments
 (0)