Skip to content

Commit ef9830d

Browse files
committed
Merge branch '4.5'
Conflicts: server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java tools/appliance/build.sh
2 parents 0fc07e6 + 016d009 commit ef9830d

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

‎api/src/com/cloud/network/VirtualNetworkApplianceService.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,5 @@ public interface VirtualNetworkApplianceService {
6969

7070
List<Long> upgradeRouterTemplate(UpgradeRouterTemplateCmd cmd);
7171

72-
public static final String MinVRVersion = "4.3.0";
72+
public static final String MinVRVersion = "4.5.0";
7373
}

‎server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2579,15 +2579,22 @@ public boolean postStateTransitionEvent(final StateMachine2.Transition<State, Vi
25792579
final VirtualMachine.Event event = transition.getEvent();
25802580
if (event == VirtualMachine.Event.FollowAgentPowerOnReport && newState == State.Running) {
25812581
if (vo.getType() == VirtualMachine.Type.DomainRouter) {
2582+
// opaque -> <hostId, powerHostId>
25822583
if (opaque != null && opaque instanceof Pair<?, ?>) {
25832584
Pair<?, ?> pair = (Pair<?, ?>)opaque;
25842585
Object first = pair.first();
25852586
Object second = pair.second();
2586-
if (first != null && second != null && first instanceof Long && second instanceof Long) {
2587-
Long hostId = (Long)first;
2587+
// powerHostId cannot be null in case of out-of-band VM movement
2588+
if (second != null && second instanceof Long) {
25882589
Long powerHostId = (Long)second;
2589-
// If VM host known to CS is different from 'PowerOn' report host, then it is out-of-band movement
2590-
if (hostId.longValue() != powerHostId.longValue()) {
2590+
Long hostId = null;
2591+
if (first != null && first instanceof Long) {
2592+
hostId = (Long)first;
2593+
}
2594+
// The following scenarios are due to out-of-band VM movement
2595+
// 1. If VM is in stopped state in CS due to 'PowerMissing' report from old host (hostId is null) and then there is a 'PowerOn' report from new host
2596+
// 2. If VM is in running state in CS and there is a 'PowerOn' report from new host
2597+
if (hostId == null || (hostId.longValue() != powerHostId.longValue())) {
25912598
s_logger.info("Schedule a router reboot task as router " + vo.getId() + " is powered-on out-of-band, need to reboot to refresh network rules");
25922599
_executor.schedule(new RebootTask(vo.getId()), 1000, TimeUnit.MICROSECONDS);
25932600
}

0 commit comments

Comments
 (0)