@@ -361,7 +361,16 @@ private String composeThumbnailUrl(String rootUrl, VirtualMachine vm, HostVO hos
361361 String sid = vm .getVncPassword ();
362362 String tag = String .valueOf (vm .getId ());
363363 tag = _identityService .getIdentityUuid ("vm_instance" , tag );
364- String ticket = genAccessTicket (host , String .valueOf (portInfo .second ()), sid , tag );
364+
365+ int port = -1 ;
366+ if (portInfo .second () == -9 ) {
367+ //for hyperv
368+ port = Integer .parseInt (_ms .findDetail (hostVo .getId (), "rdp.server.port" ).getValue ());
369+ } else {
370+ port = portInfo .second ();
371+ }
372+
373+ String ticket = genAccessTicket (parsedHostInfo .first (), String .valueOf (port ), sid , tag );
365374
366375 ConsoleProxyPasswordBasedEncryptor encryptor = new ConsoleProxyPasswordBasedEncryptor (getEncryptorPassword ());
367376 ConsoleProxyClientParam param = new ConsoleProxyClientParam ();
@@ -370,6 +379,12 @@ private String composeThumbnailUrl(String rootUrl, VirtualMachine vm, HostVO hos
370379 param .setClientHostPassword (sid );
371380 param .setClientTag (tag );
372381 param .setTicket (ticket );
382+ if (portInfo .second () == -9 ) {
383+ //For Hyperv Clinet Host Address will send Instance id
384+ param .setHypervHost (host );
385+ param .setUsername (_ms .findDetail (hostVo .getId (), "username" ).getValue ());
386+ param .setPassword (_ms .findDetail (hostVo .getId (), "password" ).getValue ());
387+ }
373388 if (parsedHostInfo .second () != null && parsedHostInfo .third () != null ) {
374389 param .setClientTunnelUrl (parsedHostInfo .second ());
375390 param .setClientTunnelSession (parsedHostInfo .third ());
0 commit comments