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