@@ -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