Skip to content

Commit 461c4ad

Browse files
authored
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>
1 parent ecb44a5 commit 461c4ad

4 files changed

Lines changed: 21 additions & 3 deletions

File tree

server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,9 @@ public ConsoleProxyVO doAssignProxy(long dataCenterId, long vmId) {
401401
return null;
402402
}
403403

404-
if (vm != null && vm.getState() != State.Running) {
404+
if (vm != null && vm.getState() != State.Starting && vm.getState() != State.Running) {
405405
if (s_logger.isInfoEnabled()) {
406-
s_logger.info("Detected that vm : " + vmId + " is not currently at running state, we will fail the proxy assignment for it");
406+
s_logger.info("Detected that vm : " + vmId + " is not currently in starting or running state, we will fail the proxy assignment for it");
407407
}
408408
return null;
409409
}

systemvm/debian/opt/cloud/bin/setup/router.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ setup_router() {
6161
then
6262
log_it "Reloading udev for new udev NIC assignment"
6363
udevadm control --reload-rules && udevadm trigger
64+
if [ "$HYPERVISOR" == "vmware" ]; then
65+
sync
66+
reboot
67+
fi
6468
fi
6569
fi
6670

ui/scripts/instances.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3292,6 +3292,9 @@
32923292
allowedActions.push("resetSSHKeyForVirtualMachine");
32933293
} else if (jsonObj.state == 'Starting') {
32943294
// allowedActions.push("stop");
3295+
if (isAdmin()) {
3296+
allowedActions.push("viewConsole");
3297+
}
32953298
} else if (jsonObj.state == 'Error') {
32963299
allowedActions.push("destroy");
32973300
} else if (jsonObj.state == 'Expunging') {

ui/scripts/system.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22140,6 +22140,10 @@
2214022140

2214122141
if (isAdmin())
2214222142
allowedActions.push("migrate");
22143+
} else if (jsonObj.state == 'Starting') {
22144+
if (isAdmin()) {
22145+
allowedActions.push("viewConsole");
22146+
}
2214322147
} else if (jsonObj.state == 'Stopped') {
2214422148
allowedActions.push("start");
2214522149

@@ -22157,10 +22161,13 @@
2215722161

2215822162
if (jsonObj.state == 'Running') {
2215922163
allowedActions.push("stop");
22160-
2216122164
allowedActions.push("viewConsole");
2216222165
if (isAdmin())
2216322166
allowedActions.push("migrate");
22167+
} else if (jsonObj.state == 'Starting') {
22168+
if (isAdmin()) {
22169+
allowedActions.push("viewConsole");
22170+
}
2216422171
} else if (jsonObj.state == 'Stopped') {
2216522172
allowedActions.push("start");
2216622173
}
@@ -22184,6 +22191,10 @@
2218422191
allowedActions.push("viewConsole");
2218522192
if (isAdmin())
2218622193
allowedActions.push("migrate");
22194+
} else if (jsonObj.state == 'Starting') {
22195+
if (isAdmin()) {
22196+
allowedActions.push("viewConsole");
22197+
}
2218722198
} else if (jsonObj.state == 'Stopped') {
2218822199
allowedActions.push("start");
2218922200

0 commit comments

Comments
 (0)