Skip to content

Commit 6dc3d06

Browse files
Pearl1594nvazquez
andauthored
NSX integration (#7919)
* NSX integration - skeletal code * Fix module not loading on startup * add upgrade path and daos \n add nsx controller command * add support for adding and listing nsx provider to a zone * add license * add default VPC offering and update upgrade path * add global setting to enable nsx plugin * add delete nsx controller operation * add nsxresource * add NSX resource , api client, create tier1 gw * update db * update response and add license * Add support to create and delete nsx tier-1 gateway * add license * cleanup and add skeletal code for network creation * add create/delete segment and UI integration * add license * address code smells - part 1 * fix test / build failure * NSX integration - skeletal code * Fix module not loading on startup * add upgrade path and daos \n add nsx controller command * add support for adding and listing nsx provider to a zone * add license * add default VPC offering and update upgrade path * add global setting to enable nsx plugin * add delete nsx controller operation * add nsxresource * add NSX resource , api client, create tier1 gw * update db * update response and add license * Add support to create and delete nsx tier-1 gateway * add license * cleanup and add skeletal code for network creation * add create/delete segment and UI integration * add license * address code smells - part 1 * fix test / build failure * add ui changes + update nsx_provider table transport zones + use NSX broadcast domain for add nics to router * ui: fix password field, and backend changes * add route advertisement * update offering * update offering * add sleep before deletion of vpc / tier g/w for ports to be removed * move creation of segments to design phase * change provider to VPC router for Dhcp & dns service in an nsx offering * Add public nic for NSX * reserve first IP (after g/w) of subnet for router nic - NSX * revert reserving 1st IP in vpc segments * [NSX] Create a DHCP relay and add it to a VPC tier segment (#107) * Create DHCP relay command and execute request * In progress integrate with networking * Create DHCP relay config on the network VR allocation * Revert domain router dao changes * Create DHCP relay con VR nic plug to NSX network * Link DHCP relay config to segment after creation * [NSX] Cleanup DHCP Relay config on segment deletion (#108) * Cleanup DHCP Relay config on segment deletion * update segment & relay name generators and call delete dhcprelay after deletion of segment * address comment * [NSX] Fix DHCP relay config deletion was missing zone name (#8068) * [NSX] Refactor API wrapper operations (#8059) * [NSX] Refactor API wrapper operations * Big refactor * Address review comment * change network cidr to cidr to prevent NPE * add domain and zone names to the various networks - vpc & tier --------- Co-authored-by: Pearl Dsilva <pearl1594@gmail.com> * Nsx unit tests (#8090) * Add tests * add test for NsxGuestNetworkGuru * add unit tests for NsxResource * add unti tests for NsxElement * cleanup * [NSX] Refactor API wrapper operations * update tests * update tests - add nsxProviderServiceImpl test * add unit test - NsxServiceImpl * add license * Big refactor * Address review comment * change network cidr to cidr to prevent NPE * add domain and zone names to the various networks - vpc & tier * fix tests --------- Co-authored-by: nvazquez <nicovazquez90@gmail.com> * modify NSX resource naming convention (#8095) * modify NSX resource naming convention * remove unused imports * add a setup phase between desgin and implementation of a network for intermediary steps * add method to all classes * NSX: Refactor Network & VPC offering (#8110) * [NSX] Refactor API wrapper operations * Network offering changes for NSX * fix services and provider combination * address comments: rename param * update nsx_mode parameter --------- Co-authored-by: nvazquez <nicovazquez90@gmail.com> * fix test * [NSX] Allow NSX isolated networks (#8132) * Add network offerings for NSX on isolated networks * Fix offerings creation * In progress NSX isolated network * Fixes * Fix NIC allocation to router * NSX: Add Step for Adding Public traffic network for NSX During zone creation (#8126) * NSX: Add Step for Adding Public traffic network for NSX * address comments and cleanup * address comment * remove indent * NSX: Create and Delete static NAT & Port forward rules (#8131) * NSX: Create and delete NSX Static Nat rules * fix issues with static nat * add static nat * Support to add and delete Port forward rules * add license * fix adding multiple pf rules * cleanup * fix lint check * fix smoke tests * fix smoke tests * Nsx add lb rule (#8161) * NSX: Create and delete NSX Static Nat rules * fix issues with static nat * add static nat * Support to add and delete Port forward rules * add license * fix adding multiple pf rules * cleanup * NSX: Add support to create and delete Load balancer rules * fix deletion of lb rules * add header file and update protocol detail * build failure fix * [NSX] Add SNAT support (#8100) * In progress add source NAT * Fix after merge * Fix tests * Fix NPE on isolated network deletion * Reserve source NAT IP when its not passed for NSX VPC * Create source NAT rule on VR NIC allocation * Fix update VPC and remove VPC to update and remove SNAT rule * Fix packaging * Address review comment * Fix build * fix build - unused import * Add defensive checks * Add missing design to NSX public guru --------- Co-authored-by: Pearl Dsilva <pearl1594@gmail.com> * NSX: Fix VR public NIC allocation (#8166) * NSX: fix LB member addition and deletion and add defensive checks (#8167) * Fix public NIC NPE on broadcast URI * NSX: Router Public nic to get IP from systemVM Ip range (#8172) * NSX: Router Public nic to get IP from systemVM Ip range * Fix VR IP address and setSourceNatIp command * NSX: hide systemVM reserved IP range SourceNAT * fix test --------- Co-authored-by: nvazquez <nicovazquez90@gmail.com> * fix test failure * test failure fix * [NSX] Fix update source NAT IP (#8176) * [NSX] Fix update source NAT IP * Fix startup * Fix API result * NSX - add LB route Advertizement (#8192) * [NSX] Add ACL types support (#8224) * NSX: Create segment group on segment creation * Add unit tests * Remove group for segment before removing segment * Create Distributed Firewall rules * Remove distributed firewall policy on segment deletion * Fix policy rule ID and add more unit tests * Fix DROP action rules and transform tests * Add new ACL rules * Fixes * associate security policies with groups and not to DFW and add deletion of rules * Fix name convention --------- Co-authored-by: Pearl Dsilva <pearl1594@gmail.com> * NSX: Fix creation of VPCs (#8320) * Fix ACL rules creation (#8323) * [NSX] Fix database views (#8325) * NSX: Add CKS Support & Firewall rules for Isolated Networks (#8189) * NSX: Add ALL LB IP to the list of route advertisements in tier1 * NSX: Support Source NAT on NSX Isolated networks * NSX: Cks Support * NSX: Create segment group on segment creation * Add unit tests * Remove group for segment before removing segment * Create Distributed Firewall rules * Remove distributed firewall policy on segment deletion * Fix policy rule ID and add more unit tests * Add support for routed NSX Isolated networks \n and non RFC 1918 compliant IPs * Add support for routed NSX Isolated networks \n and non RFC 1918 compliant IPs * Add Firewall rules * build failure - fix unit test * fix npes * Add support to delete firewall rules * update nsx cks offering * add license * update order of ports in PF & FW rules * fix filter for getting transport zones * CKS support changed - MTU updated, etc * add LB for CKS on VPC * address comments * adapt upstream cks logic for vpc * rever mtu hack * update UI changes as per upstream fix * change display test for CKS n/w offerings for isolated and VPC tiers * add extra line for linter * address comment * revert list change --------- Co-authored-by: nvazquez <nicovazquez90@gmail.com> * fix ui build failure * [NSX] Address SonarCloud Bugs (#8341) * [NSX] Address SonarCloud Bugs * Fix NSX API connection issues * NSX: Add unit tests to increase coverage (#8355) * NSX: Add unit tests * cleanup unused imports * add more unit tests * add tests for publicnsxnetworkguru * add license * fix build failures * address sonar comment * fix security hotspots * NSX: Add more unit tests (#8381) * NSX : Unit tests * remove unused imports * remove unused import causing build failure * fix build failures due to unused imports * fix build failure * fix test assertion * remove unused imports * remove unused import * Nsx UI zone bug (#8398) * NSX: Attempt to fix NSX Zone creation bug for public networks * fix zone wizard public traffic issue * add proper filtering of offerings based on VPC nsx mode * clean up console logs * NSX: Fix code smells and reported bugs (#8409) * NSX: Fix code smells and reported bugs * fox override issue * remove unused imports * fix test * refactor code to reduce complexity * add lisence * cleanup * fix build failure * fix build failure * address comments * test - add config to ignore certain files from test coverage * test exclusion of classes from test cov * rever pom changes * [NSX] Add more unit tests (#8431) * [NSX] Add more unit tests * More tests * Fix build errors * NSX: Prevent creation of L2 and Shared networks for NSX (#8463) * NSX: Prevent creation of L2 and Shared networks for NSX * add checks to backend to prevent creation of l2 and shared networks in nsx zones and filter only nsx offerings when creating isolated networks * cleanup * NSX: Fix code smells (#8436) * NSX: Fix code smells * Add changes to service creation logic * CKS: Add action to during firewall rule creation (#8498) * NSX,UI: Deduplicate network list when creating kubernetes clusters (#8513) * NSX: Make LB service selectable in network offering (#8512) * NSX: Make LB service selectable in network offering * fix label * address comments * address comments * NSX: Add appropriate error message when icmp type is set to -1 for NSX (#8504) * NSX: Add appropriate error message when icmp type is set to -1 for NSX * address comments * update text * fix test * fix test - build failure * fix test - build failure * NSX: Cleanup NSX resources during k8s cluster cleanup (#8528) * fix test failure * NSX: Improve segment deletion process (#8538) * NSX: Add passive monitor for NSX LB to test whether a server is available (#8533) * NSX: Add passive monitor for NSX LB to test whether a server is available * Add active monitors too * fix build failure * NSX: Add check for ICMP code / type for NSX zones (#8542) * NSX: Fix Routed Mode for Isolated and VPC networks (#8534) * NSX: Fix Routed Mode for Isolated and VPC networks * NSX: Fix Routed mode - add checks for ports added for FW rules * clean up code * fix build failure * NSX: Add retry logic with sleep to delete segments (#8554) * NSX: Add retry logic with sleep to delete segments * add logs * NSX: Fix custom ACL check (#2) * NSX: Fix custom ACL check * NSX: Fix custom ACL check * Nsx vpc routed mode (#5) * NSX: Fix VPC routed mode * NSX: VPC route mode * remove unnecessary changes * Nsx: Support internal LB (#4) * NSX: Support internal LB service in NSX * add lb removal logic * Fix UI issue hiding internal LB tab * Refactor method name --------- Co-authored-by: nvazquez <nicovazquez90@gmail.com> * NSX: Improve NSX resource cleanup process (#3) * Fix unit test * NSX: Add SourceNAT service to the default Routed offering for VPC (#13) * Fix VPC restart with cleanup (#12) * NSX: Fix ACL rule removal on replacement and fix rule order (#11) * NSX: fix smoke test failure for ACLs (#9) * Fix unit tests * Fix NSX plugin pom XML * NSX: Add support to re-order ACL rules (NSX FW rules) (#14) * [WIP] NSX: Add support to re-order ACL rules (NSX FW rules) * fix reordering of acl rules on all networks that it is associated to * clean up and attempt test fix * Fix tests * Remove unused import * tweak reorder logic --------- Co-authored-by: nvazquez <nicovazquez90@gmail.com> * Fix zone creation issue for internal load balancer * Fix * Fix unit test * fix logger * fix logger * fix logger * NSX: Fix VPC form to ignore source NAT IP when creating VPCs and fix label * Move SQL changes to the newest schema file * NSX: Last Fixes * Fix build --------- Co-authored-by: nvazquez <nicovazquez90@gmail.com>
1 parent 9a73a2f commit 6dc3d06

File tree

207 files changed

+11376
-533
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+11376
-533
lines changed

api/src/main/java/com/cloud/agent/api/to/NicTO.java

+19
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ public class NicTO extends NetworkTO {
3232
Map<NetworkOffering.Detail, String> details;
3333
boolean dpdkEnabled;
3434
Integer mtu;
35+
Long networkId;
36+
37+
String networkSegmentName;
3538

3639
public NicTO() {
3740
super();
@@ -127,4 +130,20 @@ public Integer getMtu() {
127130
public void setMtu(Integer mtu) {
128131
this.mtu = mtu;
129132
}
133+
134+
public Long getNetworkId() {
135+
return networkId;
136+
}
137+
138+
public void setNetworkId(Long networkId) {
139+
this.networkId = networkId;
140+
}
141+
142+
public String getNetworkSegmentName() {
143+
return networkSegmentName;
144+
}
145+
146+
public void setNetworkSegmentName(String networkSegmentName) {
147+
this.networkSegmentName = networkSegmentName;
148+
}
130149
}

api/src/main/java/com/cloud/agent/api/to/VirtualMachineTO.java

+9
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public class VirtualMachineTO {
8282

8383
Map<String, String> guestOsDetails = new HashMap<String, String>();
8484
Map<String, String> extraConfig = new HashMap<>();
85+
Map<Long, String> networkIdToNetworkNameMap = new HashMap<>();
8586
DeployAsIsInfoTO deployAsIsInfo;
8687

8788
public VirtualMachineTO(long id, String instanceName, VirtualMachine.Type type, int cpus, Integer speed, long minRam, long maxRam, BootloaderType bootloader,
@@ -392,6 +393,14 @@ public Map<String, String> getExtraConfig() {
392393
return extraConfig;
393394
}
394395

396+
public Map<Long, String> getNetworkIdToNetworkNameMap() {
397+
return networkIdToNetworkNameMap;
398+
}
399+
400+
public void setNetworkIdToNetworkNameMap(Map<Long, String> networkIdToNetworkNameMap) {
401+
this.networkIdToNetworkNameMap = networkIdToNetworkNameMap;
402+
}
403+
395404
public String getBootType() {
396405
return bootType;
397406
}

api/src/main/java/com/cloud/kubernetes/cluster/KubernetesClusterHelper.java

+1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@
2222
public interface KubernetesClusterHelper extends Adapter {
2323

2424
ControlledEntity findByUuid(String uuid);
25+
ControlledEntity findByVmId(long vmId);
2526
}

api/src/main/java/com/cloud/network/IpAddress.java

+2
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,6 @@ enum Purpose {
9797

9898
void setRuleState(State ruleState);
9999

100+
boolean isForSystemVms();
101+
100102
}

api/src/main/java/com/cloud/network/Network.java

+4
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ public static class Provider {
205205
//Add Tungsten Fabric provider
206206
public static final Provider Tungsten = new Provider("Tungsten", false);
207207

208+
public static final Provider Nsx = new Provider("Nsx", false);
209+
208210
private final String name;
209211
private final boolean isExternal;
210212

@@ -427,6 +429,8 @@ public void setIp6Address(String ip6Address) {
427429

428430
long getDataCenterId();
429431

432+
long getAccountId();
433+
430434
long getNetworkOfferingId();
431435

432436
@Override

api/src/main/java/com/cloud/network/NetworkService.java

+9
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.util.List;
2020
import java.util.Map;
2121

22+
import com.cloud.dc.DataCenter;
2223
import org.apache.cloudstack.api.command.admin.address.ReleasePodIpCmdByAdmin;
2324
import org.apache.cloudstack.api.command.admin.network.DedicateGuestVlanRangeCmd;
2425
import org.apache.cloudstack.api.command.admin.network.ListDedicatedGuestVlanRangesCmd;
@@ -55,6 +56,7 @@
5556
import com.cloud.utils.exception.CloudRuntimeException;
5657
import com.cloud.vm.Nic;
5758
import com.cloud.vm.NicSecondaryIp;
59+
import org.apache.cloudstack.network.element.InternalLoadBalancerElementService;
5860

5961
/**
6062
* The NetworkService interface is the "public" api to entities that make requests to the orchestration engine
@@ -87,6 +89,8 @@ IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId, Boolean displ
8789

8890
IpAddress reserveIpAddress(Account account, Boolean displayIp, Long ipAddressId) throws ResourceAllocationException;
8991

92+
IpAddress reserveIpAddressWithVlanDetail(Account account, DataCenter zone, Boolean displayIp, String vlanDetailKey) throws ResourceAllocationException;
93+
9094
boolean releaseReservedIpAddress(long ipAddressId) throws InsufficientAddressCapacityException;
9195

9296
boolean releaseIpAddress(long ipAddressId) throws InsufficientAddressCapacityException;
@@ -254,4 +258,9 @@ Network createPrivateNetwork(String networkName, String displayText, long physic
254258
PublicIpQuarantine updatePublicIpAddressInQuarantine(UpdateQuarantinedIpCmd cmd);
255259

256260
void removePublicIpAddressFromQuarantine(RemoveQuarantinedIpCmd cmd);
261+
262+
InternalLoadBalancerElementService getInternalLoadBalancerElementByType(VirtualRouterProvider.Type type);
263+
InternalLoadBalancerElementService getInternalLoadBalancerElementByNetworkServiceProviderId(long networkProviderId);
264+
InternalLoadBalancerElementService getInternalLoadBalancerElementById(long providerId);
265+
List<InternalLoadBalancerElementService> getInternalLoadBalancerElements();
257266
}

api/src/main/java/com/cloud/network/Networks.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ public <T> URI toUri(T value) {
128128
},
129129
UnDecided(null, null),
130130
OpenDaylight("opendaylight", String.class),
131-
TUNGSTEN("tf", String.class);
131+
TUNGSTEN("tf", String.class),
132+
NSX("nsx", String.class);
132133

133134
private final String scheme;
134135
private final Class<?> type;

api/src/main/java/com/cloud/network/VirtualRouterProvider.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
public interface VirtualRouterProvider extends InternalIdentity, Identity {
2323
public enum Type {
24-
VirtualRouter, ElasticLoadBalancerVm, VPCVirtualRouter, InternalLbVm, NetScalerVm
24+
VirtualRouter, ElasticLoadBalancerVm, VPCVirtualRouter, InternalLbVm, NetScalerVm, Nsx
2525
}
2626

2727
public Type getType();

api/src/main/java/com/cloud/network/element/NetworkACLServiceProvider.java

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.cloud.exception.ResourceUnavailableException;
2222
import com.cloud.network.Network;
2323
import com.cloud.network.vpc.NetworkACLItem;
24+
import com.cloud.network.vpc.Vpc;
2425

2526
public interface NetworkACLServiceProvider extends NetworkElement {
2627

@@ -32,4 +33,6 @@ public interface NetworkACLServiceProvider extends NetworkElement {
3233
*/
3334
boolean applyNetworkACLs(Network config, List<? extends NetworkACLItem> rules) throws ResourceUnavailableException;
3435

36+
boolean reorderAclRules(Vpc vpc, List<? extends Network> networks, List<? extends NetworkACLItem> networkACLItems);
37+
3538
}

api/src/main/java/com/cloud/network/guru/NetworkGuru.java

+10-6
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,24 @@ public interface NetworkGuru extends Adapter {
7979
* be used to make determination can be isolation methods, services
8080
* provided on the guest network and the service provider that's on the
8181
* guest network.
82-
*
82+
* <p>
8383
* If a network is already fully substantiated with the necessary resources
8484
* during this design phase, then the state should be set to Setup. If
8585
* the resources are not allocated at this point, the state should be set
8686
* to Allocated.
8787
*
88-
* @param offering network offering that contains the package of services
89-
* the end user intends to use on that network.
90-
* @param plan where is this network being deployed.
88+
* @param offering network offering that contains the package of services
89+
* the end user intends to use on that network.
90+
* @param plan where is this network being deployed.
9191
* @param userSpecified user specified parameters for this network.
92-
* @param owner owner of this network.
92+
* @param name
93+
* @param vpcId
94+
* @param owner owner of this network.
9395
* @return Network
9496
*/
95-
Network design(NetworkOffering offering, DeploymentPlan plan, Network userSpecified, Account owner);
97+
Network design(NetworkOffering offering, DeploymentPlan plan, Network userSpecified, String name, Long vpcId, Account owner);
98+
99+
void setup(Network network, long networkId);
96100

97101
/**
98102
* For guest networks that are in Allocated state after the design stage,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package com.cloud.network.nsx;
18+
19+
import org.apache.cloudstack.api.Identity;
20+
import org.apache.cloudstack.api.InternalIdentity;
21+
22+
public interface NsxProvider extends InternalIdentity, Identity {
23+
String getHostname();
24+
25+
String getPort();
26+
String getProviderName();
27+
String getUsername();
28+
long getZoneId();
29+
30+
String getTier0Gateway();
31+
String getEdgeCluster();
32+
33+
String getTransportZone();
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package com.cloud.network.nsx;
18+
19+
import com.cloud.network.IpAddress;
20+
import com.cloud.network.vpc.Vpc;
21+
22+
public interface NsxService {
23+
24+
boolean createVpcNetwork(Long zoneId, long accountId, long domainId, Long vpcId, String vpcName, boolean sourceNatEnabled);
25+
boolean updateVpcSourceNatIp(Vpc vpc, IpAddress address);
26+
}

api/src/main/java/com/cloud/network/vpc/VpcOffering.java

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public enum State {
2929
public static final String defaultVPCOfferingName = "Default VPC offering";
3030
public static final String defaultVPCNSOfferingName = "Default VPC offering with Netscaler";
3131
public static final String redundantVPCOfferingName = "Redundant VPC offering";
32+
public static final String DEFAULT_VPC_NAT_NSX_OFFERING_NAME = "VPC offering with NSX - NAT Mode";
33+
public static final String DEFAULT_VPC_ROUTE_NSX_OFFERING_NAME = "VPC offering with NSX - Route Mode";
3234

3335
/**
3436
*
@@ -53,6 +55,10 @@ public enum State {
5355
*/
5456
boolean isDefault();
5557

58+
boolean isForNsx();
59+
60+
String getNsxMode();
61+
5662
/**
5763
* @return service offering id used by VPC virtual router
5864
*/

api/src/main/java/com/cloud/network/vpc/VpcProvisioningService.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public interface VpcProvisioningService {
3636
VpcOffering createVpcOffering(String name, String displayText, List<String> supportedServices,
3737
Map<String, List<String>> serviceProviders,
3838
Map serviceCapabilitystList, NetUtils.InternetProtocol internetProtocol,
39-
Long serviceOfferingId, List<Long> domainIds, List<Long> zoneIds, VpcOffering.State state);
39+
Long serviceOfferingId, Boolean forNsx, String mode,
40+
List<Long> domainIds, List<Long> zoneIds, VpcOffering.State state);
4041

4142
Pair<List<? extends VpcOffering>,Integer> listVpcOfferings(ListVPCOfferingsCmd cmd);
4243

api/src/main/java/com/cloud/offering/NetworkOffering.java

+14
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ public enum Detail {
4343
InternalLbProvider, PublicLbProvider, servicepackageuuid, servicepackagedescription, PromiscuousMode, MacAddressChanges, ForgedTransmits, MacLearning, RelatedNetworkOffering, domainid, zoneid, pvlanType, internetProtocol
4444
}
4545

46+
public enum NsxMode {
47+
NATTED,
48+
ROUTED
49+
}
50+
4651
public final static String SystemPublicNetwork = "System-Public-Network";
4752
public final static String SystemControlNetwork = "System-Control-Network";
4853
public final static String SystemManagementNetwork = "System-Management-Network";
@@ -52,6 +57,11 @@ public enum Detail {
5257

5358
public final static String DefaultSharedNetworkOfferingWithSGService = "DefaultSharedNetworkOfferingWithSGService";
5459
public static final String DEFAULT_TUNGSTEN_SHARED_NETWORK_OFFERING_WITH_SGSERVICE = "DefaultTungstenSharedNetworkOfferingWithSGService";
60+
public static final String DEFAULT_NAT_NSX_OFFERING_FOR_VPC = "DefaultNATNSXNetworkOfferingForVpc";
61+
public static final String DEFAULT_NAT_NSX_OFFERING_FOR_VPC_WITH_ILB = "DefaultNATNSXNetworkOfferingForVpcWithInternalLB";
62+
public static final String DEFAULT_ROUTED_NSX_OFFERING_FOR_VPC = "DefaultRoutedNSXNetworkOfferingForVpc";
63+
public static final String DEFAULT_NAT_NSX_OFFERING = "DefaultNATNSXNetworkOffering";
64+
public static final String DEFAULT_ROUTED_NSX_OFFERING = "DefaultRoutedNSXNetworkOffering";
5565
public final static String QuickCloudNoServices = "QuickCloudNoServices";
5666
public final static String DefaultIsolatedNetworkOfferingWithSourceNatService = "DefaultIsolatedNetworkOfferingWithSourceNatService";
5767
public final static String OvsIsolatedNetworkOfferingWithSourceNatService = "OvsIsolatedNetworkOfferingWithSourceNatService";
@@ -90,6 +100,10 @@ public enum Detail {
90100

91101
boolean isForTungsten();
92102

103+
boolean isForNsx();
104+
105+
String getNsxMode();
106+
93107
TrafficType getTrafficType();
94108

95109
boolean isSpecifyVlan();

api/src/main/java/org/apache/cloudstack/api/ApiConstants.java

+18-2
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,8 @@ public class ApiConstants {
303303
public static final String MIGRATIONS = "migrations";
304304
public static final String MEMORY = "memory";
305305
public static final String MODE = "mode";
306+
public static final String NSX_MODE = "nsxmode";
307+
public static final String NSX_ENABLED = "isnsxenabled";
306308
public static final String NAME = "name";
307309
public static final String METHOD_NAME = "methodname";
308310
public static final String NETWORK_DOMAIN = "networkdomain";
@@ -704,6 +706,12 @@ public class ApiConstants {
704706
public static final String VSWITCH_TYPE_PUBLIC_TRAFFIC = "publicvswitchtype";
705707
public static final String VSWITCH_NAME_GUEST_TRAFFIC = "guestvswitchname";
706708
public static final String VSWITCH_NAME_PUBLIC_TRAFFIC = "publicvswitchname";
709+
710+
// NSX
711+
public static final String EDGE_CLUSTER = "edgecluster";
712+
public static final String TIER0_GATEWAY = "tier0gateway";
713+
714+
public static final String TRANSPORT_ZONE = "transportzone";
707715
// Tungsten-Fabric
708716
public static final String TUNGSTEN_VIRTUAL_ROUTER_UUID = "tungstenvirtualrouteruuid";
709717
public static final String TUNGSTEN_PROVIDER_HOSTNAME = "tungstenproviderhostname";
@@ -825,6 +833,9 @@ public class ApiConstants {
825833
public static final String FORCE_ENCAP = "forceencap";
826834
public static final String SPLIT_CONNECTIONS = "splitconnections";
827835
public static final String FOR_VPC = "forvpc";
836+
public static final String FOR_NSX = "fornsx";
837+
public static final String NSX_SUPPORT_LB = "nsxsupportlb";
838+
public static final String NSX_SUPPORTS_INTERNAL_LB = "nsxsupportsinternallb";
828839
public static final String FOR_TUNGSTEN = "fortungsten";
829840
public static final String SHRINK_OK = "shrinkok";
830841
public static final String NICIRA_NVP_DEVICE_ID = "nvpdeviceid";
@@ -834,6 +845,11 @@ public class ApiConstants {
834845
public static final String NICIRA_NVP_L2_GATEWAYSERVICE_UUID = "l2gatewayserviceuuid";
835846
public static final String NSX_LOGICAL_SWITCH = "nsxlogicalswitch";
836847
public static final String NSX_LOGICAL_SWITCH_PORT = "nsxlogicalswitchport";
848+
public static final String NSX_PROVIDER_UUID = "nsxprovideruuid";
849+
public static final String NSX_PROVIDER_HOSTNAME = "nsxproviderhostname";
850+
851+
public static final String NSX_PROVIDER_PORT = "nsxproviderport";
852+
public static final String NSX_CONTROLLER_ID = "nsxcontrollerid";
837853
public static final String S3_ACCESS_KEY = "accesskey";
838854
public static final String S3_SECRET_KEY = "secretkey";
839855
public static final String S3_END_POINT = "endpoint";
@@ -958,6 +974,7 @@ public class ApiConstants {
958974
public static final String SUPPORTS_REGION_LEVEL_VPC = "supportsregionLevelvpc";
959975
public static final String SUPPORTS_STRECHED_L2_SUBNET = "supportsstrechedl2subnet";
960976
public static final String SUPPORTS_PUBLIC_ACCESS = "supportspublicaccess";
977+
public static final String SUPPORTS_INTERNAL_LB = "supportsinternallb";
961978
public static final String SUPPORTS_VM_AUTOSCALING = "supportsvmautoscaling";
962979
public static final String REGION_LEVEL_VPC = "regionlevelvpc";
963980
public static final String STRECHED_L2_SUBNET = "strechedl2subnet";
@@ -1076,14 +1093,13 @@ public class ApiConstants {
10761093
public static final String SOURCE_NAT_IP = "sourcenatipaddress";
10771094
public static final String SOURCE_NAT_IP_ID = "sourcenatipaddressid";
10781095
public static final String HAS_RULES = "hasrules";
1096+
public static final String NSX_DETAIL_KEY = "forNsx";
10791097
public static final String DISK_PATH = "diskpath";
10801098
public static final String IMPORT_SOURCE = "importsource";
10811099
public static final String TEMP_PATH = "temppath";
10821100
public static final String OBJECT_STORAGE = "objectstore";
1083-
10841101
public static final String HEURISTIC_RULE = "heuristicrule";
10851102
public static final String HEURISTIC_TYPE_VALID_OPTIONS = "Valid options are: ISO, SNAPSHOT, TEMPLATE and VOLUME.";
1086-
10871103
public static final String MANAGEMENT = "management";
10881104
public static final String IS_VNF = "isvnf";
10891105
public static final String VNF_NICS = "vnfnics";

api/src/main/java/org/apache/cloudstack/api/BaseCmd.java

-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import org.apache.cloudstack.alert.AlertService;
3939
import org.apache.cloudstack.annotation.AnnotationService;
4040
import org.apache.cloudstack.context.CallContext;
41-
import org.apache.cloudstack.network.element.InternalLoadBalancerElementService;
4241
import org.apache.cloudstack.network.lb.ApplicationLoadBalancerService;
4342
import org.apache.cloudstack.network.lb.InternalLoadBalancerVMService;
4443
import org.apache.cloudstack.query.QueryService;
@@ -201,8 +200,6 @@ public static enum CommandType {
201200
@Inject
202201
public AffinityGroupService _affinityGroupService;
203202
@Inject
204-
public InternalLoadBalancerElementService _internalLbElementSvc;
205-
@Inject
206203
public InternalLoadBalancerVMService _internalLbSvc;
207204
@Inject
208205
public NetworkModel _ntwkModel;

0 commit comments

Comments
 (0)