Skip to content

Commit 0b643dd

Browse files
anshulgangwardevdeep
authored andcommitted
CLOUDSTACK-5705: fixed the thumbnail not wrking for hyperv
1 parent e74889a commit 0b643dd

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)