This is an automated email from the ASF dual-hosted git repository.

pearl11594 pushed a commit to branch nsx-add-gs-lbsize
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit dc5ee54976cc01c7c9e1c62d7ffc58e1a580476a
Author: Pearl Dsilva <[email protected]>
AuthorDate: Mon Jan 8 15:32:37 2024 -0500

    NSX: add global setting to configure load balancer service size
---
 .../engine/orchestration/service/NetworkOrchestrationService.java     | 3 +++
 .../nsx/src/main/java/org/apache/cloudstack/service/NsxApiClient.java | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java
 
b/engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java
index 90cfaf9335e..925e7928136 100644
--- 
a/engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java
+++ 
b/engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java
@@ -106,6 +106,9 @@ public interface NetworkOrchestrationService {
     static final ConfigKey<Boolean> NSX_ENABLED = new 
ConfigKey<>(Boolean.class, "nsx.plugin.enable", "Advanced", "false",
             "Indicates whether to enable the NSX plugin", false, 
ConfigKey.Scope.Zone, null);
 
+    static final ConfigKey<String> NSX_LB_SIZE = new ConfigKey<>(String.class, 
"nsx.lb.size", "Advanced", "SMALL",
+            "Indicates the NSX load balancer service size", true, 
Scope.Global, null, null, null, null, null, ConfigKey.Kind.Select, "SMALL, 
MEDIUM, LARGE, XLARGE");
+
     List<? extends Network> setupNetwork(Account owner, NetworkOffering 
offering, DeploymentPlan plan, String name, String displayText, boolean 
isDefault)
         throws ConcurrentOperationException;
 
diff --git 
a/plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxApiClient.java
 
b/plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxApiClient.java
index a9c13afceea..6705c08b814 100644
--- 
a/plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxApiClient.java
+++ 
b/plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxApiClient.java
@@ -72,6 +72,7 @@ import com.vmware.vapi.internal.protocol.RestProtocol;
 import 
com.vmware.vapi.internal.protocol.client.rest.authn.BasicAuthenticationAppender;
 import com.vmware.vapi.protocol.HttpConfiguration;
 import com.vmware.vapi.std.errors.Error;
+import 
org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
 import org.apache.cloudstack.resource.NsxLoadBalancerMember;
 import org.apache.cloudstack.resource.NsxNetworkRule;
 import org.apache.cloudstack.utils.NsxControllerUtils;
@@ -533,11 +534,12 @@ public class NsxApiClient {
             if (Objects.nonNull(lbService)) {
                 return;
             }
+            String lbSize = 
LBSize.valueOf(NetworkOrchestrationService.NSX_LB_SIZE.value()).name();
             lbService = new LBService.Builder()
                     .setId(lbName)
                     .setDisplayName(lbName)
                     .setEnabled(true)
-                    .setSize(LBSize.SMALL.name())
+                    .setSize(lbSize)
                     .setConnectivityPath(TIER_1_GATEWAY_PATH_PREFIX + 
tier1GatewayName)
                     .build();
             lbServices.patch(lbName, lbService);

Reply via email to