Updated armband
[armband.git] / doc / howto-dea.md
1 DEA: Deployment Environment Adapter\r
2 -----------------------------------\r
3 \r
4 This file has several sections, some of the sections are self describing:\r
5 \r
6 ```\r
7 title: Deployment Environment Adapter (DEA)\r
8 version:\r
9 comment: Config for LF POD1 - HA deployment with Ceph and Opendaylight\r
10 wanted_release: Kilo on Ubuntu 14.04\r
11 ```\r
12 \r
13 ## The Environment section\r
14 \r
15 environment:\r
16   name: opnfv\r
17   mode: ha                     # noha, no-ha?\r
18   net_segment_type: tun        # ?\r
19 \r
20 \r
21 ## The "Fuel" section\r
22 \r
23 ```\r
24 fuel:\r
25   ADMIN_NETWORK:                 # Static Fuel admin network configuration\r
26     cidr: 10.20.0.0/24           # this is the "fuelweb_admin" in the nodes\r
27     dhcp_gateway: 10.20.0.2      # nodes us this as default gateway\r
28     dhcp_pool_end: 10.20.0.254   # nodes get addresses from here\r
29     dhcp_pool_start: 10.20.0.3   # This is the Fuel server IP address\r
30     ipaddress: 10.20.0.2\r
31     netmask: 255.255.0.0         # netmask for nodes (otherwise why is it\r
32                                  # needed if CIDR above?\r
33   DNS_DOMAIN: domain.tld         #\r
34   DNS_SEARCH: domain.tld         #\r
35   DNS_UPSTREAM: 8.8.8.8          # Fuel->Network Settings->Other->DNS Servers\r
36   FUEL_ACCESS:\r
37     password: admin\r
38     user: admin\r
39   HOSTNAME: opnfv\r
40   NTP1: 0.pool.ntp.org           # Fuel->Newtok Setting->Other->NTP server list\r
41   NTP2: 1.pool.ntp.org\r
42   NTP3: 2.pool.ntp.org\r
43 ```\r
44 \r
45 It would make more sense if NTP was a list:\r
46 \r
47 ```\r
48   NTP:\r
49      - 0.pool.ntp.org\r
50      - 1.pool.ntp.org\r
51      - 2.pool.ntp.org\r
52 ```\r
53 \r
54 Now I don't know if NTP4 would be a valid key...\r
55 \r
56 ## The "node" section\r
57 \r
58 Then there is the important "node" section:\r
59 \r
60 ```\r
61 node:\r
62    - id: 1\r
63      interfaces: <some section describing interfaces>\r
64      transformations: <section describing what to do with the interfaces>\r
65      role: [controller|compute|cinder|...]\r
66    - id: 2\r
67       interfaces: interfaces_1\r
68       transformations: transformations_1\r
69       role: ceph-osd,controller\r
70    ...\r
71    - id: n\r
72      ...\r
73 ```\r
74 \r
75 Now, the "interfaces" section could be something line:\r
76 \r
77 ```\r
78 node:\r
79    - id: 1\r
80      interfaces: interfaces_1\r
81      transformations: transformations_1\r
82 ```\r
83 \r
84 ## Interfaces\r
85 \r
86 In this case we would have a "section" called intefaces_apm, that looks like:\r
87 \r
88 ```\r
89 interfaces_1:\r
90   eth0:\r
91   - none # I made this up, I don't know if "none" is valid\r
92   eth1:\r
93   - fuelweb_admin\r
94   eth2:\r
95   - public\r
96   - storage     # vlan 2010\r
97   - management  # vlan 2011\r
98   - private     # vlan 2012\r
99 ```\r
100 \r
101 This is self describing in a way. eth1 is used as the interface for the\r
102 "fuel admin" network, while eth2 will be used for what Fuel calls "public",\r
103 "storage", "management" and "private" networks. These match the networks in\r
104 the "networks" tab in the Fuel dashboard.\r
105 \r
106 ## Transformations\r
107 \r
108 For now we won't come into huge detail about the transformations, but they\r
109 seem to contain a list of "commands" issued to ovs-vsctl (Open vSwitch).\r
110 For example:\r
111 \r
112 ```\r
113 transformations_1:\r
114   transformations:\r
115   - ...\r
116   - action: add-port\r
117     bridge: br-mgmt\r
118     name: eth1.300\r
119   - ...\r
120 ```\r
121 \r
122 Basically the deploy script will issue the command:\r
123 \r
124 ```\r
125   ovs-vsctl add-port br-mgmt eth1.300\r
126 ```\r
127 (or ...eth1 tag=300)\r
128 \r
129 ## The "network" section:\r
130 \r
131 The networks listed in each of the devices of the "interfaces_1" section\r
132 are defined in the "network" section. Inside the "network" section, there is\r
133 another section called "networks", with a list of networks defined:\r
134 \r
135 ```\r
136 network:\r
137    ...\r
138    networks:\r
139   - cidr: 192.168.0.0/24\r
140     gateway: null\r
141     ip_ranges:\r
142     - - 192.168.0.1\r
143       - 192.168.0.254\r
144     meta:\r
145       cidr: 192.168.0.0/24        # TBD: Can it be different from previos CIDR?\r
146                                   # Is this the default value in the UI?\r
147       configurable: true          # TBD, UI?\r
148       map_priority: 2             # TBD, UI?\r
149       name: management\r
150       notation: cidr              # TBD, UI?\r
151       render_addr_mask: internal  # TBD, UI?\r
152       render_type: cidr           # TBD, UI stuff?\r
153       use_gateway: false          # Only for public net, or for\r
154       vips:                       # TBD\r
155       - haproxy\r
156       - vrouter\r
157       vlan_start: 101\r
158     name: management\r
159     vlan_start: 300               # must match transformations\r
160   - cidr: ...\r
161     ...\r
162 ```\r
163 \r
164 Let's take the "management" network as an example. Here we define the\r
165 netmask and several parameters that will look familiar when looking at the\r
166 "Networks" Fuel dashboard tab. The available keys:\r
167 - name: the name of the \r
168 - cdir: the CDIR for this network\r
169 - gateway: an IP address (only for public network?)\r
170 - ip_ranges: a list with the IP ranges available to this network.\r
171 - vlan_start: When using vlan tagging, the first vlan tag\r
172 - meta: (explained below)\r
173 \r
174 The purpose of the "meta" key is less obvious here, and some of the data\r
175 appears to be redundant. My guess is that it is part of Fuel's user\r
176 interface. The CIDR here would be the default and "notation" is probably the\r
177 way it is displayed in the form field:\r
178 \r
179 - cidr: again the same CDIR as above [is this redundant? error prone?]\r
180 - configurable: boolean [?]\r
181 - map_priority: int [?]\r
182 - name: again the same name as above?\r
183 - notation: cidr [any other available keys?]\r
184 - use_gateway: boolean [apparently only "true "if an IP was given above]\r
185 - vips: This seems to be a list of "namespaces" defined later in the\r
186 -       "network section".\r
187 - vlan_start same as above...\r
188 \r
189 Now if we look back, in the "interfaces_1" section we had this:\r
190 \r
191 ```\r
192 interfaces_1:\r
193    eth2:\r
194       - management\r
195 ```\r
196 \r
197 This is clearly the network defined above. The same goes for "public",\r
198 "storage" and "private".\r
199 \r
200 ## The "network" section continued\r
201 \r
202 Apart from the definition of each of the networks and required by Fuel,\r
203 the "network" section also has a "preamble" with the following parameters\r
204 and corresponding setting in Fuel:\r
205 \r
206 ```\r
207 network:\r
208   management_vip: 192.168.0.2         # TBD (see vips)\r
209   management_vrouter_vip: 192.168.0.1 # TBD\r
210   public_vip: 172.30.9.64             # TBD\r
211   public_vrouter_vip: 172.30.9.65     # TBD\r
212   networking_parameters:              # Fuel->Networ->Settings\r
213     base_mac: fa:16:3e:00:00:00       # Neutron L2\r
214     configuration_template: null\r
215     dns_nameservers:                  # Neutron L3, guess OS DNS Servers\r
216     - 8.8.4.4\r
217     - 8.8.8.8\r
218     floating_ranges:                  # Neutron L3, floating Network Param\r
219     - - 172.30.9.160                  #  floating IP range start\r
220       - 172.30.9.254                  #  floating IP range end\r
221     gre_id_range:                     # Neutron L2, what if VXLAN?\r
222     - 2                               # Neutron L2, tunnel ID range start\r
223     - 65535                           # Neutron L2, tunnel ID range end\r
224                                       # Neutron L3, Internal Network\r
225                                       # Parameters\r
226     internal_cidr: 192.168.111.0/24   #  internal network CDIR\r
227     internal_gateway: 192.168.111.1   #  internal network gateway\r
228     net_l23_provider: ovs             # TBD: must match transformations?\r
229     segmentation_type: tun            # TBD: what options are there? tun/vlan?\r
230     vlan_range:                       # TBD\r
231     - 1000\r
232     - 1030\r
233   vips:\r
234     ...\r
235 ```\r
236 \r
237 ## The "vips" in the "network" section\r
238 \r
239 In addition to all the above, the network section contains a "vips" section.\r
240 I don't know what they mean, but there are some relations between these\r
241 vips, and the networks defined above:\r
242 \r
243 ```\r
244 network:\r
245    vips:\r
246       management:\r
247          ipaddr: 192.168.0.2     # TBD: same as management_vip?\r
248          namespace: haproxy      # TBD: network namespace?\r
249          network_role: mgmt/vip  # TBD\r
250          node_roles:\r
251          - controller            # Why do we define it here?\r
252          - primary-controller    # for an HA environment?\r
253       public:\r
254          ...\r
255       vrouter:\r
256          ...\r
257       vrouter_pub:\r
258          ...\r
259 ```\r
260 \r
261 Also, in contrast to the "networks" section, the "vips" section is not a list,\r
262 but a series of records...\r
263 \r
264 Some Fuel plugins seem to look at this particular setup, one of the examples\r
265 in [2], absolute-dashboard-link.pp, reads:\r
266 \r
267 ```\r
268 $os_public_vip = $network_metadata['vips']['public']['ipaddr']\r
269 ```\r
270 \r
271 If you remember from above, each network has a "metadata" section, this\r
272 matches the name of the variable $network_metadata. In that section there is\r
273 a "vips" section, that contains a list of "vips", and one of the vips is\r
274 "public", and one of the fields is "ipaddr".\r
275 \r
276 * [1] https://docs.mirantis.com/openstack/fuel/fuel-8.0/file-ref.html#fuel-file-reference-pages\r
277 * [2] https://wiki.openstack.org/wiki/Fuel/Plugins\r
278 \r
279 \r
280 ## The "Settings" section\r
281 \r
282 This looks like user interface stuff and default settings. For instance:\r
283 settings:\r
284 \r
285 ```\r
286   editable:\r
287     ...\r
288     additional_components:\r
289       ceilometer:\r
290         description: If selected, Ceilometer component will be installed\r
291         label: Install Ceilometer\r
292         type: checkbox\r
293         value: false\r
294         weight: 40\r
295 ```\r
296 \r
297 This is clearly the label "Install Ceilometer" in the Fuel web dashboard.\r
298 \r
299 This looks like an email label entry with the corresponding regex to\r
300 validate it:\r
301 \r
302 ```\r
303 settings:\r
304   editable:\r
305     access:\r
306       email:\r
307         description: Email address for Administrator\r
308         label: Email\r
309         regex:\r
310           error: Invalid email\r
311           source: ^\S+@\S+$\r
312         type: text\r
313         value: admin@localhost\r
314         weight: 40\r
315   ...\r
316 ```\r
317 \r
318 ## Other\r
319 \r
320 I think most of it, specially the "settings" part, has been machine created.\r
321 It would be nice to recreate one of this files from a manual Fuel\r
322 deployment.\r