Github user DaanHoogland commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/666#discussion_r36580162
  
    --- Diff: 
server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java ---
    @@ -2627,7 +2627,7 @@ public boolean postStateTransitionEvent(final 
StateMachine2.Transition<State, Vi
                     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");
                     _rebootRouterExecutor.execute(new RebootTask(vo.getId()));
             } else {
    -            if (isOutOfBandMigrated(opaque)) {
    +            if (isOutOfBandMigrated(opaque) && (vo.getType() == 
VirtualMachine.Type.DomainRouter)) {
    --- End diff --
    
    @koushik-das A first shot:
    
            final VirtualMachine.Event event = transition.getEvent();
            boolean outOfBandMigrated = isOutOfBandMigrated(opaque);
            boolean reprovision_out_of_band = 
RouterReprovisionOnOutOfBandMigration.value() && outOfBandMigrated;
            if ( (vo.getType() == VirtualMachine.Type.DomainRouter)) {
                if (
                        (event == 
VirtualMachine.Event.FollowAgentPowerOnReport) &&
                        (newState == State.Running) &&
                        ((oldState == State.Stopped) || 
(reprovision_out_of_band))
                    ) {
                    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");
                    _rebootRouterExecutor.execute(new RebootTask(vo.getId()));
                } else {
                    if (outOfBandMigrated) {
                        final String title = "Router has been migrated out of 
band: " + vo.getInstanceName();
                        final String context =
                                "An out of band migration of router " + 
vo.getInstanceName() + "(" + vo.getUuid() + ") was detected. No automated 
action was performed.";
                        
_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_DOMAIN_ROUTER, 
vo.getDataCenterId(), vo.getPodIdToDeployIn(), title, context);
                    }
                }
            }
    It can probably be more clean up even. I saw none but dummy tests are there 
for this class so I want to create that as well before committing


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to