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