Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2735,6 +2735,12 @@ public boolean restartNetwork(NetworkVO network, boolean cleanup, boolean makeRe
Account callerAccount = _accountMgr.getActiveAccountById(user.getAccountId());
_accountMgr.checkAccess(callerAccount, AccessType.OperateEntry, true, network);
if (!network.isRedundant() && makeRedundant) {
NetworkOffering networkOffering = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId());
Map<Network.Capability, String> sourceNatCapabilities = getNetworkOfferingServiceCapabilities(networkOffering, Service.SourceNat);
String isRedundantRouterSupported = sourceNatCapabilities.get(Capability.RedundantRouter);
if (!Boolean.parseBoolean(isRedundantRouterSupported)) {
throw new InvalidParameterValueException(String.format("Redundant router is not supported by the network offering %s", networkOffering));
}
network.setRedundant(true);
if (!_networksDao.update(network.getId(), network)) {
throw new CloudRuntimeException("Failed to update network into a redundant one, please try again");
Expand Down