@@ -405,7 +405,6 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
405405 ScheduledExecutorService _checkExecutor ;
406406 ScheduledExecutorService _networkStatsUpdateExecutor ;
407407 ExecutorService _rvrStatusUpdateExecutor ;
408- ExecutorService _rebootRouterExecutor ;
409408
410409 BlockingQueue <Long > _vrUpdateQueue = null ;
411410
@@ -572,7 +571,6 @@ public boolean configure(final String name, final Map<String, Object> params) th
572571 _executor = Executors .newScheduledThreadPool (1 , new NamedThreadFactory ("RouterMonitor" ));
573572 _checkExecutor = Executors .newScheduledThreadPool (1 , new NamedThreadFactory ("RouterStatusMonitor" ));
574573 _networkStatsUpdateExecutor = Executors .newScheduledThreadPool (1 , new NamedThreadFactory ("NetworkStatsUpdater" ));
575- _rebootRouterExecutor = Executors .newCachedThreadPool (new NamedThreadFactory ("RebootRouterTask" ));
576574
577575 VirtualMachine .State .getStateMachine ().registerListener (this );
578576
@@ -2604,7 +2602,7 @@ public String getConfigComponentName() {
26042602
26052603 @ Override
26062604 public ConfigKey <?>[] getConfigKeys () {
2607- return new ConfigKey <?>[] { UseExternalDnsServers , routerVersionCheckEnabled , SetServiceMonitor , RouterAlertsCheckInterval , RouterReprovisionOnOutOfBandMigration };
2605+ return new ConfigKey <?>[] { UseExternalDnsServers , routerVersionCheckEnabled , SetServiceMonitor , RouterAlertsCheckInterval };
26082606 }
26092607
26102608 @ Override
@@ -2615,30 +2613,20 @@ public boolean preStateTransitionEvent(final State oldState, final VirtualMachin
26152613
26162614 @ Override
26172615 public boolean postStateTransitionEvent (final StateMachine2 .Transition <State , VirtualMachine .Event > transition , final VirtualMachine vo , final boolean status , final Object opaque ) {
2618- final State oldState = transition .getCurrentState ();
26192616 final State newState = transition .getToState ();
26202617 final VirtualMachine .Event event = transition .getEvent ();
2621- boolean reprovision_out_of_band = RouterReprovisionOnOutOfBandMigration .value ();
2622- if (
2623- (vo .getType () == VirtualMachine .Type .DomainRouter ) &&
2624- ((oldState == State .Stopped ) || (reprovision_out_of_band && isOutOfBandMigrated (opaque ))) &&
2625- (event == VirtualMachine .Event .FollowAgentPowerOnReport ) &&
2626- (newState == State .Running )) {
2627- s_logger .info ("Schedule a router reboot task as router " + vo .getId () + " is powered-on out-of-band. we need to reboot to refresh network rules" );
2628- _rebootRouterExecutor .execute (new RebootTask (vo .getId ()));
2629- } else {
2630- if (isOutOfBandMigrated (opaque ) && (vo .getType () == VirtualMachine .Type .DomainRouter )) {
2631- final String title = "Router has been migrated out of band: " + vo .getInstanceName ();
2632- final String context =
2633- "An out of band migration of router " + vo .getInstanceName () + "(" + vo .getUuid () + ") was detected. No automated action was performed." ;
2634- _alertMgr .sendAlert (AlertManager .AlertType .ALERT_TYPE_DOMAIN_ROUTER , vo .getDataCenterId (), vo .getPodIdToDeployIn (), title , context );
2635- }
2618+ if (vo .getType () == VirtualMachine .Type .DomainRouter &&
2619+ event == VirtualMachine .Event .FollowAgentPowerOnReport &&
2620+ newState == State .Running &&
2621+ isOutOfBandMigrated (opaque )) {
2622+ s_logger .debug ("Virtual router " + vo .getInstanceName () + " is powered-on out-of-band" );
26362623 }
26372624
26382625 return true ;
26392626 }
26402627
26412628 private boolean isOutOfBandMigrated (final Object opaque ) {
2629+ // opaque -> <hostId, powerHostId>
26422630 if (opaque != null && opaque instanceof Pair <?, ?>) {
26432631 final Pair <?, ?> pair = (Pair <?, ?>)opaque ;
26442632 final Object first = pair .first ();
0 commit comments