mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge release branch 4.13 to master
* 4.13: consoleproxy: Enable console for vms in Stopping/Migrating state (#3640)
This commit is contained in:
commit
b8676aefe3
@ -401,9 +401,10 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
|
||||
return null;
|
||||
}
|
||||
|
||||
if (vm != null && vm.getState() != State.Starting && vm.getState() != State.Running) {
|
||||
if (vm != null && vm.getState() != State.Starting && vm.getState() != State.Running
|
||||
&& vm.getState() != State.Stopping && vm.getState() != State.Migrating) {
|
||||
if (s_logger.isInfoEnabled()) {
|
||||
s_logger.info("Detected that vm : " + vmId + " is not currently in starting or running state, we will fail the proxy assignment for it");
|
||||
s_logger.info("Detected that vm : " + vmId + " is not currently in starting or running or stopping or migrating state, we will fail the proxy assignment for it");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -2392,7 +2392,12 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
|
||||
s_logger.trace("Trying to retrieve VNC port from agent about VM " + vm.getHostName());
|
||||
}
|
||||
|
||||
final GetVncPortAnswer answer = (GetVncPortAnswer)_agentMgr.easySend(vm.getHostId(), new GetVncPortCommand(vm.getId(), vm.getInstanceName()));
|
||||
GetVncPortAnswer answer = null;
|
||||
if (vm.getState() == State.Migrating && vm.getLastHostId() != null) {
|
||||
answer = (GetVncPortAnswer)_agentMgr.easySend(vm.getLastHostId(), new GetVncPortCommand(vm.getId(), vm.getInstanceName()));
|
||||
} else {
|
||||
answer = (GetVncPortAnswer)_agentMgr.easySend(vm.getHostId(), new GetVncPortCommand(vm.getId(), vm.getInstanceName()));
|
||||
}
|
||||
if (answer != null && answer.getResult()) {
|
||||
return new Pair<String, Integer>(answer.getAddress(), answer.getPort());
|
||||
}
|
||||
|
||||
@ -3707,9 +3707,6 @@
|
||||
allowedActions.push("resetSSHKeyForVirtualMachine");
|
||||
} else if (jsonObj.state == 'Starting') {
|
||||
// allowedActions.push("stop");
|
||||
if (isAdmin()) {
|
||||
allowedActions.push("viewConsole");
|
||||
}
|
||||
} else if (jsonObj.state == 'Error') {
|
||||
allowedActions.push("destroy");
|
||||
} else if (jsonObj.state == 'Expunging') {
|
||||
@ -3717,6 +3714,11 @@
|
||||
allowedActions.push("expunge");
|
||||
}
|
||||
}
|
||||
|
||||
if (jsonObj.state == 'Starting' || jsonObj.state == 'Stopping' || jsonObj.state == 'Migrating') {
|
||||
allowedActions.push("viewConsole");
|
||||
}
|
||||
|
||||
return allowedActions;
|
||||
}
|
||||
|
||||
|
||||
@ -22071,10 +22071,6 @@
|
||||
allowedActions.push("migrate");
|
||||
allowedActions.push("diagnostics");
|
||||
}
|
||||
} else if (jsonObj.state == 'Starting') {
|
||||
if (isAdmin()) {
|
||||
allowedActions.push("viewConsole");
|
||||
}
|
||||
} else if (jsonObj.state == 'Stopped') {
|
||||
allowedActions.push("start");
|
||||
|
||||
@ -22083,6 +22079,9 @@
|
||||
|
||||
allowedActions.push("remove");
|
||||
}
|
||||
if (jsonObj.state == 'Starting' || jsonObj.state == 'Stopping' || jsonObj.state == 'Migrating') {
|
||||
allowedActions.push("viewConsole");
|
||||
}
|
||||
return allowedActions;
|
||||
}
|
||||
|
||||
@ -22095,13 +22094,12 @@
|
||||
allowedActions.push("viewConsole");
|
||||
if (isAdmin())
|
||||
allowedActions.push("migrate");
|
||||
} else if (jsonObj.state == 'Starting') {
|
||||
if (isAdmin()) {
|
||||
allowedActions.push("viewConsole");
|
||||
}
|
||||
} else if (jsonObj.state == 'Stopped') {
|
||||
allowedActions.push("start");
|
||||
}
|
||||
if (jsonObj.state == 'Starting' || jsonObj.state == 'Stopping' || jsonObj.state == 'Migrating') {
|
||||
allowedActions.push("viewConsole");
|
||||
}
|
||||
return allowedActions;
|
||||
}
|
||||
|
||||
@ -22124,10 +22122,6 @@
|
||||
allowedActions.push("migrate");
|
||||
allowedActions.push("diagnostics");
|
||||
}
|
||||
} else if (jsonObj.state == 'Starting') {
|
||||
if (isAdmin()) {
|
||||
allowedActions.push("viewConsole");
|
||||
}
|
||||
} else if (jsonObj.state == 'Stopped') {
|
||||
allowedActions.push("start");
|
||||
|
||||
@ -22138,6 +22132,9 @@
|
||||
} else if (jsonObj.state == 'Error') {
|
||||
allowedActions.push("remove");
|
||||
}
|
||||
if (jsonObj.state == 'Starting' || jsonObj.state == 'Stopping' || jsonObj.state == 'Migrating') {
|
||||
allowedActions.push("viewConsole");
|
||||
}
|
||||
return allowedActions;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user