Skip to content

Commit 233f46c

Browse files
committed
Merge remote-tracking branch 'origin/4.11'
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2 parents e871638 + 5ce14df commit 233f46c

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ public interface NetworkOrchestrationService {
9393
ConfigKey<Boolean> ForgedTransmits = new ConfigKey<Boolean>("Advanced", Boolean.class, "network.forged.transmits", "true",
9494
"Whether to allow or deny forged transmits on nics for applicable network elements such as for vswitch/dvswitch portgroups.", true);
9595

96+
ConfigKey<Boolean> RollingRestartEnabled = new ConfigKey<Boolean>("Advanced", Boolean.class, "network.rolling.restart", "true",
97+
"Whether to allow or deny rolling restart of network routers.", true);
98+
9699
List<? extends Network> setupNetwork(Account owner, NetworkOffering offering, DeploymentPlan plan, String name, String displayText, boolean isDefault)
97100
throws ConcurrentOperationException;
98101

engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2927,6 +2927,14 @@ public boolean areRoutersRunning(final List<? extends VirtualRouter> routers) {
29272927
* @throws InsufficientCapacityException
29282928
*/
29292929
private boolean rollingRestartRouters(final NetworkVO network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException {
2930+
if (!NetworkOrchestrationService.RollingRestartEnabled.value()) {
2931+
if (shutdownNetworkElementsAndResources(context, true, network)) {
2932+
implementNetworkElementsAndResources(dest, context, network, offering);
2933+
return true;
2934+
}
2935+
s_logger.debug("Failed to shutdown the network elements and resources as a part of network restart: " + network.getState());
2936+
return false;
2937+
}
29302938
s_logger.debug("Performing rolling restart of routers of network " + network);
29312939
destroyExpendableRouters(_routerDao.findByNetwork(network.getId()), context);
29322940

@@ -3831,6 +3839,6 @@ public String getConfigComponentName() {
38313839
public ConfigKey<?>[] getConfigKeys() {
38323840
return new ConfigKey<?>[] {NetworkGcWait, NetworkGcInterval, NetworkLockTimeout,
38333841
GuestDomainSuffix, NetworkThrottlingRate, MinVRVersion,
3834-
PromiscuousMode, MacAddressChanges, ForgedTransmits};
3842+
PromiscuousMode, MacAddressChanges, ForgedTransmits, RollingRestartEnabled};
38353843
}
38363844
}

server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2458,6 +2458,13 @@ public boolean isSrcNatIpRequired(long vpcOfferingId) {
24582458
* @throws InsufficientCapacityException
24592459
*/
24602460
private boolean rollingRestartVpc(final Vpc vpc, final ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException {
2461+
if (!NetworkOrchestrationService.RollingRestartEnabled.value()) {
2462+
if (shutdownVpc(vpc.getId())) {
2463+
return startVpc(vpc.getId(), false);
2464+
}
2465+
s_logger.warn("Failed to shutdown vpc as a part of VPC " + vpc + " restart process");
2466+
return false;
2467+
}
24612468
s_logger.debug("Performing rolling restart of routers of VPC " + vpc);
24622469
_ntwkMgr.destroyExpendableRouters(_routerDao.listByVpcId(vpc.getId()), context);
24632470

0 commit comments

Comments
 (0)