aboutsummaryrefslogtreecommitdiffstats
path: root/meta-openstack/Documentation/README.networking_flat
blob: ab18f6f557aa33c3977f1bf7191b745c7e6725e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
Networking - FLAT network
=========================

Description
-----------
The flat network will have the VMs share the management network
(192.168.7.0/24). The dhcp-agent will provide the VMs addresses
within the subnet and within its provisioned range. This type of
network will not typically be deployed as everything is accessible by
everything else (VMs can access VMs and the compute and controller
nodes)


Assumptions
-----------
It is assumed you have completed the steps described in
README.networking and have provisioned the host vSwitch as well as
created the br-eth0 bridges on the controller and compute nodes.

At this point you should be able to ping 192.168.7.4 from 192.168.7.4
and vise versa.

You have built your controller image including the cirros image (for
which you have already added the image to glance as myFirstImage).

You have run 'source /etc/nova/openrc'

Configuration updates
---------------------
On the controller and (all) compute nodes you must edit the file
/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini

In the [OVS] section set
network_vlan_ranges = ph-eth0:1:1
bridge_mappings = ph-eth0:br-eth0

(*** on compute nodes edit local_ip as well [192.168.7.4]***)

Restart some services to allow these changes to take effect:
/etc/init.d/neutron-openvswitch-agent reload
(on controller)
/etc/init.d/neutron-server reload
/etc/init.d/neutron-dhcp-agent reload
(on compute)
/etc/init.d/nova-compute reload


Create the net and subnet
-------------------------
neutron net-create --provider:physical_network=ph-eth0 \
  --provider:network_type=flat \
  --shared MY_FLAT_NET
Created a new network:
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | True                                 |
| id                        | 3263aa7f-b86c-4ad3-a28c-c78d4c711583 |
| name                      | MY_FLAT_NET                          |
| provider:network_type     | flat                                 |
| provider:physical_network | ph-eth0                              |
| provider:segmentation_id  |                                      |
| shared                    | True                                 |
| status                    | ACTIVE                               |
| subnets                   |                                      |
| tenant_id                 | b5890ba3fb234347ae317ca2f8358663     |
+---------------------------+--------------------------------------+


neutron subnet-create MY_FLAT_NET 192.168.7.0/24 --name MY_FLAT_SUBNET \
  --no-gateway --host-route destination=0.0.0.0/0,nexthop=192.168.7.1 \
  --allocation-pool start=192.168.7.230,end=192.168.7.234
Created a new subnet:
+------------------+--------------------------------------------------------+
| Field            | Value                                                  |
+------------------+--------------------------------------------------------+
| allocation_pools | {"start": "192.168.7.230", "end": "192.168.7.234"}     |
| cidr             | 192.168.7.0/24                                         |
| dns_nameservers  |                                                        |
| enable_dhcp      | True                                                   |
| gateway_ip       |                                                        |
| host_routes      | {"destination": "0.0.0.0/0", "nexthop": "192.168.7.1"} |
| id               | bfa99d99-2ba5-47e9-b71e-0bd8a2961e08                   |
| ip_version       | 4                                                      |
| name             | MY_FLAT_SUBNET                                         |
| network_id       | 3263aa7f-b86c-4ad3-a28c-c78d4c711583                   |
| tenant_id        | b5890ba3fb234347ae317ca2f8358663                       |
+------------------+--------------------------------------------------------+

Boot the image and test connectivity
------------------------------------
nova boot --image myFirstImage --flavor m1.small \
  --nic net-id=3263aa7f-b86c-4ad3-a28c-c78d4c711583 myinstance
+--------------------------------------+-----------------------------------------------------+
| Property                             | Value                                               |
+--------------------------------------+-----------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                              |
| OS-EXT-AZ:availability_zone          | nova                                                |
| OS-EXT-SRV-ATTR:host                 | -                                                   |
| OS-EXT-SRV-ATTR:hypervisor_hostname  | -                                                   |
| OS-EXT-SRV-ATTR:instance_name        | instance-00000003                                   |
| OS-EXT-STS:power_state               | 0                                                   |
| OS-EXT-STS:task_state                | scheduling                                          |
| OS-EXT-STS:vm_state                  | building                                            |
| OS-SRV-USG:launched_at               | -                                                   |
| OS-SRV-USG:terminated_at             | -                                                   |
| accessIPv4                           |                                                     |
| accessIPv6                           |                                                     |
| adminPass                            | 7Qe9nFekCjYD                                        |
| config_drive                         |                                                     |
| created                              | 2014-04-10T04:13:38Z                                |
| flavor                               | m1.small (2)                                        |
| hostId                               |                                                     |
| id                                   | f85da1da-c318-49fb-8da9-c07644400d4c                |
| image                                | myFirstImage (1da089b1-164d-45d6-9b6c-002f3edb8a7b) |
| key_name                             | -                                                   |
| metadata                             | {}                                                  |
| name                                 | myinstance                                          |
| os-extended-volumes:volumes_attached | []                                                  |
| progress                             | 0                                                   |
| security_groups                      | default                                             |
| status                               | BUILD                                               |
| tenant_id                            | b5890ba3fb234347ae317ca2f8358663                    |
| updated                              | 2014-04-10T04:13:38Z                                |
| user_id                              | 1dfcb72ef6a7428d8dd7300bc7f303d9                    |
+--------------------------------------+-----------------------------------------------------+

