From 37da6dab496d9068d5bfece533297d7be16037f8 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Thu, 30 Mar 2023 10:32:21 -0300 Subject: [PATCH 1/3] redundant networks --- ui/src/config/section/network.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/src/config/section/network.js b/ui/src/config/section/network.js index 8c1ffcdf9cd4..baffdf972086 100644 --- a/ui/src/config/section/network.js +++ b/ui/src/config/section/network.js @@ -171,13 +171,16 @@ export default { if (isGroupAction || record.vpcid == null) { fields.push('cleanup') } + if (!record.redundantrouter) { + fields.push('makeredundant') + } fields.push('livepatch') return fields }, show: (record) => record.type !== 'L2', groupAction: true, popup: true, - groupMap: (selection, values) => { return selection.map(x => { return { id: x, cleanup: values.cleanup } }) } + groupMap: (selection, values) => { return selection.map(x => { return { id: x, cleanup: values.cleanup, makeredundant: values.makeredundant } }) } }, { api: 'replaceNetworkACLList', From cc7eb9312f4f5fb1700262cbc4972f50ab1f2fad Mon Sep 17 00:00:00 2001 From: gabriel Date: Tue, 6 Jan 2026 13:52:54 -0300 Subject: [PATCH 2/3] addConfig --- .../java/com/cloud/network/NetworkServiceImpl.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java index cb1ee021d67b..9ebacf286663 100644 --- a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java @@ -280,6 +280,9 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService, C private static final ConfigKey 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 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; @@ -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); } @@ -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) { From 92b08e98fb0bd04a06b0920072f5180fb6d7b286 Mon Sep 17 00:00:00 2001 From: GaOrtiga <49285692+GaOrtiga@users.noreply.github.com> Date: Thu, 8 Jan 2026 17:00:54 -0300 Subject: [PATCH 3/3] Update server/src/main/java/com/cloud/network/NetworkServiceImpl.java Co-authored-by: Suresh Kumar Anaparti --- server/src/main/java/com/cloud/network/NetworkServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java index 9ebacf286663..1db21e783d20 100644 --- a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java @@ -2991,7 +2991,7 @@ public boolean restartNetwork(RestartNetworkCmd cmd) throws ConcurrentOperationE boolean makeRedundant = cmd.getMakeRedundant(); 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.", + throw new InvalidParameterValueException("Could not make the network redundant. Please contact administrator."); AllowUsersToMakeNetworksRedundant.key())); }