Skip to content

Commit 8a6d933

Browse files
committed
bugfix apache#4 vpc vr: Do NOT send Nic plug in/out command to Stopped/Stopping VR
1 parent 433008d commit 8a6d933

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

server/src/main/java/org/apache/cloudstack/network/topology/AdvancedNetworkTopology.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,11 @@ public boolean associatePublicIP(final Network network, final List<? extends Pub
214214
final boolean result = applyRules(network, router, typeString, isPodLevelException, podId, failWhenDisconnect, new RuleApplierWrapper<RuleApplier>(ipAssociationRules));
215215

216216
if (result) {
217-
_advancedVisitor.visit(nicPlugInOutRules);
217+
if (router.getState() == State.Stopped || router.getState() == State.Stopping) {
218+
s_logger.debug("Router " + router.getInstanceName() + " is in " + router.getState() + ", so not sending NicPlugInOutRules command to the backend");
219+
} else {
220+
_advancedVisitor.visit(nicPlugInOutRules);
221+
}
218222
}
219223

220224
return result;
@@ -241,4 +245,4 @@ public boolean applyNetworkACLs(final Network network, final List<? extends Netw
241245
final boolean result = applyRules(network, router, typeString, isPodLevelException, podId, failWhenDisconnect, new RuleApplierWrapper<RuleApplier>(aclsRules));
242246
return result;
243247
}
244-
}
248+
}

0 commit comments

Comments
 (0)