Skip to content

Commit 0d71946

Browse files
nvazquezPearl1594
andauthored
NSX Integration Documentation (#378)
* NSX Integration * In progress docs for zone creation * add details to the nsx plugin * tweaks * add additional notes --------- Co-authored-by: Pearl Dsilva <pearl1594@gmail.com>
1 parent 11fa214 commit 0d71946

File tree

5 files changed

+230
-0
lines changed

5 files changed

+230
-0
lines changed
21.6 KB
Loading
62.4 KB
Loading
60.5 KB
Loading

source/plugins/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ This is the Apache CloudStack Plugins guide. This section gives information for
3232

3333
cloudian-connector
3434
nicira-plugin
35+
nsx-plugin
3536
vxlan
3637
ovs-plugin
3738
ipv6

source/plugins/nsx-plugin.rst

Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
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+
http://www.apache.org/licenses/LICENSE-2.0
9+
Unless required by applicable law or agreed to in writing,
10+
software distributed under the License is distributed on an
11+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
12+
KIND, either express or implied. See the License for the
13+
specific language governing permissions and limitations
14+
under the License.
15+
16+
17+
The VMware NSX Plugin
18+
=====================
19+
20+
Introduction
21+
------------
22+
23+
The VMware NSX Plugin introduces VMware NSX 4 as a network service provider in CloudStack to be able to create and manage Virtual Private Clouds (VPCs) in CloudStack, being able to orchestrate the following network functionalities:
24+
25+
- Routing between VPC network tiers (NSX segments)
26+
- Access Lists (ACLs) between VPC tiers and "public" network (TCP, UDP, ICMP) both as global egress rules and “public” IP specific ingress rules.
27+
- ACLs between VPC network tiers (TCP, UDP, ICMP)
28+
- Port Forwarding between “public” networks and VPC network tier
29+
- External load balancing – between VPCs network tiers and “public” networks (runs on Edge Cluster)
30+
- Internal load balancing – between VPC network tiers
31+
- Password injection, UserData and SSH Keys
32+
- External, Internal DNS
33+
- DHCP
34+
- Kubernetes host orchestration, supporting CKS on VPCs
35+
36+
Supported Versions
37+
------------------
38+
39+
.. cssclass:: table-striped table-bordered table-hover
40+
41+
+--------------+----------------------+--------------------+
42+
| Hypervisor | CloudStack Version | VMware NSX Version |
43+
+==============+======================+====================+
44+
| VMware | >= 4.20 | 4.1 |
45+
+--------------+----------------------+--------------------+
46+
47+
Table: Supported Versions
48+
49+
Configuration
50+
-------------
51+
52+
Prerequisites
53+
~~~~~~~~~~~~~
54+
55+
The VMware NSX plugin is enabled by the 'nsx.plugin.enable' setting, false by default. It enables the NSX Plugin on CloudStack when it is set to true. The global setting is non-dynamic, that is, the management server would need to be restarted after being modified.
56+
57+
Prior to creating the zone, ensure that the global setting: 'vmware.management.portgroup' is set to the correct management network for ESXi hosts.
58+
59+
Zone creation
60+
~~~~~~~~~~~~~
61+
62+
For an NSX-based zone, the administrator will have to create atleast 2 physical networks, one for Public and Guest networks with **NSX** isolation method and one for Management (and / or storage networks),
63+
which uses VLAN isolation method.
64+
65+
**Physical network for Public and Guest traffic:**
66+
Isolation method: NSX
67+
VLAN ID must be empty
68+
vSwitch type: distributed virtual switch (dvSwitch)
69+
vSwitch name: name of the dvSwitch to handle NSX traffic
70+
71+
**Phsyical network for Management traffic:**
72+
Isolation method: VLAN
73+
VLAN ID: ID for Management traffic
74+
vSwitch type: distributed virtual switch (dvSwitch)
75+
vSwitch name: name of the dvSwitch to handle Management traffic.
76+
77+
78+
An example of physical networks setup:
79+
80+
.. |nsx-phy-networks.png| image:: /_static/images/nsx-phy-networks.png
81+
:alt: Physical Networks with NSX
82+
83+
The next stage of zone creation would be to link the NSX controller to the CloudStack.
84+
85+
.. |nsx-provider.png| image:: /_static/images/nsx-provider.png
86+
:alt: NSX Provider details
87+
88+
The administrator then needs to setup the IP ranges for Public and NSX Public traffic.
89+
- Public Traffic: IP range for non-NSX public traffic used by system VMs
90+
- NSX Public Traffic: IP range to use for Public IP Addresses on NSX-based VPCs or Isolated Networks.
91+
92+
.. |nsx-public-traffic.png| image:: /_static/images/nsx-public-traffic.png
93+
:alt: NSX Traffic
94+
95+
The subsequent steps of zone creation remain unchanged and once the zone is successfully created and enabled, the system VMs come up with IPs from the Public IP Range (not the NSX public IP range).
96+
97+
VPC creation on NSX
98+
~~~~~~~~~~~~~~~~~~~~
99+
100+
When a VPC is created in CloudStack, the following operations occur on NSX end:
101+
- CloudStack creates a Tier1 Gateway with the following:
102+
103+
- ID and name on NSX: D<d_id>-A<a_id>-Z<z_id>-V<v_id>
104+
- Linked Tier0 Gateway: the Tier0 Gateway provided on the NSX Controller creation in CloudStack
105+
- For NAT mode VPCs, the following Route Advertisement settings are enabled:
106+
- All IPSec Local Endpoints
107+
- All NAT IPs
108+
- All LB VIP Routes
109+
- For ROUTED mode VPCs, the following Route Advertisement settings are enabled:
110+
- All IPSec Local Endpoints
111+
- All NAT IPs
112+
- All LB VIP Routes
113+
- All Connected Segments & Service Ports
114+
115+
- The VPC Virtual Router acquires a free IP address on from the NSX Public Range and sets it as the Source NAT IP of the VPC.
116+
- A new NAT Rule is created on NSX:
117+
- ID and Name: D<d_id>-A<a_id>-Z<z_id>-V<v_id>-NAT
118+
- Action: SNAT
119+
- Source IP: Any
120+
- Destination IP: Any
121+
- Translated IP: The Source NAT IP of the VPC (selected from the NSX Public Range)
122+
123+
124+
VPC Tier creation on NSX
125+
~~~~~~~~~~~~~~~~~~~~~~~~~
126+
127+
On VPC network tier creation, CloudStack creates the following NSX elements:
128+
- A Segment is linked to the VPC Tier1 Gateway with the following:
129+
- ID and name on NSX: D<d_id>-A<a_id>-Z<z_id>-V<v_id>-S<s_id>
130+
- Linked Tier1 Gateway: The VPC Tier1 Gateway with name: D<d_id>-A<a_id>-Z<z_id>-V<v_id>
131+
- Linked Transport Zone: The Transport Zone provided on NSX Controller creation in CloudStack
132+
- Subnets: The VPC network tier CIDR provided on CloudStack
133+
134+
- A Group under Inventory with the following:
135+
- ID and name on NSX: D<d_id>-A<a_id>-Z<z_id>-V<v_id>-S<s_id> (same as the segment)
136+
- Group members: The created NSX segment
137+
138+
VPC network ACL creation
139+
~~~~~~~~~~~~~~~~~~~~~~~~~
140+
141+
CloudStack allows creating ACL rules for NSX based network tiers. The supported protocols for creating NSX based ACL rules are:are TCP, UDP and ICMP.
142+
Network ACLs can be assigned to any network tier in the VPC during network tier creation or an existing ACL on the network tier can be replaced.
143+
144+
VPC tier Implementation
145+
~~~~~~~~~~~~~~~~~~~~~~~~
146+
147+
When the first VM is created on the network tier, CloudStack creates the following NSX elements:
148+
149+
- A DHCP Relay Networking Profile is created; associated to the segment:
150+
- ID and name: D<d_id>-A<a_id>-Z<z_id>-V<v_id>-S<s_id>-Relay
151+
- Server IP address: A free IP on the network tier CIDR is selected.
152+
153+
- A Distributed Firewall policy:
154+
- ID and name: D<d_id>-A<a_id>-Z<z_id>-V<v_id>-S<s_id> (same as the segment)
155+
- Applied to the Group: D<d_id>-A<a_id>-Z<z_id>-V<v_id>-S<s_id>
156+
157+
- Distributed Firewall policy rules under the created policy:
158+
- ID and name: D<d_id>-A<a_id>-Z<z_id>-V<v_id>-S<s_id>-R<r_id> where r_id is the 'id' column on the 'network_acl_items' table for all the rules on the selected Network ACL
159+
- Action: Allow or Drop depending on the CloudStack ALC rule action (Allow or Deny)
160+
- Service:
161+
- Any: for the default 'Allow all' and 'Deny all' CloudStack ACLs
162+
- In case there is a default service for the selected protocol and port then CloudStack uses the pre-existing one. In case it does not exist, then a new service is created, matching the protocol
163+
164+
- After acquiring a new Public IP Address on a VPC, users can:
165+
- Make the acquired IP address the Source NAT IP: This will replace the current NAT rule associated with the VPC Tier 1 Gateway, replacing the Translated IP for the new one.
166+
- Enable Static NAT: a new NAT rule is created on NSX with:
167+
- ID and name: D<d_id>-A<a_id>-Z<z_id>-V<v_id>-STATICNAT
168+
- Action: DNAT
169+
- Destination IP: The acquired NSX Public IP address
170+
- Translated IP: The Guest VM IP address
171+
172+
- Create Port Forwarding rules: For each CloudStack Port Forwarding rule, a new NAT rule is created on NSX, with:
173+
- ID and name: D<d_id>-A<a_id>-Z<z_id>-V<v_id>-PF<pf_id> where pf_id is the 'id' column on the 'port_forwarding_rules' table, for the created rule
174+
- Gateway: The VPC Tier 1 Gateway (with name D<d_id>-A<a_id>-Z<z_id>-V<v_id>)
175+
- Action: DNAT
176+
- Source IP: Any
177+
- Destination IP: The acquired NSX Public IP address
178+
- Destination Port: The start-end port range
179+
- Translated IP: The guest IP of the VM
180+
- Translated Port: The start-end port range
181+
182+
- Create Load Balancing rules: There will be one load balancer created per VPC if load balancer rules are created for a specific VPC. For every subsequent load balancer rule created, additional virtual servers and server pools are added to the load balancer:
183+
- ID and name: D<d_id>-A<a_id>-Z<z_id>-V<v_id>-LB<lb_id> where lb_id is the 'id' column on the 'load_balancing_rules' table, for the created rule
184+
- Attachment: Tier 1 Gateway with ID and name: D<d_id>-A<a_id>-Z<z_id>-V<v_id>
185+
- Virtual Server: a new Virtual Server is created, with:
186+
- ID and name: D<d_id>-A<a_id>-Z<z_id>-V<v_id>-LB<lb_id>-VS
187+
- IP address: The acquired NSX Public IP address
188+
- Port: The public port
189+
- Type: TCP or UDP depending on the selected protocol
190+
- Server Pool: a new Server Pool is created, with:
191+
- ID and name: D<d_id>-A<a_id>-Z<z_id>-V<v_id>-LB<lb_id>-SP
192+
- Algorithm: Supported values: Round-robin, least connection
193+
- Members: All the selected VMs are added as server pool members, with:
194+
- ID and name: D<d_id>-A<a_id>-Z<z_id>-V<v_id>-VM<vm_id>
195+
- IP address: The VM Guest IP address
196+
- Port: The private port
197+
- Active Monitor: a new Active Monitor is created, with:
198+
- ID and name: D<d_id>-A<a_id>-Z<z_id>-V<v_id>-LB<lb_id>-SP-<PROTO>-<PORT>-AM, where PROTO is the selected Protocol, and PORT is the selected Private Port
199+
- Passive Monitor: default passive monitor
200+
201+
.. note::
202+
203+
The following notations were used in the above section:
204+
205+
- d_id: the 'id' column on the 'domain' table for the caller domain
206+
- a_id: the 'id' column of the 'accounts' table for the owner account
207+
- z_id: the 'id' column of the 'datacenter' table for the zone
208+
- v_id: the 'id' column of the 'vpcs' table for the new VPC being created
209+
- s_id: the 'id' column of the 'networks' table for the network tier being created
210+
211+
212+
CKS on NSX
213+
~~~~~~~~~~~
214+
215+
To enable CKS clusters on NSX networks respective default network offerings have been created for isolated and VPC tiers.
216+
217+
**DefaultNSXNetworkOfferingforKubernetesService** - is the default pre-created NSX-based network offering for enabling deployment of CKS clusters on isolated networks.
218+
**DefaultNSXVPCNetworkOfferingforKubernetesService** - is the default pre-created NSX-based network offering to enable CKS cluster deployment on VPC tiers.
219+
220+
221+
When deploying CKS clusters, it is possible to either select a pre-existing network or allow CloudStack create a new network for the cluster during the deployment. If one chooses the latter means of cluster deployment on a NSX-based environment, it would be needed that the 'cloud.kubernetes.cluster.network.offering' global setting be updated to point to either the default offerings or the appropriate NSX-based offering created.
222+
223+
All the network resources required by the CKS cluster such as load balancer, firewall rules, port forwarding rules, etc., will be created on and provided by NSX.
224+
225+
Additional Notes
226+
~~~~~~~~~~~~~~~~~
227+
228+
- Ports 67-68 need to be manually opened for network tiers of VPCs created in NSX based zones with default_deny ACL for DHCP to work as expected.
229+
- When creating routed VPC networks in NSX-enabled zones, ensure that no 2 VPCs use the same CIDR, to prevent IP conflicts upstream (BGP).

0 commit comments

Comments
 (0)