Remove IRONIC_IPMI_INTERFACE_IP
[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 |
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 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 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 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 network.
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": "sriov_nic",
170           "ethernet_mac_address": "00:1e:67:f8:6a:41",
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": "sriov",
190           "link": "sriov_nic",
191           "type": "ipv4",
192           "ip_address": "10.10.113.2/24"
193         }
194       ],
195       "services": []
196     }
197   },
198   {
199     "name": "node2",
200     "ipmi_driver_info": {
201       "username": "admin",
202       "password": "admin",
203       "address": "10.10.10.12"
204     },
205     "os": {
206       "image_name": "bionic-server-cloudimg-amd64.img",
207       "username": "ubuntu",
208       "password": "mypasswd"
209     },
210     "net": {
211       "links": [
212         {
213           "id": "baremetal_nic",
214           "ethernet_mac_address": "00:1e:67:f1:5b:90",
215           "type": "phy"
216         },
217         {
218           "id": "provisioning_nic",
219           "ethernet_mac_address": "00:1e:67:f1:5b:91",
220           "type": "phy"
221         },
222         {
223           "id": "sriov_nic",
224           "ethernet_mac_address": "00:1e:67:f8:69:81",
225           "type": "phy"
226         }
227       ],
228       "networks": [
229         {
230           "id": "baremetal",
231           "link": "baremetal_nic",
232           "type": "ipv4",
233           "ip_address": "10.10.110.22/24",
234           "gateway": "10.10.110.1",
235           "dns_nameservers": ["8.8.8.8"]
236         },
237         {
238           "id": "provisioning",
239           "link": "provisioning_nic",
240           "type": "ipv4_dhcp"
241         },
242         {
243           "id": "sriov",
244           "link": "sriov_nic",
245           "type": "ipv4",
246           "ip_address": "10.10.113.3/24"
247         }
248       ],
249       "services": []
250     }
251   }]
252 }
253 ```
254
255 ##### Local Controller Metal3 Configuration Reference
256 - *node*: The array of nodes required to add to Local Controller.
257 - *name*: This will be the hostname for the machine, once it is
258   provisioned by Metal3.
259 - *ipmi_driver_info*: IPMI driver info is a json field. It currently
260   holds the IPMI information required for Ironic to send the IPMI tool
261   command.
262   - *username*: BMC username required to be provided for Ironic.
263   - *password*: BMC password required to be provided for Ironic.
264   - *address*: BMC server IPMI LAN IP address.
265 - *os*: Bare metal machine OS information is a json field. It
266   currently holds the image name to be provisioned, username and
267   password for the login.
268   - *image_name*: Images name should be in qcow2 format.
269   - *username*: Login username for the OS provisioned.
270   - *password*: Login password for the OS provisioned.
271 - *net*: Bare metal network information is a json field.  It describes
272   the interfaces and networks used by ICN.  For more information,
273   refer to the *networkData* field of the BareMetalHost resource
274   definition.
275   - *links*: An array of interfaces.
276         - *id*: The ID of the interface.  This is used in the network
277       definitions to associate the interface with its network
278       configuration.
279     - *ethernet_mac_address*: The MAC address of the interface.
280         - *type*: The type of interface.  Valid values are "phy".
281   - *networks*: An array of networks.
282     - *id*: The ID of the network.
283     - *link*: The ID of the link this network definition applies to.
284     - *type*: The type of network, either dynamic ("ipv4_dhcp") or
285       static ("ipv4").
286     - *ip_address*: Only valid for type "ipv4"; the IP address of the
287       interface.
288     - *gateway*: Only valid for type "ipv4"; the gateway of this
289       network.
290     - *dns_nameservers*: Only valid for type "ipv4"; an array of DNS
291       servers.
292
293 #### Creating the Settings Files
294
295 ##### Local Controller Network Configuration Reference
296 The user will find the network configuration file named as
297 "user_config.sh" in the ICN parent directory.
298
299 `user_config.sh`
300 ``` shell
301 #!/bin/bash
302
303 #Edge Location Provider Network configuration
304 #Net A - Provider Network
305 #If provider having specific Gateway and DNS server details in the edge location,
306 #supply those values in nodes.json.
307
308 #Ironic Metal3 settings for provisioning network
309 #Interface to which Ironic provision network to be connected
310 #Net B - Provisioning Network
311 export IRONIC_INTERFACE="eno2"
312
313 #Ironic Metal3 setting for IPMI LAN Network
314 #Interface to which Ironic IPMI LAN should bind
315 #Net C - IPMI LAN Network
316 export IRONIC_IPMI_INTERFACE="eno1"
317 ```
318
319 #### Running
320 After configuring the node inventory file and network configuration
321 files, please run `make install` from the ICN parent directory as
322 shown below:
323
324 ``` shell
325 root@pod11-jump:# git clone "https://gerrit.akraino.org/r/icn"
326 Cloning into 'icn'...
327 remote: Counting objects: 69, done
328 remote: Finding sources: 100% (69/69)
329 remote: Total 4248 (delta 13), reused 4221 (delta 13)
330 Receiving objects: 100% (4248/4248), 7.74 MiB | 21.84 MiB/s, done.
331 Resolving deltas: 100% (1078/1078), done.
332 root@pod11-jump:# cd icn/
333 root@pod11-jump:# vim Makefile
334 root@pod11-jump:# make install
335 ```
336
337 The following steps occurs once the `make install` command is given.
338 1. All the software required to run the bootstrap cluster is
339    downloaded and installed.
340 2. k8s cluster to maintain the bootstrap cluster and all the servers
341    in the edge location is installed.
342 3. Metal3 specific network configuration such as local DHCP server
343    networking for each edge location, Ironic networking for both
344    provisioning network and IPMI LAN network are identified and
345    created.
346 4. Metal3 is launched with IPMI configuration as configured in
347    "user_config.sh" and provisions the bare metal servers using IPMI
348    LAN network. For more information refer to the [Debugging
349    Failures](#debugging-failures) section.
350 5. Metal3 launch verification runs with a timeout of 60 mins by
351    checking the status of all the servers being provisioned or not.
352    1. All servers are provisioned in parallel. For example, if your
353       deployment is having 10 servers in the edge location, all the 10
354       servers are provisioned at the same time.
355    2. Metal3 launch verification takes care of checking all the
356       servers are provisioned, the network interfaces are up and
357       provisioned with a provider network gateway and DNS server.
358    3. Metal3 launch verification checks the status of all servers
359       given in user_config.sh to make sure all the servers are
360       provisioned. For example, if 8 servers are provisioned and 2
361       servers are not provisioned, launch verification makes sure all
362       servers are provisioned before launch k8s clusters on those
363       servers.
364 6. BPA bare metal components are invoked with the MAC address of the
365    servers provisioned by Metal3, BPA bare metal components decide the
366    cluster size and also the number of clusters required in the edge
367    location.
368 7. BPA bare metal runs the containerized Kuberenetes Reference
369    Deployment (KUD) as a job for each cluster. KUD installs the k8s
370    cluster on the slice of servers and install ONAP4K8S and all other
371    default plugins such as Multus, OVN, OVN4NFV, NFD, Virtlet and
372    SRIOV.
373 8. BPA REST API agent installed in the bootstrap cluster or jump
374    server, and this install rest-api, rook/ceph, MinIO as the cloud
375    storage. This provides a way for user to upload their own software,
376    container images or OS image to jump server.
377
378 ## Virtual Deployment Guide
379
380 ### Standard Deployment Overview
381 ![Figure 2](figure-2.png)*Figure 2: Virtual Deployment Architecture*
382
383 Virtual deployment is used for the development environment using
384 Metal3 virtual deployment to create VM with PXE boot. VM Ansible
385 scripts the node inventory file in /opt/ironic. No setting is required
386 from the user to deploy the virtual deployment.
387
388 ### Snapshot Deployment Overview
389 No snapshot is implemented in ICN R2.
390
391 ### Special Requirements for Virtual Deployment
392
393 #### Install Jump Server
394 Jump server is required to be installed with Ubuntu 18.04. This will
395 install all the VMs and install the k8s clusters.
396
397 #### Verifying the Setup - VMs
398 `make verify_all` installs two VMs with name master-0 and worker-0
399 with 8GB RAM and 8 vCPUs and installs k8s cluster on the VMs using the
400 ICN BPA operator and install the ICN BPA REST API verifier. BPA
401 operator installs the multi-cluster KUD to bring up k8s with all
402 addons and plugins.
403
404 # Verifying the Setup
405 ICN blueprint checks all the setup in both bare metal and VM
406 deployment. Verify script will check that Metal3 provisioned the OS in
407 each bare metal servers by checking with a timeout period of 60 sec
408 and interval of 30. BPA operator verifier will check whether the KUD
409 installation is complete by doing plain curl command to the k8s
410 cluster installed in bare metal and VM setup.
411
412 **Bare Metal Verifier**: Run the `make bm_verifer`, it will verify the
413 bare-metal deployment.
414
415 **Verifier**: Run the `make vm_verifier`, it will verify the virtual
416 deployment.
417
418 # Developer Guide and Troubleshooting
419 For development uses the virtual deployment, it take up to 10 mins to
420 bring up the virtual BMC VMs with PXE boot.  Virtual deployment works
421 well for the BPA operator development for Metal3 installation scripts.
422
423 ## Utilization of Images
424 No images provided in this ICN release.
425
426 ## Post-deployment Configuration
427 No post-deployment configuration required in this ICN release.
428
429 ## Debugging Failures
430 * For first time installation enable KVM console in the trial or lab
431   servers using Raritan console or use Intel web BMC console.
432
433   ![Figure 3](figure-3.png)
434 * Deprovision state will result in Ironic agent sleeping before next
435   heartbeat - it is not an error. It results in bare metal server
436   without OS and installed with ramdisk.
437 * Deprovision in Metal3 is not straight forward - Metal3 follows
438   various stages from provisioned, deprovisioning and ready. ICN
439   blueprint take care navigating the deprovisioning states and
440   removing the BareMetalHost (BMH) custom resouce in case of cleaning.
441 * Manual BMH cleaning of BMH or force cleaning of BMH resource result
442   in hang state - use `make bmh_clean` to remove the BMH state.
443 * Logs of Ironic, openstack baremetal command to see the state of the
444   server.
445 * Logs of baremetal operator gives failure related to images or images
446   md5sum errors.
447 * It is not possible to change the state from provision to deprovision
448   or deprovision to provision without completing that state. All the
449   issues are handled in ICN scripts.
450 * k8s cluster failure can be debugged by KUD Pod logs.
451
452 ## Reporting a Bug
453 Required Linux Foundation ID to launch bug in ICN:
454 https://jira.akraino.org/projects/ICN/issues
455
456 # Uninstall Guide
457
458 ## Bare Metal deployment
459 The command `make clean_all` uninstalls all the components installed by
460 `make install`
461 * It de-provision all the servers provisioned and removes them from
462   Ironic database.
463 * Baremetal operator is deleted followed by Ironic database and
464   container.
465 * Network configuration such internal DHCP server, provisioning
466   interfaces and IPMI LAN interfaces are deleted.
467 * docker images built during the `make install` are deleted, such as
468   all Ironic, baremetal operator, BPA operator and KUD images.
469 * KUD will reset the bootstrap cluster - k8s cluster is torn down in
470   the jump server and all the associated docker images are removed.
471 * All software packages installed by `make install_all` are removed,
472   such as Ironic, openstack utility tool, docker packages and basic
473   prerequisite packages.
474
475 ## Virtual deployment
476 The command `make vm_clean_all` uninstalls all the components for the
477 virtual deployments.
478
479 # Troubleshooting
480
481 ## Error Message Guide
482 The error message is explicit, all messages are captured in log
483 directory.
484
485 # Maintenance
486
487 ## Blueprint Package Maintenance
488 No packages are maintained in ICN.
489
490 ## Software maintenance
491 Not applicable.
492
493 ## Hardware maintenance
494 Not applicable.
495
496 ## BluePrint Deployment Maintenance
497 Not applicable.
498
499 # Frequently Asked Questions
500 **How to setup IPMI?**
501
502 First, make sure the IPMI tool is installed in your servers, if not
503 install them using `apt install ipmitool`. Then, check for the
504 ipmitool information of each servers using the command `ipmitool lan
505 print 1`. If the above command doesn't show the IPMI information, then
506 setup the IPMI static IP address using the following instructions:
507 - Mostl easy way to set up IPMI topology in your lab setup is by
508   using IPMI tool.
509 - Using IPMI tool -
510   https://www.thomas-krenn.com/en/wiki/Configuring_IPMI_under_Linux_using_ipmitool
511 - IPMI information can be considered during the BIOS setting as well.
512
513 **BMC web console URL is not working?**
514
515 It is hard to find issues or reason. Check the ipmitool bmc info to
516 find the issues, if the URL is not available.
517
518 **No change in BMH state - provisioning state is for more than 40min?**
519
520 Generally, Metal3 provision for bare metal takes 20 - 30 mins. Look at
521 the Ironic logs and baremetal operator to look at the state of
522 servers. Openstack baremetal node shows all state of the server right
523 from power, storage.
524
525 **Why provider network (baremetal network configuration) is required?**
526
527 Generally, provider network DHCP servers in a lab provide the router
528 and DNS server details. In some labs, there is no DHCP server or the
529 DHCP server does not provide this information.
530
531 # License
532
533 ```
534 /*
535 * Copyright 2019 Intel Corporation, Inc
536 *
537 * Licensed under the Apache License, Version 2.0 (the "License");
538 * you may not use this file except in compliance with the License.
539 * You may obtain a copy of the License at
540 *
541 * http://www.apache.org/licenses/LICENSE-2.0
542 *
543 * Unless required by applicable law or agreed to in writing, software
544 * distributed under the License is distributed on an "AS IS" BASIS,
545 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
546 * See the License for the specific language governing permissions and
547 * limitations under the License.
548 */
549 ```
550
551 # References
552
553 # Definitions, acronyms and abbreviations