Browse Source

Enable Distributed Virtual Router in chef cookbook

Modify cookbook-openstack-network to enable Distributed
Virtual Router when deploy.

Change-Id: Ieabd9a3b597436d04db4f09382fe34fe0d7c2766
lzklibj 4 years ago
parent
commit
97ec979884
1 changed files with 155 additions and 0 deletions
  1. 155
    0
      specs/kilo/network/enable-dvr-in-chef-cookbook.rst

+ 155
- 0
specs/kilo/network/enable-dvr-in-chef-cookbook.rst View File

@@ -0,0 +1,155 @@
1
+=======================================================
2
+Enable Distributed Virtual Router(DVR) in chef cookbook
3
+=======================================================
4
+
5
+Include the URL of your launchpad blueprint:
6
+
7
+https://blueprints.launchpad.net/openstack-chef/+spec/enable-dvr-chef-cookbook
8
+
9
+Problem description
10
+===================
11
+
12
+Currently DVR is disabled by default in Neutron and not allowed to be
13
+configured in Network cookbook. After deployed, user has to manually modify
14
+the Neutron configuration files to enable DVR.
15
+
16
+
17
+Proposed change
18
+===============
19
+
20
+The following attribute file in cookbook-openstack-network will be mofified:
21
+* default.rb
22
+We will add attribute ['openstack']['network']['router_distributed'] in it.
23
+User can set this attribute to 'auto', true and false. When this attribute is
24
+set to 'auto', chef cookbook will do enough check, like checking whether
25
+network type ML2 extensions support DVR, checking whether OVS is enalbed,
26
+after that chef cookbook will enable DVR or output warning messages and logs
27
+to tell user what happened. And considering only GRE and VXLAN network types
28
+support DVR, router_distributed's true and false setting will only work in
29
+the two network types. To VLAN network type, DVR will be disabled by default
30
+even router_distributed is set to true, warning messages will be given to
31
+user to notify why DVR config doesn't work.
32
+
33
+The following template files in cookbook-openstack-network will be modified:
34
+* neutron.conf.erb
35
+* l3_agent.ini.erb
36
+* ovs_neutron_plugin.ini.erb
37
+* ml2_conf.ini.erb
38
+Modify attribute 'router_distributed' in neutron.conf.erb, 'agent_mode' in
39
+l3_agent.ini.erb, 'enable_distributed_routing' and 'l2_population' in
40
+ovs_neutron_plugin.ini.erb, 'mechanism_drivers' in ml2_conf.ini.erb. These
41
+attributes can be found in the howto link in the following References section.
42
+
43
+The following recipe files in cookbook-openstack-network may be modified:
44
+* l3_agent.rb
45
+DVR gives a new data path for vms, like East-West communication, give
46
+compute nodes external IPs to make vms can get floating IPs not only from
47
+network nodes. And DVR will only work on nodes which has L3 agent and OVS
48
+agent, and these will installed for network node role and compute node role.
49
+l3_agent.ini.erb will need query the current node is compute node or network
50
+node when DVR is enabled. We will use existing network node role and compute
51
+node role to deal with that. If a node have both the two roles, we will
52
+consider this node as network node.
53
+
54
+If necessary we also need methods to make sure necessary packages
55
+like iproute are installed on compute node.
56
+
57
+DVR is supported by network type GRE and VXLAN, but not VLAN yet, so
58
+we also need a method to make sure the current network type is either GRE
59
+or VXLAN, the network type need maps to key name tunnel_types in
60
+ovs_neutron_plugin.ini with values of gre or vxlan. If current network type
61
+is VLAN, we should stop the configuration of DVR. And we also need methods
62
+to make sure necessary
63
+network resource like tunnel network bridge are created on compute node.
64
+
65
+If necessary we will change the role definition for compute node.
66
+
67
+We did test and enabled DVR on Redhat and Ubuntu, but not all versions have
68
+been tested. So in cookbook, we will deal with details from different
69
+platforms and releases affected and output warning messages and logs to OS
70
+we will not support.
71
+
72
+Alternatives
73
+------------
74
+
75
+Another option to case that DVR is enabled while tunnel_types is vlan,
76
+is that we can cover that value by gre or vxlan for tunnel_type in
77
+ovs_neutron_plugin.ini. Consider that if user decides to enable DVR,
78
+user can accept changing in openvswitch agent config file.
79
+
80
+Data model impact
81
+-----------------
82
+
83
+REST API impact
84
+---------------
85
+
86
+
87
+Implementation
88
+==============
89
+
90
+Assignee(s)
91
+-----------
92
+
93
+Primary assignee:
94
+  <lzklibj@cn.ibm.com>
95
+
96
+Other contributors:
97
+
98
+Work Items
99
+----------
100
+
101
+
102
+Dependencies
103
+============
104
+
105
+
106
+Testing
107
+=======
108
+
109
+Add attribute 'router_distributed' => 'true' in environment file,
110
+then deploy a 1+N environment or a multiple network nodes environment.
111
+(All-in-one case is unnecessary, we can consider it similar to 1+0 case)
112
+Check if config files are modified according to the list in the wiki Neutron
113
+DVR HowTo page.
114
+
115
+Build network N1 and N2, router R1, add subnets of N1 and N2 to R1 as
116
+interfaces, before booting any instances, we should see nothing listed in the
117
+output when running "ip netns" on the compute nodes. Boot instances on N1 and
118
+N2 on different compute nodes, we should see network namespace on those compute
119
+nodes by running "ip netns".
120
+
121
+ip-netns is process network namesapce management command. You can run
122
+"ip netns help" to get more usage. And "ip netns" is short for
123
+"ip netns list", it will show all of the named network namespaces, which
124
+are under /var/run/netns.
125
+
126
+Also, we can ping from vm to vm while checking output by running tcpdump
127
+from compute nodes. If we boot vm1 on N1 on CN1(compute node 1), and vm2
128
+on N2 on CN2, after we logon vm1(it doesn't matter we logon from network
129
+node or CN1), we can ping vm2 and run 'tcpdump | grep -i "X"' on CN1 or CN2,
130
+while "X" is your network type, we will find ICMP packages data path is
131
+directly from CN1 to CN2, without passing network nodes (in a 1+N case, ICMP
132
+packages will need centralized network node to transmit when DVR is disabled).
133
+
134
+
135
+Documentation Impact
136
+====================
137
+
138
+* User can set ['openstack']['network']['router_distributed'] to 'auto' to
139
+  let chef cookbook configure for DVR aumotically, enable DVR or give warning
140
+  mesaages.
141
+* DVR will be enabled by default when network type is GRE or VXLAN,
142
+  user can set ['openstack']['network']['router_distributed]' to 'false'
143
+  in override_attributes to disable it.
144
+* When set ['openstack']['network']['router_distributed'] to 'true', user
145
+  should check follow attributes to enable DVR: check ['openstack']['network']
146
+  ['core_plugin'] has value 'neutron.plugins.ml2.plugin.ML2Plugin', check
147
+  ['openstack']['network']['ml2']['mechanism_drivers'] has value 'openvswitch'
148
+  and check ['openstack']['compute']['network']['plugins'] has value
149
+  'openvswitch'.
150
+
151
+References
152
+==========
153
+
154
+<https://wiki.openstack.org/wiki/Neutron/DVR>
155
+<https://wiki.openstack.org/wiki/Neutron/DVR/HowTo>

Loading…
Cancel
Save