From dc5ee54976cc01c7c9e1c62d7ffc58e1a580476a Mon Sep 17 00:00:00 2001 From: Pearl Dsilva Date: Mon, 8 Jan 2024 15:32:37 -0500 Subject: [PATCH] NSX: add global setting to configure load balancer service size --- .../orchestration/service/NetworkOrchestrationService.java | 3 +++ .../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 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 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 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);