Add explicit network configuration to nodes.json
[icn.git] / README.md
1 # Introduction
2 ICN strives to automate the process of installing the local cluster
3 controller to the greatest degree possible – "zero touch
4 installation". Most of the work is done simply by booting up the jump
5 server (Local Controller). Once booted, the controller is fully
6 provisioned and begins to inspect and provision the bare metal
7 servers, until the cluster is entirely configured. This document shows
8 step-by-step how to configure the network and deployment architecture
9 for the ICN blueprint.
10
11 # License
12 Apache license v2.0
13
14 # Deployment Architecture
15 The Local Controller is provisioned with the Metal3 Baremetal Operator
16 and Ironic, which enable provisioning of bare metal servers. The
17 controller has three network connections to the bare metal servers:
18 network A connects bare metal servers, network B is a private network
19 used for provisioning the bare metal servers and network C is the IPMI
20 network, used for control during provisioning. In addition, the
21 bare metal servers connect to the network D, the SRIOV network.
22
23 ![Figure 1](figure-1.png)*Figure 1: Deployment Architecture*
24
25 - Net A -- Bare metal network, lab networking for ssh. It is used as
26   the control plane for k8s, used by OVN and Flannel for the overlay
27   networking.
28 - Net B (internal network) -- Provisioning network used by Ironic to
29   do inspection.
30 - Net C (internal network) -- IPMI LAN to do IPMI protocol for the OS
31   provisioning. The NICs support IPMI. The IP address should be
32   statically assigned via the IPMI tool or other means.
33 - Net D (internal network) -- Data plane network for the Akraino
34   application. Using the SR-IOV networking and fiber cables.  Intel
35   25GB and 40GB FLV NICs.
36
37 In some deployment models, you can combine Net C and Net A to be the
38 same networks, but the developer should take care of IP address
39 management between Net A and IPMI address of the server.
40
41 Also note that the IPMI NIC may share the same RJ-45 jack with another
42 one of the NICs.
43
44 # Pre-installation Requirements
45 There are two main components in ICN Infra Local Controller - Local
46 Controller and k8s compute cluster.
47
48 ### Local Controller
49 The Local Controller will reside in the jump server to run the Metal3
50 operator, Binary Provisioning Agent (BPA) operator and BPA REST API
51 controller.
52
53 ### k8s Compute Cluster
54 The k8s compute cluster will actually run the workloads and is
55 installed on bare metal servers.
56
57 ## Hardware Requirements
58
59 ### Minimum Hardware Requirement
60 All-in-one VM based deployment requires servers with at least 32 GB
61 RAM and 32 CPUs.
62
63 ### Recommended Hardware Requirements
64 Recommended hardware requirements are servers with 64GB Memory, 32
65 CPUs and SRIOV network cards.
66
67 ## Software Prerequisites
68 The jump server is required to be pre-installed with Ubuntu 18.04.
69
70 ## Database Prerequisites
71 No prerequisites for ICN blueprint.
72
73 ## Other Installation Requirements
74
75 ### Jump Server Requirements
76
77 #### Jump Server Hardware Requirements
78 - Local Controller: at least three network interfaces.
79 - Bare metal servers: four network interfaces, including one IPMI interface.
80 - Four or more hubs, with cabling, to connect four networks.
81
82 (Tested as below)
83 Hostname | CPU Model | Memory | Storage | 1GbE: NIC#, VLAN, (Connected extreme 480 switch) | 10GbE: NIC# VLAN, Network (Connected with IZ1 switch)
84 ---------|-----------|--------|---------|--------------------------------------------------|------------------------------------------------------
85 jump0 | Intel 2xE5-2699 | 64GB | 3TB (Sata)<br/>180 (SSD) | eth0: VLAN 110<br/>eno1: VLAN 110<br/>eno2: VLAN 111 | eno3: VLAN 112
86
87 #### Jump Server Software Requirements
88 ICN supports Ubuntu 18.04. The ICN blueprint installs all required
89 software during `make install`.
90
91 ### Network Requirements
92 Please refer to figure 1 for all the network requirements of the ICN
93 blueprint.
94
95 Please make sure you have 3 distinguished networks - Net A, Net B and
96 Net C as mentioned in figure 1. Local Controller uses the Net B and
97 Net C to provision the bare metal servers to do the OS provisioning.
98
99 ### Bare Metal Server Requirements
100
101 ### k8s Compute Cluster
102
103 #### Compute Server Hardware Requirements
104 (Tested as below)
105 Hostname | CPU Model | Memory | Storage | 1GbE: NIC#, VLAN, (Connected extreme 480 switch) | 10GbE: NIC# VLAN, Network (Connected with IZ1 switch)
106 ---------|-----------|--------|---------|--------------------------------------------------|------------------------------------------------------
107 node1 | Intel 2xE5-2699 | 64GB | 3TB (Sata)<br/>180 (SSD) | eth0: VLAN 110<br/>eno1: VLAN 110<br/>eno2: VLAN 111 | eno3: VLAN 112<br/>eno4: VLAN 113
108 node2 | Intel 2xE5-2699 | 64GB | 3TB (Sata)<br/>180 (SSD) | eth0: VLAN 110<br/>eno1: VLAN 110<br/>eno2: VLAN 111 | eno3: VLAN 112<br/>eno4: VLAN 113
109 node3 | Intel 2xE5-2699 | 64GB | 3TB (Sata)<br/>180 (SSD) | eth0: VLAN 110<br/>eno1: VLAN 110<br/>eno2: VLAN 111 | eno3: VLAN 112<br/>eno4: VLAN 113
110
111 #### Compute Server Software Requirements
112 The Local Controller will install all the software in compute servers
113 from the OS to the software required to bring up the k8s cluster.
114
115 ### Execution Requirements (Bare Metal Only)
116 The ICN blueprint checks all the precondition and execution
117 requirements for bare metal.
118
119 # Installation High-Level Overview
120 Installation is two-step process and everything starts with one
121 command `make install`.
122 - Installation of the Local Controller.
123 - Installation of compute cluster.
124
125 ## Bare Metal Deployment Guide
126
127 ### Install Bare Metal Jump Server
128
129 #### Creating a Node Inventory File
130
131 ##### Preconfiguration for the Local Controller in Jump Server
132 The user is required to provide the IPMI information of the servers
133 they connect to the Local Controller by editing node JSON sample file
134 in the directory icn/deploy/metal3/scripts/nodes.json.sample as
135 below. This example only shows 2 servers, statically configured on the
136 baremetal network. If you want to increase servers, just add another
137 array.  If the baremetal network provides a DHCP server with gateway
138 and DNS server information, just change the baremetal type to "ipv4".
139 ICN provides DHCP servers for the provisioning and bootstrap networks.
140
141 `node.json.sample`
142 ``` json
143 {
144   "nodes": [{
145     "name": "node1",
146     "ipmi_driver_info": {
147       "username": "admin",
148       "password": "admin",
149       "address": "10.10.10.11"
150     },
151     "os": {
152       "image_name": "bionic-server-cloudimg-amd64.img",
153       "username": "ubuntu",
154       "password": "mypasswd"
155     },
156     "net": {
157       "links": [
158         {
159           "id": "baremetal_nic",
160           "ethernet_mac_address": "00:1e:67:fe:f4:19",
161           "type": "phy"
162         },
163         {
164           "id": "provisioning_nic",
165           "ethernet_mac_address": "00:1e:67:fe:f4:1a",
166           "type": "phy"
167         },
168         {
169           "id": "bootstrap_nic",
170           "ethernet_mac_address": "00:1e:67:f8:6a:40",
171           "type": "phy"
172         }
173       ],
174       "networks": [
175         {
176           "id": "baremetal",
177           "link": "baremetal_nic",
178           "type": "ipv4",
179           "ip_address": "10.10.110.21/24",
180           "gateway": "10.10.110.1",
181           "dns_nameservers": ["8.8.8.8"]
182         },
183         {
184           "id": "provisioning",
185           "link": "provisioning_nic",
186           "type": "ipv4_dhcp"
187         },
188         {
189           "id": "bootstrap",
190           "link": "bootstrap_nic",
191           "type": "ipv4_dhcp"
192         }
193       ],
194       "services": []
195     }
196   },
197   {
198     "name": "node2",
199     "ipmi_driver_info": {
200       "username": "admin",
201       "password": "admin",
202       "address": "10.10.10.12"
203     },
204     "os": {
205       "image_name": "bionic-server-cloudimg-amd64.img",
206       "username": "ubuntu",
207       "password": "mypasswd"
208     },
209     "net": {
210       "links": [
211         {
212           "id": "baremetal_nic",
213           "ethernet_mac_address": "00:1e:67:f1:5b:90",
214           "type": "phy"
215         },
216         {
217           "id": "bootstrap_nic",
218           "ethernet_mac_address": "00:1e:67:f8:69:80",
219           "type": "phy"
220         },
221         {
222           "id": "provisioning_nic",
223           "ethernet_mac_address": "00:1e:67:f1:5b:91",
224           "type": "phy"
225         }
226       ],
227       "networks": [
228         {
229           "id": "baremetal",
230           "link": "baremetal_nic",
231           "type": "ipv4",
232           "ip_address": "10.10.110.22/24",
233           "gateway": "10.10.110.1",
234           "dns_nameservers": ["8.8.8.8"]
235         },
236         {
237           "id": "provisioning",
238           "link": "provisioning_nic",
239           "type": "ipv4_dhcp"
240         },
241         {
242           "id": "bootstrap",
243           "link": "bootstrap_nic",
244           "type": "ipv4_dhcp"
245         }
246       ],
247       "services": []
248     }
249   }]
250 }
251 ```
252
253 ##### Local Controller Metal3 Configuration Reference
254 - *node*: The array of nodes required to add to Local Controller.
255 - *name*: This will be the hostname for the machine, once it is
256   provisioned by Metal3.
257 - *ipmi_driver_info*: IPMI driver info is a json field. It currently
258   holds the IPMI information required for Ironic to send the IPMI tool
259   command.
260   - *username*: BMC username required to be provided for Ironic.
261   - *password*: BMC password required to be provided for Ironic.
262   - *address*: BMC server IPMI LAN IP address.
263 - *os*: Bare metal machine OS information is a json field. It
264   currently holds the image name to be provisioned, username and
265   password for the login.
266   - *image_name*: Images name should be in qcow2 format.
267   - *username*: Login username for the OS provisioned.
268   - *password*: Login password for the OS provisioned.
269 - *net*: Bare metal network information is a json field.  It describes
270   the interfaces and networks used by ICN.  For more information,
271   refer to the *networkData* field of the BareMetalHost resource
272   definition.
273   - *links*: An array of interfaces.
274         - *id*: The ID of the interface.  This is used in the network
275       definitions to associate the interface with its network
276       configuration.
277     - *ethernet_mac_address*: The MAC address of the interface.
278         - *type*: The type of interface.  Valid values are "phy".
279   - *networks*: An array of networks.
280     - *id*: The ID of the network.
281     - *link*: The ID of the link this network definition applies to.
282     - *type*: The type of network, either dynamic ("ipv4_dhcp") or
283       static ("ipv4").
284     - *ip_address*: Only valid for type "ipv4"; the IP address of the
285       interface.
286     - *gateway*: Only valid for type "ipv4"; the gateway of this
287       network.
288     - *dns_nameservers*: Only valid for type "ipv4"; an array of DNS
289       servers.
290
291 #### Creating the Settings Files
292
293 ##### Local Controller Network Configuration Reference
294 The user will find the network configuration file named as
295 "user_config.sh" in the ICN parent directory.
296
297 `user_config.sh`
298 ``` shell
299 #!/bin/bash
300
301 #Local Controller - Bootstrap cluster DHCP connection
302 #BS_DHCP_INTERFACE defines the interfaces, to which ICN DHCP deployment will bind
303 export BS_DHCP_INTERFACE="eno3"
304
305 #BS_DHCP_INTERFACE_IP defines the IPAM for the ICN DHCP to be managed.
306 export BS_DHCP_INTERFACE_IP="172.31.1.1/24"
307
308 #Edge Location Provider Network configuration
309 #Net A - Provider Network
310 #If provider having specific Gateway and DNS server details in the edge location,
311 #supply those values in nodes.json.
312
313 #Ironic Metal3 settings for provisioning network
314 #Interface to which Ironic provision network to be connected
315 #Net B - Provisioning Network
316 export IRONIC_INTERFACE="eno2"
317
318 #Ironic Metal3 setting for IPMI LAN Network
319 #Interface to which Ironic IPMI LAN should bind
320 #Net C - IPMI LAN Network
321 export IRONIC_IPMI_INTERFACE="eno1"
322
323 #Interface IP for the IPMI LAN, ICN verfiy the LAN Connection is active or not
324 #Net C - IPMI LAN Network
325 export IRONIC_IPMI_INTERFACE_IP="10.10.10.10"
326 ```
327
328 #### Running
329 After configuring the node inventory file and network configuration
330 files, please run `make install` from the ICN parent directory as
331 shown below:
332
333 ``` shell
334 root@pod11-jump:# git clone "https://gerrit.akraino.org/r/icn"
335 Cloning into 'icn'...
336 remote: Counting objects: 69, done
337 remote: Finding sources: 100% (69/69)
338 remote: Total 4248 (delta 13), reused 4221 (delta 13)
339 Receiving objects: 100% (4248/4248), 7.74 MiB | 21.84 MiB/s, done.
340 Resolving deltas: 100% (1078/1078), done.
341 root@pod11-jump:# cd icn/
342 root@pod11-jump:# vim Makefile
343 root@pod11-jump:# make install
344 ```
345
346 The following steps occurs once the `make install` command is given.
347 1. All the software required to run the bootstrap cluster is
348    downloaded and installed.
349 2. k8s cluster to maintain the bootstrap cluster and all the servers
350    in the edge location is installed.
351 3. Metal3 specific network configuration such as local DHCP server
352    networking for each edge location, Ironic networking for both
353    provisioning network and IPMI LAN network are identified and
354    created.
355 4. Metal3 is launched with IPMI configuration as configured in
356    "user_config.sh" and provisions the bare metal servers using IPMI
357    LAN network. For more information refer to the [Debugging
358    Failures](#debugging-failures) section.
359 5. Metal3 launch verification runs with a timeout of 60 mins by
360    checking the status of all the servers being provisioned or not.
361    1. All servers are provisioned in parallel. For example, if your
362       deployment is having 10 servers in the edge location, all the 10
363       servers are provisioned at the same time.
364    2. Metal3 launch verification takes care of checking all the
365       servers are provisioned, the network interfaces are up and
366       provisioned with a provider network gateway and DNS server.
367    3. Metal3 launch verification checks the status of all servers
368       given in user_config.sh to make sure all the servers are
369       provisioned. For example, if 8 servers are provisioned and 2
370       servers are not provisioned, launch verification makes sure all
371       servers are provisioned before launch k8s clusters on those
372       servers.
373 6. BPA bare metal components are invoked with the MAC address of the
374    servers provisioned by Metal3, BPA bare metal components decide the
375    cluster size and also the number of clusters required in the edge
376    location.
377 7. BPA bare metal runs the containerized Kuberenetes Reference
378    Deployment (KUD) as a job for each cluster. KUD installs the k8s
379    cluster on the slice of servers and install ONAP4K8S and all other
380    default plugins such as Multus, OVN, OVN4NFV, NFD, Virtlet and
381    SRIOV.
382 8. BPA REST API agent installed in the bootstrap cluster or jump
383    server, and this install rest-api, rook/ceph, MinIO as the cloud
384    storage. This provides a way for user to upload their own software,
385    container images or OS image to jump server.
386
387 ## Virtual Deployment Guide
388
389 ### Standard Deployment Overview
390 ![Figure 2](figure-2.png)*Figure 2: Virtual Deployment Architecture*
391
392 Virtual deployment is used for the development environment using
393 Metal3 virtual deployment to create VM with PXE boot. VM Ansible
394 scripts the node inventory file in /opt/ironic. No setting is required
395 from the user to deploy the virtual deployment.
396
397 ### Snapshot Deployment Overview
398 No snapshot is implemented in ICN R2.
399
400 ### Special Requirements for Virtual Deployment
401
402 #### Install Jump Server
403 Jump server is required to be installed with Ubuntu 18.04. This will
404 install all the VMs and install the k8s clusters. Same as bare metal
405 deployment, use `make vm_install` to install virtual deployment.
406
407 #### Verifying the Setup - VMs
408 `make verify_all` installs two VMs with name master-0 and worker-0
409 with 8GB RAM and 8 vCPUs and installs k8s cluster on the VMs using the
410 ICN BPA operator and install the ICN BPA REST API verifier. BPA
411 operator installs the multi-cluster KUD to bring up k8s with all
412 addons and plugins.
413
414 # Verifying the Setup
415 ICN blueprint checks all the setup in both bare metal and VM
416 deployment. Verify script will check that Metal3 provisioned the OS in
417 each bare metal servers by checking with a timeout period of 60 sec
418 and interval of 30. BPA operator verifier will check whether the KUD
419 installation is complete by doing plain curl command to the k8s
420 cluster installed in bare metal and VM setup.
421
422 **Bare Metal Verifier**: Run the `make bm_verifer`, it will verify the
423 bare-metal deployment.
424
425 **Verifier**: Run the `make vm_verifier`, it will verify the virtual
426 deployment.
427
428 # Developer Guide and Troubleshooting
429 For development uses the virtual deployment, it take up to 10 mins to
430 bring up the virtual BMC VMs with PXE boot.  Virtual deployment works
431 well for the BPA operator development for Metal3 installation scripts.
432
433 ## Utilization of Images
434 No images provided in this ICN release.
435
436 ## Post-deployment Configuration
437 No post-deployment configuration required in this ICN release.
438
439 ## Debugging Failures
440 * For first time installation enable KVM console in the trial or lab
441   servers using Raritan console or use Intel web BMC console.
442
443   ![Figure 3](figure-3.png)
444 * Deprovision state will result in Ironic agent sleeping before next
445   heartbeat - it is not an error. It results in bare metal server
446   without OS and installed with ramdisk.
447 * Deprovision in Metal3 is not straight forward - Metal3 follows
448   various stages from provisioned, deprovisioning and ready. ICN
449   blueprint take care navigating the deprovisioning states and
450   removing the BareMetalHost (BMH) custom resouce in case of cleaning.
451 * Manual BMH cleaning of BMH or force cleaning of BMH resource result
452   in hang state - use `make bmh_clean` to remove the BMH state.
453 * Logs of Ironic, openstack baremetal command to see the state of the
454   server.
455 * Logs of baremetal operator gives failure related to images or images
456   md5sum errors.
457 * It is not possible to change the state from provision to deprovision
458   or deprovision to provision without completing that state. All the
459   issues are handled in ICN scripts.
460 * k8s cluster failure can be debugged by KUD Pod logs.
461
462 ## Reporting a Bug
463 Required Linux Foundation ID to launch bug in ICN:
464 https://jira.akraino.org/projects/ICN/issues
465
466 # Uninstall Guide
467
468 ## Bare Metal deployment
469 The command `make clean_all` uninstalls all the components installed by
470 `make install`
471 * It de-provision all the servers provisioned and removes them from
472   Ironic database.
473 * Baremetal operator is deleted followed by Ironic database and
474   container.
475 * Network configuration such internal DHCP server, provisioning
476   interfaces and IPMI LAN interfaces are deleted.
477 * docker images built during the `make install` are deleted, such as
478   all Ironic, baremetal operator, BPA operator and KUD images.
479 * KUD will reset the bootstrap cluster - k8s cluster is torn down in
480   the jump server and all the associated docker images are removed.
481 * All software packages installed by `make install_all` are removed,
482   such as Ironic, openstack utility tool, docker packages and basic
483   prerequisite packages.
484
485 ## Virtual deployment
486 The command `make vm_clean_all` uninstalls all the components for the
487 virtual deployments.
488
489 # Troubleshooting
490
491 ## Error Message Guide
492 The error message is explicit, all messages are captured in log
493 directory.
494
495 # Maintenance
496
497 ## Blueprint Package Maintenance
498 No packages are maintained in ICN.
499
500 ## Software maintenance
501 Not applicable.
502
503 ## Hardware maintenance
504 Not applicable.
505
506 ## BluePrint Deployment Maintenance
507 Not applicable.
508
509 # Frequently Asked Questions
510 **How to setup IPMI?**
511
512 First, make sure the IPMI tool is installed in your servers, if not
513 install them using `apt install ipmitool`. Then, check for the
514 ipmitool information of each servers using the command `ipmitool lan
515 print 1`. If the above command doesn't show the IPMI information, then
516 setup the IPMI static IP address using the following instructions:
517 - Mostl easy way to set up IPMI topology in your lab setup is by
518   using IPMI tool.
519 - Using IPMI tool -
520   https://www.thomas-krenn.com/en/wiki/Configuring_IPMI_under_Linux_using_ipmitool
521 - IPMI information can be considered during the BIOS setting as well.
522
523 **BMC web console URL is not working?**
524
525 It is hard to find issues or reason. Check the ipmitool bmc info to
526 find the issues, if the URL is not available.
527
528 **No change in BMH state - provisioning state is for more than 40min?**
529
530 Generally, Metal3 provision for bare metal takes 20 - 30 mins. Look at
531 the Ironic logs and baremetal operator to look at the state of
532 servers. Openstack baremetal node shows all state of the server right
533 from power, storage.
534
535 **Why provider network (baremetal network configuration) is required?**
536
537 Generally, provider network DHCP servers in a lab provide the router
538 and DNS server details. In some labs, there is no DHCP server or the
539 DHCP server does not provide this information.
540
541 # License
542
543 ```
544 /*
545 * Copyright 2019 Intel Corporation, Inc
546 *
547 * Licensed under the Apache License, Version 2.0 (the "License");
548 * you may not use this file except in compliance with the License.
549 * You may obtain a copy of the License at
550 *
551 * http://www.apache.org/licenses/LICENSE-2.0
552 *
553 * Unless required by applicable law or agreed to in writing, software
554 * distributed under the License is distributed on an "AS IS" BASIS,
555 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
556 * See the License for the specific language governing permissions and
557 * limitations under the License.
558 */
559 ```
560
561 # References
562
563 # Definitions, acronyms and abbreviations