Merge remote-tracking branch 'origin/4.11'

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2018-10-17 20:29:58 +05:30
commit 233f46c94b
3 changed files with 19 additions and 1 deletions

View File

@ -93,6 +93,9 @@ public interface NetworkOrchestrationService {
ConfigKey<Boolean> ForgedTransmits = new ConfigKey<Boolean>("Advanced", Boolean.class, "network.forged.transmits", "true",
"Whether to allow or deny forged transmits on nics for applicable network elements such as for vswitch/dvswitch portgroups.", true);
ConfigKey<Boolean> RollingRestartEnabled = new ConfigKey<Boolean>("Advanced", Boolean.class, "network.rolling.restart", "true",
"Whether to allow or deny rolling restart of network routers.", true);
List<? extends Network> setupNetwork(Account owner, NetworkOffering offering, DeploymentPlan plan, String name, String displayText, boolean isDefault)
throws ConcurrentOperationException;

View File

@ -2927,6 +2927,14 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
* @throws InsufficientCapacityException
*/
private boolean rollingRestartRouters(final NetworkVO network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException {
if (!NetworkOrchestrationService.RollingRestartEnabled.value()) {
if (shutdownNetworkElementsAndResources(context, true, network)) {
implementNetworkElementsAndResources(dest, context, network, offering);
return true;
}
s_logger.debug("Failed to shutdown the network elements and resources as a part of network restart: " + network.getState());
return false;
}
s_logger.debug("Performing rolling restart of routers of network " + network);
destroyExpendableRouters(_routerDao.findByNetwork(network.getId()), context);
@ -3831,6 +3839,6 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
public ConfigKey<?>[] getConfigKeys() {
return new ConfigKey<?>[] {NetworkGcWait, NetworkGcInterval, NetworkLockTimeout,
GuestDomainSuffix, NetworkThrottlingRate, MinVRVersion,
PromiscuousMode, MacAddressChanges, ForgedTransmits};
PromiscuousMode, MacAddressChanges, ForgedTransmits, RollingRestartEnabled};
}
}

View File

@ -2458,6 +2458,13 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
* @throws InsufficientCapacityException
*/
private boolean rollingRestartVpc(final Vpc vpc, final ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException {
if (!NetworkOrchestrationService.RollingRestartEnabled.value()) {
if (shutdownVpc(vpc.getId())) {
return startVpc(vpc.getId(), false);
}
s_logger.warn("Failed to shutdown vpc as a part of VPC " + vpc + " restart process");
return false;
}
s_logger.debug("Performing rolling restart of routers of VPC " + vpc);
_ntwkMgr.destroyExpendableRouters(_routerDao.listByVpcId(vpc.getId()), context);