Skip to content
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
addConfig
  • Loading branch information
gabriel committed Jan 6, 2026
commit cc7eb9312f4f5fb1700262cbc4972f50ab1f2fad
12 changes: 10 additions & 2 deletions server/src/main/java/com/cloud/network/NetworkServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService, C
private static final ConfigKey<Boolean> AllowEmptyStartEndIpAddress = new ConfigKey<>("Advanced", Boolean.class,
"allow.empty.start.end.ipaddress", "true", "Allow creating network without mentioning start and end IP address",
true, ConfigKey.Scope.Account);
public static final ConfigKey<Boolean> AllowUsersToMakeNetworksRedundant = new ConfigKey<>("Advanced", Boolean.class,
"allow.users.to.make.networks.redundant", "true", "Allow Users to make Networks Redundant",
true, ConfigKey.Scope.Global);
private static final long MIN_VLAN_ID = 0L;
private static final long MAX_VLAN_ID = 4095L; // 2^12 - 1
private static final long MIN_GRE_KEY = 0L;
Expand Down Expand Up @@ -2986,8 +2989,13 @@ public boolean restartNetwork(RestartNetworkCmd cmd) throws ConcurrentOperationE
throwInvalidIdException("Cannot restart a VPC tier with cleanup, please restart the whole VPC.", network.getUuid(), "network tier");
}
boolean makeRedundant = cmd.getMakeRedundant();
boolean livePatch = cmd.getLivePatch();
User callerUser = _accountMgr.getActiveUser(CallContext.current().getCallingUserId());
if (makeRedundant && !_accountMgr.isRootAdmin(callerUser.getAccountId()) && !AllowUsersToMakeNetworksRedundant.value() ) {
throw new InvalidParameterValueException(String.format("Could not make network redundant as calling user is not Root Admin and [%s] is set to false.",
AllowUsersToMakeNetworksRedundant.key()));
}

boolean livePatch = cmd.getLivePatch();
return restartNetwork(network, cleanup, makeRedundant, livePatch, callerUser);
}

Expand Down Expand Up @@ -6266,7 +6274,7 @@ public String getConfigComponentName() {

@Override
public ConfigKey<?>[] getConfigKeys() {
return new ConfigKey<?>[] {AllowDuplicateNetworkName, AllowEmptyStartEndIpAddress, VRPrivateInterfaceMtu, VRPublicInterfaceMtu, AllowUsersToSpecifyVRMtu};
return new ConfigKey<?>[] {AllowDuplicateNetworkName, AllowEmptyStartEndIpAddress, AllowUsersToMakeNetworksRedundant, VRPrivateInterfaceMtu, VRPublicInterfaceMtu, AllowUsersToSpecifyVRMtu};
}

public boolean isDefaultAcl(Long aclId) {
Expand Down
Loading