| 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 |  | 
|  | 365 | The following is a snippet of the DevStack configuration on the | 
|  | 366 | controller node. | 
|  | 367 |  | 
|  | 368 | :: | 
|  | 369 |  | 
| Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 370 | HOST_IP=10.0.0.2 | 
|  | 371 | SERVICE_HOST=10.0.0.2 | 
|  | 372 | MYSQL_HOST=10.0.0.2 | 
| Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 373 | RABBIT_HOST=10.0.0.2 | 
|  | 374 | GLANCE_HOSTPORT=10.0.0.2:9292 | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 375 | PUBLIC_INTERFACE=eth1 | 
|  | 376 |  | 
| Balagopal | 7ed812c | 2016-03-01 04:43:31 +0000 | [diff] [blame] | 377 | ADMIN_PASSWORD=secret | 
|  | 378 | MYSQL_PASSWORD=secret | 
|  | 379 | RABBIT_PASSWORD=secret | 
|  | 380 | SERVICE_PASSWORD=secret | 
| Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 381 |  | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 382 | ## Neutron options | 
|  | 383 | Q_USE_SECGROUP=True | 
| Sean Dague | db48db1 | 2016-04-06 08:09:31 -0400 | [diff] [blame] | 384 | ENABLE_PROJECT_VLANS=True | 
|  | 385 | PROJECT_VLAN_RANGE=3001:4000 | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 386 | PHYSICAL_NETWORK=default | 
|  | 387 | OVS_PHYSICAL_BRIDGE=br-ex | 
|  | 388 |  | 
|  | 389 | Q_USE_PROVIDER_NETWORKING=True | 
|  | 390 | Q_L3_ENABLED=False | 
|  | 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 | 
|  | 437 | Q_L3_ENABLED=False | 
|  | 438 |  | 
| Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 439 | Compute node 2's configuration will be exactly the same, except | 
| Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 440 | ``HOST_IP`` will be ``10.0.0.4`` | 
| Sean M. Collins | 611cab4 | 2015-10-09 12:54:32 -0400 | [diff] [blame] | 441 |  | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 442 | When DevStack is configured to use provider networking (via | 
| Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 443 | ``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] | 444 | DevStack will automatically add the network interface defined in | 
| Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 445 | ``PUBLIC_INTERFACE`` to the ``OVS_PHYSICAL_BRIDGE`` | 
| Sean M. Collins | 3429601 | 2014-10-27 11:57:20 -0400 | [diff] [blame] | 446 |  | 
|  | 447 | For example, with the above  configuration, a bridge is | 
| Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 448 | created, named ``br-ex`` which is managed by Open vSwitch, and the | 
|  | 449 | second interface on the compute node, ``eth1`` is attached to the | 
| Shilla Saebi | 2ed09d8 | 2015-04-21 15:02:13 -0400 | [diff] [blame] | 450 | bridge, to forward traffic sent by guest VMs. | 
| Sean M. Collins | 872a262 | 2015-10-06 12:45:06 -0400 | [diff] [blame] | 451 |  | 
|  | 452 | Miscellaneous Tips | 
|  | 453 | ================== | 
|  | 454 |  | 
| Mike Spreitzer | 4baa4ce | 2016-01-26 14:06:17 -0500 | [diff] [blame] | 455 | Non-Standard MTU on the Physical Network | 
|  | 456 | ---------------------------------------- | 
|  | 457 |  | 
| Sean M. Collins | 087ed52 | 2016-03-16 11:53:09 -0400 | [diff] [blame] | 458 | Neutron by default uses a MTU of 1500 bytes, which is | 
|  | 459 | the standard MTU for Ethernet. | 
|  | 460 |  | 
|  | 461 | A different MTU can be specified by adding the following to | 
|  | 462 | the Neutron section of `local.conf`. For example, | 
|  | 463 | if you have network equipment that supports jumbo frames, you could | 
|  | 464 | set the MTU to 9000 bytes by adding the following | 
| Mike Spreitzer | 4baa4ce | 2016-01-26 14:06:17 -0500 | [diff] [blame] | 465 |  | 
|  | 466 | :: | 
| Sean M. Collins | f81ae88 | 2016-02-01 14:00:20 -0500 | [diff] [blame] | 467 |  | 
| Sean M. Collins | 087ed52 | 2016-03-16 11:53:09 -0400 | [diff] [blame] | 468 | [[post-config|/$Q_PLUGIN_CONF_FILE]] | 
|  | 469 | global_physnet_mtu = 9000 | 
| Mike Spreitzer | 4baa4ce | 2016-01-26 14:06:17 -0500 | [diff] [blame] | 470 |  | 
| Sean M. Collins | 872a262 | 2015-10-06 12:45:06 -0400 | [diff] [blame] | 471 |  | 
|  | 472 | Disabling Next Generation Firewall Tools | 
|  | 473 | ---------------------------------------- | 
|  | 474 |  | 
|  | 475 | DevStack does not properly operate with modern firewall tools.  Specifically | 
|  | 476 | it will appear as if the guest VM can access the external network via ICMP, | 
|  | 477 | but UDP and TCP packets will not be delivered to the guest VM.  The root cause | 
|  | 478 | of the issue is that both ufw (Uncomplicated Firewall) and firewalld (Fedora's | 
|  | 479 | firewall manager) apply firewall rules to all interfaces in the system, rather | 
|  | 480 | then per-device.  One solution to this problem is to revert to iptables | 
|  | 481 | functionality. | 
|  | 482 |  | 
|  | 483 | To get a functional firewall configuration for Fedora do the following: | 
|  | 484 |  | 
|  | 485 | :: | 
|  | 486 |  | 
|  | 487 | sudo service iptables save | 
|  | 488 | sudo systemctl disable firewalld | 
|  | 489 | sudo systemctl enable iptables | 
|  | 490 | sudo systemctl stop firewalld | 
|  | 491 | sudo systemctl start iptables | 
|  | 492 |  | 
|  | 493 |  | 
|  | 494 | To get a functional firewall configuration for distributions containing ufw, | 
|  | 495 | disable ufw.  Note ufw is generally not enabled by default in Ubuntu.  To | 
|  | 496 | disable ufw if it was enabled, do the following: | 
|  | 497 |  | 
|  | 498 | :: | 
|  | 499 |  | 
|  | 500 | sudo service iptables save | 
|  | 501 | sudo ufw disable | 
|  | 502 |  | 
| Sean M. Collins | d8aa10e | 2015-10-09 12:21:30 -0400 | [diff] [blame] | 503 | Configuring Extension Drivers for the ML2 Plugin | 
|  | 504 | ------------------------------------------------ | 
| Sean M. Collins | 872a262 | 2015-10-06 12:45:06 -0400 | [diff] [blame] | 505 |  | 
| Sean M. Collins | d8aa10e | 2015-10-09 12:21:30 -0400 | [diff] [blame] | 506 | Extension drivers for the ML2 plugin are set with the variable | 
| Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 507 | ``Q_ML2_PLUGIN_EXT_DRIVERS``, and includes the 'port_security' extension | 
| Sean M. Collins | d8aa10e | 2015-10-09 12:21:30 -0400 | [diff] [blame] | 508 | by default. If you want to remove all the extension drivers (even | 
| Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 509 | 'port_security'), set ``Q_ML2_PLUGIN_EXT_DRIVERS`` to blank. | 
| Sean M. Collins | 872a262 | 2015-10-06 12:45:06 -0400 | [diff] [blame] | 510 |  | 
| Sean M. Collins | 2977b30 | 2016-01-25 09:10:52 -0500 | [diff] [blame] | 511 |  | 
|  | 512 | Using Linux Bridge instead of Open vSwitch | 
|  | 513 | ------------------------------------------ | 
|  | 514 |  | 
|  | 515 | The configuration for using the Linux Bridge ML2 driver is fairly | 
|  | 516 | straight forward. The Linux Bridge configuration for DevStack is similar | 
|  | 517 | to the :ref:`Open vSwitch based single interface <single-interface-ovs>` | 
|  | 518 | setup, with small modifications for the interface mappings. | 
|  | 519 |  | 
|  | 520 |  | 
|  | 521 | :: | 
|  | 522 |  | 
|  | 523 | [[local|localrc]] | 
|  | 524 | HOST_IP=172.18.161.6 | 
|  | 525 | SERVICE_HOST=172.18.161.6 | 
|  | 526 | MYSQL_HOST=172.18.161.6 | 
|  | 527 | RABBIT_HOST=172.18.161.6 | 
|  | 528 | GLANCE_HOSTPORT=172.18.161.6:9292 | 
| Balagopal | 7ed812c | 2016-03-01 04:43:31 +0000 | [diff] [blame] | 529 | ADMIN_PASSWORD=secret | 
|  | 530 | DATABASE_PASSWORD=secret | 
|  | 531 | RABBIT_PASSWORD=secret | 
|  | 532 | SERVICE_PASSWORD=secret | 
| Sean M. Collins | 2977b30 | 2016-01-25 09:10:52 -0500 | [diff] [blame] | 533 |  | 
|  | 534 | # Do not use Nova-Network | 
|  | 535 | disable_service n-net | 
|  | 536 | # Enable Neutron | 
|  | 537 | ENABLED_SERVICES+=,q-svc,q-dhcp,q-meta,q-agt,q-l3 | 
|  | 538 |  | 
|  | 539 |  | 
|  | 540 | ## Neutron options | 
|  | 541 | Q_USE_SECGROUP=True | 
|  | 542 | FLOATING_RANGE="172.18.161.0/24" | 
|  | 543 | FIXED_RANGE="10.0.0.0/24" | 
|  | 544 | Q_FLOATING_ALLOCATION_POOL=start=172.18.161.250,end=172.18.161.254 | 
|  | 545 | PUBLIC_NETWORK_GATEWAY="172.18.161.1" | 
|  | 546 | Q_L3_ENABLED=True | 
|  | 547 | PUBLIC_INTERFACE=eth0 | 
|  | 548 |  | 
|  | 549 | Q_USE_PROVIDERNET_FOR_PUBLIC=True | 
|  | 550 |  | 
|  | 551 | # Linuxbridge Settings | 
|  | 552 | Q_AGENT=linuxbridge | 
|  | 553 | LB_PHYSICAL_INTERFACE=eth0 | 
|  | 554 | PUBLIC_PHYSICAL_NETWORK=default | 
|  | 555 | LB_INTERFACE_MAPPINGS=default:eth0 |