Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 1 | ====================================== |
Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 2 | Using DevStack with neutron Networking |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 3 | ====================================== |
| 4 | |
Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 5 | This guide will walk you through using OpenStack neutron with the ML2 |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 6 | plugin and the Open vSwitch mechanism driver. |
| 7 | |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 8 | |
Sean M. Collins | 2977b30 | 2016-01-25 09:10:52 -0500 | [diff] [blame] | 9 | .. _single-interface-ovs: |
| 10 | |
Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 11 | Using Neutron with a Single Interface |
| 12 | ===================================== |
| 13 | |
| 14 | In some instances, like on a developer laptop, there is only one |
| 15 | network interface that is available. In this scenario, the physical |
| 16 | interface is added to the Open vSwitch bridge, and the IP address of |
| 17 | the laptop is migrated onto the bridge interface. That way, the |
Sean Dague | db48db1 | 2016-04-06 08:09:31 -0400 | [diff] [blame] | 18 | physical interface can be used to transmit self service project |
| 19 | network traffic, the OpenStack API traffic, and management traffic. |
Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 20 | |
| 21 | |
Sean M. Collins | 6b1f499 | 2016-03-10 12:23:09 -0500 | [diff] [blame] | 22 | .. warning:: |
| 23 | |
| 24 | When using a single interface networking setup, there will be a |
| 25 | temporary network outage as your IP address is moved from the |
| 26 | physical NIC of your machine, to the OVS bridge. If you are SSH'd |
| 27 | into the machine from another computer, there is a risk of being |
| 28 | disconnected from your ssh session (due to arp cache |
| 29 | invalidation), which would stop the stack.sh or leave it in an |
| 30 | unfinished state. In these cases, start stack.sh inside its own |
| 31 | screen session so it can continue to run. |
| 32 | |
| 33 | |
Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 34 | Physical Network Setup |
| 35 | ---------------------- |
| 36 | |
| 37 | In most cases where DevStack is being deployed with a single |
| 38 | interface, there is a hardware router that is being used for external |
| 39 | connectivity and DHCP. The developer machine is connected to this |
Mike Spreitzer | 4baa4ce | 2016-01-26 14:06:17 -0500 | [diff] [blame] | 40 | network and is on a shared subnet with other machines. The |
| 41 | `local.conf` exhibited here assumes that 1500 is a reasonable MTU to |
| 42 | use on that network. |
Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 43 | |
| 44 | .. nwdiag:: |
| 45 | |
| 46 | nwdiag { |
| 47 | inet [ shape = cloud ]; |
| 48 | router; |
| 49 | inet -- router; |
| 50 | |
| 51 | network hardware_network { |
| 52 | address = "172.18.161.0/24" |
| 53 | router [ address = "172.18.161.1" ]; |
Sean M. Collins | 1650166 | 2015-10-12 11:01:44 -0400 | [diff] [blame] | 54 | devstack-1 [ address = "172.18.161.6" ]; |
Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 55 | } |
| 56 | } |
| 57 | |
| 58 | |
| 59 | DevStack Configuration |
| 60 | ---------------------- |
| 61 | |
Sean M. Collins | 1650166 | 2015-10-12 11:01:44 -0400 | [diff] [blame] | 62 | The following is a complete `local.conf` for the host named |
| 63 | `devstack-1`. It will run all the API and services, as well as |
| 64 | serving as a hypervisor for guest instances. |
Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 65 | |
| 66 | :: |
| 67 | |
Sean M. Collins | 1650166 | 2015-10-12 11:01:44 -0400 | [diff] [blame] | 68 | [[local|localrc]] |
Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 69 | HOST_IP=172.18.161.6 |
| 70 | SERVICE_HOST=172.18.161.6 |
| 71 | MYSQL_HOST=172.18.161.6 |
| 72 | RABBIT_HOST=172.18.161.6 |
| 73 | GLANCE_HOSTPORT=172.18.161.6:9292 |
Balagopal | 7ed812c | 2016-03-01 04:43:31 +0000 | [diff] [blame] | 74 | ADMIN_PASSWORD=secret |
| 75 | DATABASE_PASSWORD=secret |
| 76 | RABBIT_PASSWORD=secret |
| 77 | SERVICE_PASSWORD=secret |
Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 78 | |
Sean M. Collins | 1650166 | 2015-10-12 11:01:44 -0400 | [diff] [blame] | 79 | # Do not use Nova-Network |
| 80 | disable_service n-net |
| 81 | # Enable Neutron |
| 82 | ENABLED_SERVICES+=,q-svc,q-dhcp,q-meta,q-agt,q-l3 |
| 83 | |
| 84 | |
Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 85 | ## Neutron options |
| 86 | Q_USE_SECGROUP=True |
Christian Berendt | 1c39482 | 2015-09-10 12:15:16 +0200 | [diff] [blame] | 87 | FLOATING_RANGE="172.18.161.0/24" |
Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 88 | FIXED_RANGE="10.0.0.0/24" |
| 89 | Q_FLOATING_ALLOCATION_POOL=start=172.18.161.250,end=172.18.161.254 |
| 90 | PUBLIC_NETWORK_GATEWAY="172.18.161.1" |
Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 91 | PUBLIC_INTERFACE=eth0 |
Sean M. Collins | 2977b30 | 2016-01-25 09:10:52 -0500 | [diff] [blame] | 92 | |
| 93 | # Open vSwitch provider networking configuration |
Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 94 | Q_USE_PROVIDERNET_FOR_PUBLIC=True |
| 95 | OVS_PHYSICAL_BRIDGE=br-ex |
| 96 | PUBLIC_BRIDGE=br-ex |
| 97 | OVS_BRIDGE_MAPPINGS=public:br-ex |
| 98 | |
| 99 | |
Sean M. Collins | 1650166 | 2015-10-12 11:01:44 -0400 | [diff] [blame] | 100 | Adding Additional Compute Nodes |
| 101 | ------------------------------- |
| 102 | |
| 103 | Let's suppose that after installing DevStack on the first host, you |
| 104 | also want to do multinode testing and networking. |
| 105 | |
| 106 | Physical Network Setup |
| 107 | ~~~~~~~~~~~~~~~~~~~~~~ |
| 108 | |
| 109 | .. nwdiag:: |
| 110 | |
| 111 | nwdiag { |
| 112 | inet [ shape = cloud ]; |
| 113 | router; |
| 114 | inet -- router; |
| 115 | |
| 116 | network hardware_network { |
| 117 | address = "172.18.161.0/24" |
| 118 | router [ address = "172.18.161.1" ]; |
| 119 | devstack-1 [ address = "172.18.161.6" ]; |
| 120 | devstack-2 [ address = "172.18.161.7" ]; |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | |
| 125 | After DevStack installs and configures Neutron, traffic from guest VMs |
| 126 | flows out of `devstack-2` (the compute node) and is encapsulated in a |
| 127 | VXLAN tunnel back to `devstack-1` (the control node) where the L3 |
| 128 | agent is running. |
| 129 | |
| 130 | :: |
| 131 | |
| 132 | stack@devstack-2:~/devstack$ sudo ovs-vsctl show |
| 133 | 8992d965-0ba0-42fd-90e9-20ecc528bc29 |
| 134 | Bridge br-int |
| 135 | fail_mode: secure |
| 136 | Port br-int |
| 137 | Interface br-int |
| 138 | type: internal |
| 139 | Port patch-tun |
| 140 | Interface patch-tun |
| 141 | type: patch |
| 142 | options: {peer=patch-int} |
| 143 | Bridge br-tun |
| 144 | fail_mode: secure |
| 145 | Port "vxlan-c0a801f6" |
| 146 | Interface "vxlan-c0a801f6" |
| 147 | type: vxlan |
| 148 | options: {df_default="true", in_key=flow, local_ip="172.18.161.7", out_key=flow, remote_ip="172.18.161.6"} |
| 149 | Port patch-int |
| 150 | Interface patch-int |
| 151 | type: patch |
| 152 | options: {peer=patch-tun} |
| 153 | Port br-tun |
| 154 | Interface br-tun |
| 155 | type: internal |
| 156 | ovs_version: "2.0.2" |
| 157 | |
| 158 | Open vSwitch on the control node, where the L3 agent runs, is |
| 159 | configured to de-encapsulate traffic from compute nodes, then forward |
| 160 | it over the `br-ex` bridge, where `eth0` is attached. |
| 161 | |
| 162 | :: |
| 163 | |
| 164 | stack@devstack-1:~/devstack$ sudo ovs-vsctl show |
| 165 | 422adeea-48d1-4a1f-98b1-8e7239077964 |
| 166 | Bridge br-tun |
| 167 | fail_mode: secure |
| 168 | Port br-tun |
| 169 | Interface br-tun |
| 170 | type: internal |
| 171 | Port patch-int |
| 172 | Interface patch-int |
| 173 | type: patch |
| 174 | options: {peer=patch-tun} |
| 175 | Port "vxlan-c0a801d8" |
| 176 | Interface "vxlan-c0a801d8" |
| 177 | type: vxlan |
| 178 | options: {df_default="true", in_key=flow, local_ip="172.18.161.6", out_key=flow, remote_ip="172.18.161.7"} |
| 179 | Bridge br-ex |
| 180 | Port phy-br-ex |
| 181 | Interface phy-br-ex |
| 182 | type: patch |
| 183 | options: {peer=int-br-ex} |
| 184 | Port "eth0" |
| 185 | Interface "eth0" |
| 186 | Port br-ex |
| 187 | Interface br-ex |
| 188 | type: internal |
| 189 | Bridge br-int |
| 190 | fail_mode: secure |
| 191 | Port "tapce66332d-ea" |
| 192 | tag: 1 |
| 193 | Interface "tapce66332d-ea" |
| 194 | type: internal |
| 195 | Port "qg-65e5a4b9-15" |
| 196 | tag: 2 |
| 197 | Interface "qg-65e5a4b9-15" |
| 198 | type: internal |
| 199 | Port "qr-33e5e471-88" |
| 200 | tag: 1 |
| 201 | Interface "qr-33e5e471-88" |
| 202 | type: internal |
| 203 | Port "qr-acbe9951-70" |
| 204 | tag: 1 |
| 205 | Interface "qr-acbe9951-70" |
| 206 | type: internal |
| 207 | Port br-int |
| 208 | Interface br-int |
| 209 | type: internal |
| 210 | Port patch-tun |
| 211 | Interface patch-tun |
| 212 | type: patch |
| 213 | options: {peer=patch-int} |
| 214 | Port int-br-ex |
| 215 | Interface int-br-ex |
| 216 | type: patch |
| 217 | options: {peer=phy-br-ex} |
| 218 | ovs_version: "2.0.2" |
| 219 | |
| 220 | `br-int` is a bridge that the Open vSwitch mechanism driver creates, |
| 221 | which is used as the "integration bridge" where ports are created, and |
| 222 | plugged into the virtual switching fabric. `br-ex` is an OVS bridge |
| 223 | that is used to connect physical ports (like `eth0`), so that floating |
Sean Dague | db48db1 | 2016-04-06 08:09:31 -0400 | [diff] [blame] | 224 | IP traffic for project networks can be received from the physical |
| 225 | network infrastructure (and the internet), and routed to self service |
| 226 | project network ports. `br-tun` is a tunnel bridge that is used to |
| 227 | connect OpenStack nodes (like `devstack-2`) together. This bridge is |
| 228 | used so that project network traffic, using the VXLAN tunneling |
| 229 | protocol, flows between each compute node where project instances run. |
Sean M. Collins | 1650166 | 2015-10-12 11:01:44 -0400 | [diff] [blame] | 230 | |
| 231 | |
| 232 | |
| 233 | DevStack Compute Configuration |
| 234 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 235 | |
| 236 | The host `devstack-2` has a very minimal `local.conf`. |
| 237 | |
| 238 | :: |
| 239 | |
| 240 | [[local|localrc]] |
| 241 | HOST_IP=172.18.161.7 |
| 242 | SERVICE_HOST=172.18.161.6 |
| 243 | MYSQL_HOST=172.18.161.6 |
| 244 | RABBIT_HOST=172.18.161.6 |
| 245 | GLANCE_HOSTPORT=172.18.161.6:9292 |
Balagopal | 7ed812c | 2016-03-01 04:43:31 +0000 | [diff] [blame] | 246 | ADMIN_PASSWORD=secret |
| 247 | MYSQL_PASSWORD=secret |
| 248 | RABBIT_PASSWORD=secret |
| 249 | SERVICE_PASSWORD=secret |
Sean M. Collins | 1650166 | 2015-10-12 11:01:44 -0400 | [diff] [blame] | 250 | |
| 251 | ## Neutron options |
| 252 | PUBLIC_INTERFACE=eth0 |
| 253 | ENABLED_SERVICES=n-cpu,rabbit,q-agt |
| 254 | |
| 255 | Network traffic from `eth0` on the compute nodes is then NAT'd by the |
| 256 | controller node that runs Neutron's `neutron-l3-agent` and provides L3 |
| 257 | connectivity. |
| 258 | |
Sean M. Collins | 02ae50d | 2015-03-20 09:58:55 -0700 | [diff] [blame] | 259 | |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 260 | Neutron Networking with Open vSwitch and Provider Networks |
| 261 | ========================================================== |
| 262 | |
Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 263 | In some instances, it is desirable to use neutron's provider |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 264 | networking extension, so that networks that are configured on an |
Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 265 | external router can be utilized by neutron, and instances created via |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 266 | Nova can attach to the network managed by the external router. |
| 267 | |
| 268 | For example, in some lab environments, a hardware router has been |
| 269 | pre-configured by another party, and an OpenStack developer has been |
| 270 | given a VLAN tag and IP address range, so that instances created via |
| 271 | DevStack will use the external router for L3 connectivity, as opposed |
Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 272 | to the neutron L3 service. |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 273 | |
Sean M. Collins | 4696db9 | 2015-10-09 12:31:57 -0400 | [diff] [blame] | 274 | Physical Network Setup |
| 275 | ---------------------- |
| 276 | |
| 277 | .. nwdiag:: |
| 278 | |
| 279 | nwdiag { |
| 280 | inet [ shape = cloud ]; |
| 281 | router; |
| 282 | inet -- router; |
| 283 | |
| 284 | network provider_net { |
| 285 | address = "203.0.113.0/24" |
| 286 | router [ address = "203.0.113.1" ]; |
| 287 | controller; |
| 288 | compute1; |
| 289 | compute2; |
| 290 | } |
| 291 | |
| 292 | network control_plane { |
| 293 | router [ address = "10.0.0.1" ] |
| 294 | address = "10.0.0.0/24" |
| 295 | controller [ address = "10.0.0.2" ] |
| 296 | compute1 [ address = "10.0.0.3" ] |
| 297 | compute2 [ address = "10.0.0.4" ] |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | |
Sean M. Collins | 887f182 | 2015-10-12 10:36:34 -0400 | [diff] [blame] | 302 | On a compute node, the first interface, eth0 is used for the OpenStack |
| 303 | management (API, message bus, etc) as well as for ssh for an |
| 304 | administrator to access the machine. |
| 305 | |
| 306 | :: |
| 307 | |
| 308 | stack@compute:~$ ifconfig eth0 |
| 309 | eth0 Link encap:Ethernet HWaddr bc:16:65:20:af:fc |
| 310 | inet addr:10.0.0.3 |
| 311 | |
| 312 | eth1 is manually configured at boot to not have an IP address. |
| 313 | Consult your operating system documentation for the appropriate |
| 314 | technique. For Ubuntu, the contents of `/etc/network/interfaces` |
| 315 | contains: |
| 316 | |
| 317 | :: |
| 318 | |
| 319 | auto eth1 |
| 320 | iface eth1 inet manual |
| 321 | up ifconfig $IFACE 0.0.0.0 up |
| 322 | down ifconfig $IFACE 0.0.0.0 down |
| 323 | |
| 324 | The second physical interface, eth1 is added to a bridge (in this case |
| 325 | named br-ex), which is used to forward network traffic from guest VMs. |
| 326 | |
| 327 | :: |
| 328 | |
| 329 | stack@compute:~$ sudo ovs-vsctl add-br br-ex |
| 330 | stack@compute:~$ sudo ovs-vsctl add-port br-ex eth1 |
| 331 | stack@compute:~$ sudo ovs-vsctl show |
| 332 | 9a25c837-32ab-45f6-b9f2-1dd888abcf0f |
| 333 | Bridge br-ex |
| 334 | Port br-ex |
| 335 | Interface br-ex |
| 336 | type: internal |
| 337 | Port phy-br-ex |
| 338 | Interface phy-br-ex |
| 339 | type: patch |
| 340 | options: {peer=int-br-ex} |
| 341 | Port "eth1" |
| 342 | Interface "eth1" |
| 343 | |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 344 | |
| 345 | Service Configuration |
| 346 | --------------------- |
| 347 | |
| 348 | **Control Node** |
| 349 | |
| 350 | In this example, the control node will run the majority of the |
Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 351 | OpenStack API and management services (keystone, glance, |
| 352 | nova, neutron) |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 353 | |
| 354 | |
| 355 | **Compute Nodes** |
| 356 | |
| 357 | In this example, the nodes that will host guest instances will run |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 358 | the ``neutron-openvswitch-agent`` for network connectivity, as well as |
| 359 | the compute service ``nova-compute``. |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 360 | |
| 361 | DevStack Configuration |
| 362 | ---------------------- |
| 363 | |
Andreas Scheuring | 28128e2 | 2016-04-14 14:23:53 +0200 | [diff] [blame] | 364 | .. _ovs-provider-network-controller: |
| 365 | |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 366 | The following is a snippet of the DevStack configuration on the |
| 367 | controller node. |
| 368 | |
| 369 | :: |
| 370 | |
Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 371 | HOST_IP=10.0.0.2 |
| 372 | SERVICE_HOST=10.0.0.2 |
| 373 | MYSQL_HOST=10.0.0.2 |
Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 374 | RABBIT_HOST=10.0.0.2 |
| 375 | GLANCE_HOSTPORT=10.0.0.2:9292 |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 376 | PUBLIC_INTERFACE=eth1 |
| 377 | |
Balagopal | 7ed812c | 2016-03-01 04:43:31 +0000 | [diff] [blame] | 378 | ADMIN_PASSWORD=secret |
| 379 | MYSQL_PASSWORD=secret |
| 380 | RABBIT_PASSWORD=secret |
| 381 | SERVICE_PASSWORD=secret |
Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 382 | |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 383 | ## Neutron options |
| 384 | Q_USE_SECGROUP=True |
Sean Dague | db48db1 | 2016-04-06 08:09:31 -0400 | [diff] [blame] | 385 | ENABLE_PROJECT_VLANS=True |
| 386 | PROJECT_VLAN_RANGE=3001:4000 |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 387 | PHYSICAL_NETWORK=default |
| 388 | OVS_PHYSICAL_BRIDGE=br-ex |
| 389 | |
| 390 | Q_USE_PROVIDER_NETWORKING=True |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 391 | |
| 392 | # Do not use Nova-Network |
| 393 | disable_service n-net |
| 394 | |
| 395 | # Neutron |
| 396 | ENABLED_SERVICES+=,q-svc,q-dhcp,q-meta,q-agt |
| 397 | |
| 398 | ## Neutron Networking options used to create Neutron Subnets |
| 399 | |
Sean M. Collins | d72b839 | 2015-06-18 12:40:09 -0400 | [diff] [blame] | 400 | FIXED_RANGE="203.0.113.0/24" |
syed ahsan shamim zaidi | 512be7d | 2015-10-20 21:20:27 +0000 | [diff] [blame] | 401 | NETWORK_GATEWAY=203.0.113.1 |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 402 | PROVIDER_SUBNET_NAME="provider_net" |
| 403 | PROVIDER_NETWORK_TYPE="vlan" |
| 404 | SEGMENTATION_ID=2010 |
| 405 | |
| 406 | In this configuration we are defining FIXED_RANGE to be a |
Sean M. Collins | d72b839 | 2015-06-18 12:40:09 -0400 | [diff] [blame] | 407 | publicly routed IPv4 subnet. In this specific instance we are using |
| 408 | the special TEST-NET-3 subnet defined in `RFC 5737 <http://tools.ietf.org/html/rfc5737>`_, |
| 409 | which is used for documentation. In your DevStack setup, FIXED_RANGE |
| 410 | would be a public IP address range that you or your organization has |
| 411 | allocated to you, so that you could access your instances from the |
| 412 | public internet. |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 413 | |
John Kasperski | bdc0fa8 | 2015-11-23 11:56:33 -0600 | [diff] [blame] | 414 | The following is the DevStack configuration on |
Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 415 | compute node 1. |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 416 | |
| 417 | :: |
| 418 | |
Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 419 | HOST_IP=10.0.0.3 |
| 420 | SERVICE_HOST=10.0.0.2 |
| 421 | MYSQL_HOST=10.0.0.2 |
Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 422 | RABBIT_HOST=10.0.0.2 |
| 423 | GLANCE_HOSTPORT=10.0.0.2:9292 |
Balagopal | 7ed812c | 2016-03-01 04:43:31 +0000 | [diff] [blame] | 424 | ADMIN_PASSWORD=secret |
| 425 | MYSQL_PASSWORD=secret |
| 426 | RABBIT_PASSWORD=secret |
| 427 | SERVICE_PASSWORD=secret |
Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 428 | |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 429 | # Services that a compute node runs |
| 430 | ENABLED_SERVICES=n-cpu,rabbit,q-agt |
| 431 | |
Sean M. Collins | 2977b30 | 2016-01-25 09:10:52 -0500 | [diff] [blame] | 432 | ## Open vSwitch provider networking options |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 433 | PHYSICAL_NETWORK=default |
| 434 | OVS_PHYSICAL_BRIDGE=br-ex |
| 435 | PUBLIC_INTERFACE=eth1 |
| 436 | Q_USE_PROVIDER_NETWORKING=True |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 437 | |
Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 438 | Compute node 2's configuration will be exactly the same, except |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 439 | ``HOST_IP`` will be ``10.0.0.4`` |
Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 440 | |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 441 | When DevStack is configured to use provider networking (via |
vsaienko | d894221 | 2016-05-13 12:51:30 +0300 | [diff] [blame] | 442 | ``Q_USE_PROVIDER_NETWORKING`` is True) - |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 443 | DevStack will automatically add the network interface defined in |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 444 | ``PUBLIC_INTERFACE`` to the ``OVS_PHYSICAL_BRIDGE`` |
Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 445 | |
| 446 | For example, with the above configuration, a bridge is |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 447 | created, named ``br-ex`` which is managed by Open vSwitch, and the |
| 448 | second interface on the compute node, ``eth1`` is attached to the |
Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 449 | bridge, to forward traffic sent by guest VMs. |
Sean M. Collins | 872a262 | 2015-10-06 12:45:06 -0400 | [diff] [blame] | 450 | |
| 451 | Miscellaneous Tips |
| 452 | ================== |
| 453 | |
Mike Spreitzer | 4baa4ce | 2016-01-26 14:06:17 -0500 | [diff] [blame] | 454 | Non-Standard MTU on the Physical Network |
| 455 | ---------------------------------------- |
| 456 | |
Sean M. Collins | 087ed52 | 2016-03-16 11:53:09 -0400 | [diff] [blame] | 457 | Neutron by default uses a MTU of 1500 bytes, which is |
| 458 | the standard MTU for Ethernet. |
| 459 | |
| 460 | A different MTU can be specified by adding the following to |
| 461 | the Neutron section of `local.conf`. For example, |
| 462 | if you have network equipment that supports jumbo frames, you could |
| 463 | set the MTU to 9000 bytes by adding the following |
Mike Spreitzer | 4baa4ce | 2016-01-26 14:06:17 -0500 | [diff] [blame] | 464 | |
| 465 | :: |
Sean M. Collins | f81ae88 | 2016-02-01 14:00:20 -0500 | [diff] [blame] | 466 | |
Sean M. Collins | 087ed52 | 2016-03-16 11:53:09 -0400 | [diff] [blame] | 467 | [[post-config|/$Q_PLUGIN_CONF_FILE]] |
| 468 | global_physnet_mtu = 9000 |
Mike Spreitzer | 4baa4ce | 2016-01-26 14:06:17 -0500 | [diff] [blame] | 469 | |
Sean M. Collins | 872a262 | 2015-10-06 12:45:06 -0400 | [diff] [blame] | 470 | |
| 471 | Disabling Next Generation Firewall Tools |
| 472 | ---------------------------------------- |
| 473 | |
| 474 | DevStack does not properly operate with modern firewall tools. Specifically |
| 475 | it will appear as if the guest VM can access the external network via ICMP, |
| 476 | but UDP and TCP packets will not be delivered to the guest VM. The root cause |
| 477 | of the issue is that both ufw (Uncomplicated Firewall) and firewalld (Fedora's |
| 478 | firewall manager) apply firewall rules to all interfaces in the system, rather |
| 479 | then per-device. One solution to this problem is to revert to iptables |
| 480 | functionality. |
| 481 | |
| 482 | To get a functional firewall configuration for Fedora do the following: |
| 483 | |
| 484 | :: |
| 485 | |
| 486 | sudo service iptables save |
| 487 | sudo systemctl disable firewalld |
| 488 | sudo systemctl enable iptables |
| 489 | sudo systemctl stop firewalld |
| 490 | sudo systemctl start iptables |
| 491 | |
| 492 | |
| 493 | To get a functional firewall configuration for distributions containing ufw, |
| 494 | disable ufw. Note ufw is generally not enabled by default in Ubuntu. To |
| 495 | disable ufw if it was enabled, do the following: |
| 496 | |
| 497 | :: |
| 498 | |
| 499 | sudo service iptables save |
| 500 | sudo ufw disable |
| 501 | |
Sean M. Collins | d8aa10e | 2015-10-09 12:21:30 -0400 | [diff] [blame] | 502 | Configuring Extension Drivers for the ML2 Plugin |
| 503 | ------------------------------------------------ |
Sean M. Collins | 872a262 | 2015-10-06 12:45:06 -0400 | [diff] [blame] | 504 | |
Sean M. Collins | d8aa10e | 2015-10-09 12:21:30 -0400 | [diff] [blame] | 505 | Extension drivers for the ML2 plugin are set with the variable |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 506 | ``Q_ML2_PLUGIN_EXT_DRIVERS``, and includes the 'port_security' extension |
Sean M. Collins | d8aa10e | 2015-10-09 12:21:30 -0400 | [diff] [blame] | 507 | by default. If you want to remove all the extension drivers (even |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 508 | 'port_security'), set ``Q_ML2_PLUGIN_EXT_DRIVERS`` to blank. |
Sean M. Collins | 872a262 | 2015-10-06 12:45:06 -0400 | [diff] [blame] | 509 | |
Sean M. Collins | 2977b30 | 2016-01-25 09:10:52 -0500 | [diff] [blame] | 510 | |
| 511 | Using Linux Bridge instead of Open vSwitch |
| 512 | ------------------------------------------ |
| 513 | |
| 514 | The configuration for using the Linux Bridge ML2 driver is fairly |
| 515 | straight forward. The Linux Bridge configuration for DevStack is similar |
| 516 | to the :ref:`Open vSwitch based single interface <single-interface-ovs>` |
| 517 | setup, with small modifications for the interface mappings. |
| 518 | |
| 519 | |
| 520 | :: |
| 521 | |
| 522 | [[local|localrc]] |
| 523 | HOST_IP=172.18.161.6 |
| 524 | SERVICE_HOST=172.18.161.6 |
| 525 | MYSQL_HOST=172.18.161.6 |
| 526 | RABBIT_HOST=172.18.161.6 |
| 527 | GLANCE_HOSTPORT=172.18.161.6:9292 |
Balagopal | 7ed812c | 2016-03-01 04:43:31 +0000 | [diff] [blame] | 528 | ADMIN_PASSWORD=secret |
| 529 | DATABASE_PASSWORD=secret |
| 530 | RABBIT_PASSWORD=secret |
| 531 | SERVICE_PASSWORD=secret |
Sean M. Collins | 2977b30 | 2016-01-25 09:10:52 -0500 | [diff] [blame] | 532 | |
| 533 | # Do not use Nova-Network |
| 534 | disable_service n-net |
| 535 | # Enable Neutron |
| 536 | ENABLED_SERVICES+=,q-svc,q-dhcp,q-meta,q-agt,q-l3 |
| 537 | |
| 538 | |
| 539 | ## Neutron options |
| 540 | Q_USE_SECGROUP=True |
| 541 | FLOATING_RANGE="172.18.161.0/24" |
| 542 | FIXED_RANGE="10.0.0.0/24" |
| 543 | Q_FLOATING_ALLOCATION_POOL=start=172.18.161.250,end=172.18.161.254 |
| 544 | PUBLIC_NETWORK_GATEWAY="172.18.161.1" |
Sean M. Collins | 2977b30 | 2016-01-25 09:10:52 -0500 | [diff] [blame] | 545 | PUBLIC_INTERFACE=eth0 |
| 546 | |
| 547 | Q_USE_PROVIDERNET_FOR_PUBLIC=True |
| 548 | |
| 549 | # Linuxbridge Settings |
| 550 | Q_AGENT=linuxbridge |
| 551 | LB_PHYSICAL_INTERFACE=eth0 |
| 552 | PUBLIC_PHYSICAL_NETWORK=default |
| 553 | LB_INTERFACE_MAPPINGS=default:eth0 |
Andreas Scheuring | 28128e2 | 2016-04-14 14:23:53 +0200 | [diff] [blame] | 554 | |
| 555 | Using MacVTap instead of Open vSwitch |
| 556 | ------------------------------------------ |
| 557 | |
| 558 | Security groups are not supported by the MacVTap agent. Due to that, devstack |
| 559 | configures the NoopFirewall driver on the compute node. |
| 560 | |
| 561 | MacVTap agent does not support l3, dhcp and metadata agent. Due to that you can |
| 562 | chose between the following deployment scenarios: |
| 563 | |
| 564 | Single node with provider networks using config drive and external l3, dhcp |
| 565 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 566 | This scenario applies, if l3 and dhcp services are provided externally, or if |
| 567 | you do not require them. |
| 568 | |
| 569 | |
| 570 | :: |
| 571 | |
| 572 | [[local|localrc]] |
| 573 | HOST_IP=10.0.0.2 |
| 574 | SERVICE_HOST=10.0.0.2 |
| 575 | MYSQL_HOST=10.0.0.2 |
| 576 | RABBIT_HOST=10.0.0.2 |
| 577 | ADMIN_PASSWORD=secret |
| 578 | MYSQL_PASSWORD=secret |
| 579 | RABBIT_PASSWORD=secret |
| 580 | SERVICE_PASSWORD=secret |
| 581 | |
| 582 | Q_ML2_PLUGIN_MECHANISM_DRIVERS=macvtap |
| 583 | Q_USE_PROVIDER_NETWORKING=True |
| 584 | |
| 585 | #Enable Neutron services |
| 586 | disable_service n-net |
| 587 | enable_plugin neutron git://git.openstack.org/openstack/neutron |
| 588 | ENABLED_SERVICES+=,q-agt,q-svc |
| 589 | |
| 590 | ## MacVTap agent options |
| 591 | Q_AGENT=macvtap |
| 592 | PHYSICAL_NETWORK=default |
| 593 | |
| 594 | FIXED_RANGE="203.0.113.0/24" |
| 595 | NETWORK_GATEWAY=203.0.113.1 |
| 596 | PROVIDER_SUBNET_NAME="provider_net" |
| 597 | PROVIDER_NETWORK_TYPE="vlan" |
| 598 | SEGMENTATION_ID=2010 |
| 599 | |
| 600 | [[post-config|/$Q_PLUGIN_CONF_FILE]] |
| 601 | [macvtap] |
| 602 | physical_interface_mappings = $PHYSICAL_NETWORK:eth1 |
| 603 | |
| 604 | [[post-config|$NOVA_CONF]] |
| 605 | force_config_drive = True |
| 606 | |
| 607 | |
| 608 | Multi node with MacVTap compute node |
| 609 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 610 | This scenario applies, if you require OpenStack provided l3, dhcp or metadata |
| 611 | services. Those are hosted on a separate controller and network node, running |
| 612 | some other l2 agent technology (in this example Open vSwitch). This node needs |
| 613 | to be configured for VLAN tenant networks. |
| 614 | |
| 615 | For OVS, a similar configuration like described in the |
| 616 | :ref:`OVS Provider Network <ovs-provider-network-controller>` section can be |
| 617 | used. Just add the the following line to this local.conf, which also loads |
| 618 | the MacVTap mechanism driver: |
| 619 | |
| 620 | :: |
| 621 | |
| 622 | [[local|localrc]] |
| 623 | ... |
| 624 | Q_ML2_PLUGIN_MECHANISM_DRIVERS=openvswitch,linuxbridge,macvtap |
| 625 | ... |
| 626 | |
| 627 | For the MacVTap compute node, use this local.conf: |
| 628 | |
| 629 | :: |
| 630 | |
| 631 | HOST_IP=10.0.0.3 |
| 632 | SERVICE_HOST=10.0.0.2 |
| 633 | MYSQL_HOST=10.0.0.2 |
| 634 | RABBIT_HOST=10.0.0.2 |
| 635 | ADMIN_PASSWORD=secret |
| 636 | MYSQL_PASSWORD=secret |
| 637 | RABBIT_PASSWORD=secret |
| 638 | SERVICE_PASSWORD=secret |
| 639 | |
| 640 | # Services that a compute node runs |
| 641 | disable_all_services |
| 642 | enable_plugin neutron git://git.openstack.org/openstack/neutron |
| 643 | ENABLED_SERVICES+=n-cpu,q-agt |
| 644 | |
| 645 | ## MacVTap agent options |
| 646 | Q_AGENT=macvtap |
| 647 | PHYSICAL_NETWORK=default |
| 648 | |
| 649 | [[post-config|/$Q_PLUGIN_CONF_FILE]] |
| 650 | [macvtap] |
| 651 | physical_interface_mappings = $PHYSICAL_NETWORK:eth1 |