vmware: reboot VR after mac updates (#2794)

This re-introduces the rebooting of VR after setup of nics/macs in
case of VMware. It also adds a minor enhancement to show the console
esp. for root admins when VRs and systemvms are in starting state.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2018-08-10 13:07:11 +05:30 committed by GitHub
parent ecb44a5e72
commit 461c4ad027
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 3 deletions

View File

@ -401,9 +401,9 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
return null;
}
if (vm != null && vm.getState() != State.Running) {
if (vm != null && vm.getState() != State.Starting && vm.getState() != State.Running) {
if (s_logger.isInfoEnabled()) {
s_logger.info("Detected that vm : " + vmId + " is not currently at running state, we will fail the proxy assignment for it");
s_logger.info("Detected that vm : " + vmId + " is not currently in starting or running state, we will fail the proxy assignment for it");
}
return null;
}

View File

@ -61,6 +61,10 @@ setup_router() {
then
log_it "Reloading udev for new udev NIC assignment"
udevadm control --reload-rules && udevadm trigger
if [ "$HYPERVISOR" == "vmware" ]; then
sync
reboot
fi
fi
fi

View File

@ -3292,6 +3292,9 @@
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') {

View File

@ -22140,6 +22140,10 @@
if (isAdmin())
allowedActions.push("migrate");
} else if (jsonObj.state == 'Starting') {
if (isAdmin()) {
allowedActions.push("viewConsole");
}
} else if (jsonObj.state == 'Stopped') {
allowedActions.push("start");
@ -22157,10 +22161,13 @@
if (jsonObj.state == 'Running') {
allowedActions.push("stop");
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");
}
@ -22184,6 +22191,10 @@
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");