nova list
+--------------------------------------+------------+--------+------------+-------------+---------------------------+
| ID                                   | Name       | Status | Task State | Power State | Networks                  |
+--------------------------------------+------------+--------+------------+-------------+---------------------------+
| f85da1da-c318-49fb-8da9-c07644400d4c | myinstance | ACTIVE | -          | Running     | MY_FLAT_NET=192.168.7.231 |
+--------------------------------------+------------+--------+------------+-------------+---------------------------+

nova console-log myinstance
---
...skip
Starting logging: OK
Initializing random number generator... done.
Starting network...
udhcpc (v1.18.5) started
Sending discover...
Sending select for 192.168.7.231...
Lease of 192.168.7.231 obtained, lease time 86400
deleting routers
...skip

ping
---
root@controller:~# ping -c 1 192.168.7.231
PING 192.168.7.231 (192.168.7.231) 56(84) bytes of data.
64 bytes from 192.168.7.231: icmp_seq=1 ttl=64 time=2.98 ms

--- 192.168.7.231 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.988/2.988/2.988/0.000 ms

You should also be able to ping the compute or controller or other VMs
(if you start them) from within a VM. Pinging targets outside the
subnet requires that you ensure the various interfaces, such as eth0
have promisc on 'ip link set eth0 promisc on'

The final Open vSwitch configs
------------------------------

Controller
---
root@controller:~# ovs-vsctl show
524a6c84-226d-427b-8efa-732ed7e7fa43
    Bridge "br-eth0"
        Port "eth0"
            Interface "eth0"
        Port "br-eth0"
            Interface "br-eth0"
                type: internal
        Port "phy-br-eth0"
            Interface "phy-br-eth0"
    Bridge br-int
        Port "tap549fb0c7-1a"
            tag: 1
            Interface "tap549fb0c7-1a"
                type: internal
        Port "int-br-eth0"
            Interface "int-br-eth0"
        Port patch-tun
            Interface patch-tun
                type: patch
                options: {peer=patch-int}
        Port br-int
            Interface br-int
                type: internal
    Bridge br-tun
        Port "gre-2"
            Interface "gre-2"
                type: gre
                options: {in_key=flow, local_ip="192.168.7.2", out_key=flow, remote_ip="192.168.7.4"}
        Port br-tun
            Interface br-tun
                type: internal
        Port patch-int
            Interface patch-int
                type: patch
                options: {peer=patch-tun}
    ovs_version: "2.0.0"


Compute
---
root@compute:~# ovs-vsctl show
99d365d2-f74e-40a8-b9a0-5bb60353675d
    Bridge br-tun
        Port "gre-1"
            Interface "gre-1"
                type: gre
                options: {in_key=flow, local_ip="192.168.7.4", out_key=flow, remote_ip="192.168.7.2"}
        Port br-tun
            Interface br-tun
                type: internal
        Port patch-int
            Interface patch-int
                type: patch
                options: {peer=patch-tun}
    Bridge br-int
        Port br-int
            Interface br-int
                type: internal
        Port "int-br-eth0"
            Interface "int-br-eth0"
        Port patch-tun
            Interface patch-tun
                type: patch
                options: {peer=patch-int}
        Port "tap93a74250-ef"
            tag: 1
            Interface "tap93a74250-ef"
    Bridge "br-eth0"
        Port "phy-br-eth0"
            Interface "phy-br-eth0"
        Port "eth0"
            Interface "eth0"
        Port "br-eth0"
            Interface "br-eth0"
                type: internal
    ovs_version: "2.0.0"


References
----------
http://developer.rackspace.com/blog/neutron-networking-simple-flat-network.html