Merge "Adding mock-detached util function and cleaning up util help output"
[apex.git] / docs / installation-instructions / baremetal.rst
1 Installation High-Level Overview - Bare Metal Deployment
2 ========================================================
3
4 The setup presumes that you have 6 or more bare metal servers already setup with
5 network connectivity on at least 2 interfaces for all servers via a TOR switch or
6 other network implementation.
7
8 The physical TOR switches are **not** automatically configured from the OPNFV reference
9 platform.  All the networks involved in the OPNFV infrastructure as well as the provider
10 networks and the private tenant VLANs needs to be manually configured.
11
12 The Jumphost can be installed using the bootable ISO or by other means including the
13 (``opnfv-apex*.rpm``) RPMs, their dependencies and virtualization capabilities.  The
14 Jumphost should then be configured with an IP gateway on its admin or public interface
15 and configured with a working DNS server.  The Jumphost should also have routable access
16 to the lights out network.
17
18 ``opnfv-deploy`` is then executed in order to deploy the Undercloud VM.  ``opnfv-deploy`` uses
19 three configuration files in order to know how to install and provision the OPNFV target system.
20 The information gathered under section `Execution Requirements (Bare Metal Only)`_ is put
21 into the YAML file ``/etc/opnfv-apex/inventory.yaml`` configuration file.  Deployment
22 options are put into the YAML file ``/etc/opnfv-apex/deploy_settings.yaml``.  Alternatively
23 there are pre-baked deploy_settings files available in ``/etc/opnfv-apex/``. These files are
24 named with the naming convention os-sdn_controller-enabled_feature-[no]ha.yaml. These files can
25 be used in place of the ``/etc/opnfv-apex/deploy_settings.yaml`` file if one suites your
26 deployment needs.  Networking definitions gathered under section `Network Requirements`_ are put
27 into the YAML file ``/etc/opnfv-apex/network_settings.yaml``.  ``opnfv-deploy`` will boot
28 the Undercloud VM and load the target deployment configuration into the provisioning toolchain.
29 This includes MAC address, IPMI, Networking Environment and OPNFV deployment options.
30
31 Once configuration is loaded and the Undercloud is configured it will then reboot the nodes
32 via IPMI.  The nodes should already be set to PXE boot first off the admin interface.  The nodes
33 will first PXE off of the Undercloud PXE server and go through a discovery/introspection process.
34
35 Introspection boots off of custom introspection PXE images. These images are designed to look
36 at the properties of the hardware that is booting off of them and report the properties of
37 it back to the Undercloud node.
38
39 After introspection Undercloud will execute a Heat Stack Deployment to being node provisioning
40 and configuration.  The nodes will reboot and PXE again off the Undercloud PXE server to
41 provision each node using the Glance disk images provided by Undercloud These disk images
42 include all the necessary packages and configuration for an OPNFV deployment to execute.
43 Once the node's disk images have been written to disk the nodes will boot off the newly written
44 disks and execute cloud-init which will execute the final node configuration. This
45 configuration is largly completed by executing a puppet apply on each node.
46
47 Installation High-Level Overview - VM Deployment
48 ================================================
49
50 The VM nodes deployment operates almost the same way as the bare metal deployment with a
51 few differences.  ``opnfv-deploy`` still deploys an Undercloud VM. In addition to the Undercloud VM
52 a collection of VMs (3 control nodes + 2 compute for an HA deployment or 1 control node and
53 1 compute node for a Non-HA Deployment) will be defined for the target OPNFV deployment.
54 The part of the toolchain that executes IPMI power instructions calls into libvirt instead of
55 the IPMI interfaces on baremetal servers to operate the power managment.  These VMs are then
56 provisioned with the same disk images and configuration that baremetal would be.
57
58 To Triple-O these nodes look like they have just built and registered the same way as
59 bare metal nodes, the main difference is the use of a libvirt driver for the power management.
60
61 Installation Guide - Bare Metal Deployment
62 ==========================================
63
64 This section goes step-by-step on how to correctly install and provision the OPNFV target
65 system to bare metal nodes.
66
67 Install Bare Metal Jumphost
68 ---------------------------
69
70 1a. If your Jumphost does not have CentOS 7 already on it, or you would like to do a fresh
71     install, then download the Apex bootable ISO from OPNFV artifacts <http://artifacts.opnfv.org/>.
72     There have been isolated reports of problems with the ISO having trouble completing
73     installation successfully. In the unexpected event the ISO does not work please workaround
74     this by downloading the CentOS 7 DVD and performing a "Virtualization Host" install.
75     If you perform a "Minimal Install" or install type other than "Virtualization Host" simply
76     run ``sudo yum groupinstall "Virtualization Host" && chkconfig libvirtd on && reboot``
77     to install virtualzation support and enable libvirt on boot. If you use the CentOS 7 DVD
78     proceed to step 1b once the CentOS 7 with "Virtualzation Host" support is completed.
79
80 1b. If your Jump host already has CentOS 7 with libvirt running on it then install the install
81     the RDO Release RPM:
82
83     ``sudo yum install -y https://www.rdoproject.org/repos/rdo-release.rpm opnfv-apex-{version}.rpm``
84
85     The RDO Project release repository is needed to install OpenVSwitch, which is a dependency of
86     opnfv-apex. If you do not have external connectivity to use this repository you need to download
87     the OpenVSwitch RPM from the RDO Project repositories and install it with the opnfv-apex RPM.
88
89 2a.  Boot the ISO off of a USB or other installation media and walk through installing OPNFV CentOS 7.
90     The ISO comes prepared to be written directly to a USB drive with dd as such:
91
92     ``dd if=opnfv-apex.iso of=/dev/sdX bs=4M``
93
94     Replace /dev/sdX with the device assigned to your usb drive. Then select the USB device as the
95     boot media on your Jumphost
96
97 2b. If your Jump host already has CentOS 7 with libvirt running on it then install the
98     opnfv-apex RPMs from OPNFV artifacts <http://artifacts.opnfv.org/>. The following RPMS
99     are available for installation:
100
101     - opnfv-apex                  - OpenDaylight L2 / L3 and ONOS support **
102     - opnfv-apex-onos             - ONOS support **
103     - opnfv-apex-opendaylight-sfc - OpenDaylight SFC support **
104     - opnfv-apex-undercloud       - (required) Undercloud Image
105     - opnfv-apex-common           - (required) Supporting config files and scripts
106     - python34-markupsafe         - (required) Dependency of opnfv-apex-common ***
107     - python3-jinja2              - (required) Dependency of opnfv-apex-common ***
108
109     ** One or more of these RPMs is required
110     Only one of opnfv-apex, opnfv-apex-onos and opnfv-apex-opendaylight-sfc is required. It is
111     safe to leave the unneeded SDN controller's RPMs uninstalled if you do not intend to use them.
112
113     *** These RPMs are not yet distributed by CentOS or EPEL.
114     Apex has built these for distribution with Apex while CentOS and EPEL do not distribute them. Once
115     they are carried in an upstream channel Apex will no longer carry them and they will not need
116     special handling for installation.
117
118     To install these RPMs download them to the local disk on your CentOS 7 install and pass the
119     file names directly to yum:
120     ``sudo yum install python34-markupsafe-<version>.rpm python3-jinja2-<version>.rpm``
121     ``sudo yum install opnfv-apex-<version>.rpm opnfv-apex-undercloud-<version>.rpm opnfv-apex-common-<version>.rpm``
122
123
124 3.  After the operating system and the opnfv-apex RPMs are installed, login to your Jumphost as root.
125
126 4.  Configure IP addresses on the interfaces that you have selected as your networks.
127
128 5.  Configure the IP gateway to the Internet either, preferably on the public interface.
129
130 6.  Configure your ``/etc/resolv.conf`` to point to a DNS server (8.8.8.8 is provided by Google).
131
132 Creating a Node Inventory File
133 ------------------------------
134
135 IPMI configuration information gathered in section `Execution Requirements (Bare Metal Only)`_
136 needs to be added to the ``inventory.yaml`` file.
137
138 1.  Copy ``/usr/share/doc/opnfv/inventory.yaml.example`` as your inventory file template to
139     ``/etc/opnfv-apex/inventory.yaml``.
140
141 2.  The nodes dictionary contains a definition block for each baremetal host that will be deployed.
142     1 or more compute nodes and 3 controller nodes are required.
143     (The example file contains blocks for each of these already).
144     It is optional at this point to add more compute nodes into the node list.
145
146 3.  Edit the following values for each node:
147
148     - ``mac_address``: MAC of the interface that will PXE boot from Undercloud
149     - ``ipmi_ip``: IPMI IP Address
150     - ``ipmi_user``: IPMI username
151     - ``ipmi_password``: IPMI password
152     - ``pm_type``: Power Management driver to use for the node
153     - ``cpus``: (Introspected*) CPU cores available
154     - ``memory``: (Introspected*) Memory available in Mib
155     - ``disk``: (Introspected*) Disk space available in Gb
156     - ``arch``: (Introspected*) System architecture
157     - ``capabilities``: (Optional**) Intended node role (profile:control or profile:compute)
158
159 * Introspection looks up the overcloud node's resources and overrides these value. You can
160 leave default values and Apex will get the correct values when it runs introspection on the nodes.
161
162 ** If capabilities profile is not specified then Apex will select node's roles in the OPNFV cluster
163 in a non-deterministic fashion.
164
165 Creating the Settings Files
166 ---------------------------
167
168 Edit the 2 settings files in /etc/opnfv-apex/. These files have comments to help you customize them.
169
170 1. deploy_settings.yaml
171    This file includes basic configuration options deployment.
172    Alternatively, there are pre-built deploy_settings files available in (``/etc/opnfv-apex/``). These
173    files are named with the naming convention os-sdn_controller-enabled_feature-[no]ha.yaml. These
174    files can be used in place of the (``/etc/opnfv-apex/deploy_settings.yaml``) file if one suites your
175    deployment needs. If a pre-built deploy_settings file is choosen there is no need to customize
176    (``/etc/opnfv-apex/deploy_settings.yaml``). The pre-built file can be used in place of the
177    (``/etc/opnfv-apex/deploy_settings.yaml``) file.
178
179 2. network_settings.yaml
180    This file provides Apex with the networking information that satisfies the
181    prerequisite `Network Requirements`_. These are specific to your environment.
182
183 Running ``opnfv-deploy``
184 ------------------------
185
186 You are now ready to deploy OPNFV using Apex!
187 ``opnfv-deploy`` will use the inventory and settings files to deploy OPNFV.
188
189 Follow the steps below to execute:
190
191 1.  Execute opnfv-deploy
192     ``sudo opnfv-deploy [ --flat ] -n network_settings.yaml -i inventory.yaml -d deploy_settings.yaml``
193     If you need more information about the options that can be passed to opnfv-deploy use ``opnfv-deploy --help``
194     --flat collapses all networks to a single nic, only uses the admin network from the network settings file.
195     -n network_settings.yaml allows you to customize your networking topology.
196
197 2.  Wait while deployment is executed.
198     If something goes wrong during this part of the process,
199     it is most likely a problem with the setup of your network or the information in your configuration files.
200     You will also notice different outputs in your shell.
201
202 3.  The message "Overcloud Deployed" will display when When the deployment is complete.  Just above this message there
203     will be a URL that ends in port http://<host>:5000. This url is also the endpoint for the OPNFV Horizon Dashboard
204     if connected to on port 80.
205
206 .. _`Execution Requirements (Bare Metal Only)`: requirements.html#execution-requirements-bare-metal-only
207 .. _`Network Requirements`: requirements.html#network-requirements