add 'sudo' for 'opnfv-deploy' command lines
[apex.git] / docs / installation-instructions / installation-instructions.rst
1 ========================================================================================================
2 OPNFV Installation instructions for the Bramaputra release of OPNFV when using Apex as a deployment tool
3 ========================================================================================================
4
5
6 .. contents:: Table of Contents
7    :backlinks: none
8
9
10 Abstract
11 ========
12
13 This document describes how to install the Bramaputra release of OPNFV when
14 using Apex as a deployment tool covering it's limitations, dependencies
15 and required system resources.
16
17 License
18 =======
19 Bramaputra release of OPNFV when using Apex as a deployment tool Docs
20 (c) by Tim Rozet (Red Hat) and Dan Radez (Red Hat)
21
22 Bramaputra release of OPNFV when using Apex as a deployment tool Docs
23 are licensed under a Creative Commons Attribution 4.0 International License.
24 You should have received a copy of the license along with this.
25 If not, see <http://creativecommons.org/licenses/by/4.0/>.
26
27 Version history
28 ===================
29
30 +--------------------+--------------------+--------------------+---------------------------+
31 | **Date**           | **Ver.**           | **Author**         | **Comment**               |
32 |                    |                    |                    |                           |
33 +--------------------+--------------------+--------------------+---------------------------+
34 | 2015-09-17         | 1.0.0              | Dan Radez          | Rewritten for             |
35 |                    |                    | (Red Hat)          | Apex/RDO Manager support  |
36 +--------------------+--------------------+--------------------+---------------------------+
37 | 2015-06-03         | 0.0.4              | Ildiko Vancsa      | Minor changes             |
38 |                    |                    | (Ericsson)         |                           |
39 +--------------------+--------------------+--------------------+---------------------------+
40 | 2015-06-02         | 0.0.3              | Christopher Price  | Minor changes &           |
41 |                    |                    | (Ericsson AB)      | formatting                |
42 +--------------------+--------------------+--------------------+---------------------------+
43 | 2015-05-27         | 0.0.2              | Christopher Price  | Minor changes &           |
44 |                    |                    | (Ericsson AB)      | formatting                |
45 +--------------------+--------------------+--------------------+---------------------------+
46 | 2015-05-07         | 0.0.1              | Tim Rozet          | First draft               |
47 |                    |                    | (Red Hat)          |                           |
48 +--------------------+--------------------+--------------------+---------------------------+
49
50
51 Introduction
52 ============
53
54 This document describes the steps to install an OPNFV Bramaputra reference
55 platform, as defined by the Genesis Project using the Apex installer.
56
57 The audience is assumed to have a good background in networking
58 and Linux administration.
59
60 Preface
61 =======
62
63 Apex uses the RDO Manager Open Source project as a server provisioning tool.
64 RDO Manager is the RDO Project implimentation of OpenStack's Triple-O project.
65 The Triple-O image based life cycle installation tool provisions an OPNFV
66 Target System (3 controllers, n number of compute nodes) with OPNFV specific
67 configuration provided by the Apex deployment tool chain.
68
69 The Apex deployment artifacts contain the necessary tools to deploy and
70 configure an OPNFV target system using the Apex deployment toolchain.
71 These artifacts offer the choice of using the Apex bootable ISO
72 (``bramaputra.2016.1.0.apex.iso``) to both install CentOS 7 and the
73 nessesary materials to deploy or the Apex RPM (``opnfv-apex.rpm``)
74 which expects installation to a CentOS 7 libvirt enabled host. The RPM
75 contains a collection of configuration file, prebuilt disk images,
76 and the automatic deployment script (``opnfv-deploy``).
77
78 An OPNFV install requires a "Jumphost" in order to operate.  The bootable
79 ISO will allow you to install a customized CentOS 7 release to the Jumphost,
80 which includes the required packages needed to run ``opnfv-deploy``.
81 If you already have a Jumphost with CentOS 7 installed, you may choose to
82 skip the ISO step and simply install the (``opnfv-apex.rpm``) RPM. The RPM
83 is the same RPM included in the ISO and includes all the necessary disk
84 images and configuration files to execute an OPNFV deployment. Either method
85 will prepare a host to the same ready state for OPNFV deployment.
86
87 ``opnfv-deploy`` instantiates an RDO Manager Instack VM server using libvirt
88 as its provider.  This VM is then configured and used to provision the
89 OPNFV target deployment (3 controllers, n compute nodes).  These nodes can
90 be either virtual or bare metal. This guide contains instructions for
91 installing either method.
92
93 Triple-O Deployment Architecture
94 ================================
95
96 Apex is based on RDO Manager which is the RDO Project's implementation of
97 the OpenStack Triple-O project.  It is important to understand the basics
98 of a Triple-O deployment to help make decisions that will assist in
99 successfully deploying OPNFV.
100
101 Triple-O stands for OpenStack On OpenStack.  This means that OpenStack
102 will be used to install OpenStack. The target OPNFV deployment is an
103 OpenStack cloud with NFV features built-in that will be deployed by a
104 smaller all-in-one deployment of OpenStack.  In this deployment
105 methodology there are two OpenStack installations. They are referred
106 to as the undercloud and the overcloud. The undercloud is used to
107 deploy the overcloud.
108
109 The undercloud is the all-in-one installation of OpenStack that includes
110 baremetal provisioning.  RDO Manager's deployment of the undercloud is
111 call Instack. Instack will be deployed as a virtual machine on a jumphost.
112 This VM is pre-built and distributed as part of the Apex RPM.
113
114 The overcloud is OPNFV. Configuration will be passed into Instack and
115 Instack will use OpenStack's orchestration component call Heat to
116 execute a deployment will provision the target nodes to become OPNFV.
117
118
119
120 Setup Requirements
121 ==================
122
123 Jumphost Requirements
124 ---------------------
125
126 The Jumphost requirements are outlined below:
127
128 1.     CentOS 7 (from ISO or self-installed).
129
130 2.     Root access.
131
132 3.     libvirt virtualization support.
133
134 4.     minimum 2 networks and maximum 6 networks, multiple NIC and/or VLAN combinations are supported.
135        This is virtualized for a VM deployment.
136
137 5.     The Bramaputra Apex RPM.
138
139 6.     16 GB of RAM for a bare metal deployment, 56 GB of RAM for a VM deployment.
140
141 Network Requirements
142 --------------------
143
144 Network requirements include:
145
146 1.     No DHCP or TFTP server running on networks used by OPNFV.
147
148 2.     2-6 separate networks with connectivity between Jumphost and nodes.
149
150        -  Control Plane Network (Provisioning)
151
152        -  Private / Internal Network*
153
154        -  External Network
155
156        -  Storage Network*
157
158 3.     Lights out OOB network access from Jumphost with IPMI node enabled (bare metal deployment only).
159
160 4.     Admin or public network has Internet access, meaning a gateway and DNS availability.
161
162 | `*` *These networks can be combined with each other or all combined on the Control Plane network.*
163 | `*` *Non-External networks will be consolidated to the Control Plane network if not specifically configured.*
164
165 Bare Metal Node Requirements
166 ----------------------------
167
168 Bare metal nodes require:
169
170 1.     IPMI enabled on OOB interface for power control.
171
172 2.     BIOS boot priority should be PXE first then local hard disk.
173
174 3.     BIOS PXE interface should include Control Plane network mentioned above.
175
176 Execution Requirements (Bare Metal Only)
177 ----------------------------------------
178
179 In order to execute a deployment, one must gather the following information:
180
181 1.     IPMI IP addresses for the nodes.
182
183 2.     IPMI login information for the nodes (user/pass).
184
185 3.     MAC address of Control Plane / Provisioning interfaces of the overcloud nodes.
186
187
188 Installation High-Level Overview - Bare Metal Deployment
189 ========================================================
190
191 The setup presumes that you have 6 bare metal servers and have already setup network
192 connectivity on at least 2 interfaces for all servers via a TOR switch or other
193 network implementation.
194
195 The physical TOR switches are **not** automatically configured from the OPNFV reference
196 platform.  All the networks involved in the OPNFV infrastructure as well as the provider
197 networks and the private tenant VLANs needs to be manually configured.
198
199 The Jumphost can be installed using the bootable ISO or by other means including the
200 (``opnfv-apex``) RPM and virtualization capabilities.  The Jumphost should then be
201 configured with an IP gateway on its admin or public interface and configured with a
202 working DNS server.  The Jumphost should also have routable access to the lights out network.
203
204 ``opnfv-deploy`` is then executed in order to deploy the Instack VM.  ``opnfv-deploy`` uses
205 two configuration files in order to know how to install and provision the OPNFV target system.
206 The information gathered under section `Execution Requirements (Bare Metal Only)`_ is put
207 into the JSON file (``instackenv.json``) configuration file.  Networking definitions gathered
208 under section `Network Requirements`_ are put into the JSON file
209 (``network-environment.yaml``).  ``opnfv-deploy`` will boot the Instack VM and load the target
210 deployment configuration into the provisioning toolchain.  This includes MAC address, IPMI,
211 Networking Environment and OPNFV deployment options.
212
213 Once configuration is loaded and Instack is configured it will then reboot the nodes via IPMI.
214 The nodes should already be set to PXE boot first off the admin interface.  The nodes will
215 first PXE off of the Instack PXE server and go through a discovery/introspection process.
216
217 Introspection boots off of custom introspection PXE images. These images are designed to look
218 at the properties of the hardware that is booting off of them and report the properties of
219 it back to the Instack node.
220
221 After introspection Instack will execute a Heat Stack Deployment to being node provisioning
222 and configuration.  The nodes will reboot and PXE again off the Instack PXE server to
223 provision each node using the Glance disk images provided by Instack. These disk images
224 include all the necessary packages and configuration for an OPNFV deployment to execute.
225 Once the node's disk images have been written to disk the nodes will boot off the newly written
226 disks and execute cloud-init which will execute the final node configuration. This
227 configuration is largly completed by executing a puppet apply on each node.
228
229 Installation High-Level Overview - VM Deployment
230 ================================================
231
232 The VM nodes deployment operates almost the same way as the bare metal deployment with a
233 few differences.  ``opnfv-deploy`` still deploys an Instack VM. In addition to the Instack VM
234 a collection of VMs (3 control nodes + 2 compute for an HA deployment or 1 control node and
235 1 compute node for a Non-HA Deployment) will be defined for the target OPNFV deployment.
236 The part of the toolchain that executes IPMI power instructions calls into libvirt instead of
237 the IPMI interfaces on baremetal servers to operate the power managment.  These VMs are then
238 provisioned with the same disk images and configuration that baremetal would be.
239
240 To RDO Manager these nodes look like they have just built and registered the same way as
241 bare metal nodes, the main difference is the use of a libvirt driver for the power management.
242
243 Installation Guide - Bare Metal Deployment
244 ==========================================
245
246 **WARNING: Baremetal documentation is not complete.  WARNING: The main missing instructions are r elated to bridging
247 the networking for the undercloud to the physical underlay network for the overcloud to be deployed to.**
248
249 This section goes step-by-step on how to correctly install and provision the OPNFV target
250 system to bare metal nodes.
251
252 Install Bare Metal Jumphost
253 ---------------------------
254
255 1a. If your Jumphost does not have CentOS 7 already on it, or you would like to do a fresh
256     install, then download the Apex bootable ISO from OPNFV artifacts <http://artifacts.opnfv.org/>.
257
258 1b. If your Jump host already has CentOS 7 with libvirt running on it then install the
259     opnfv-apex RPM from OPNFV artifacts <http://artifacts.opnfv.org/>.
260
261 2a.  Boot the ISO off of a USB or other installation media and walk through installing OPNFV CentOS 7.
262     The ISO comes prepared to be written directly to a USB drive with dd as such:
263
264     ``dd if=opnfv-apex.iso of=/dev/sdX bs=4M``
265
266     Replace /dev/sdX with the device assigned to your usb drive. Then select the USB device as the
267     boot media on your Jumphost
268
269 2b. Install the RDO Release RPM and the opnfv-apex RPM:
270
271     ``sudo yum install -y https://www.rdoproject.org/repos/rdo-release.rpm opnfv-apex-{version}.rpm``
272
273     The RDO Project release repository is needed to install OpenVSwitch, which is a dependency of
274     opnfv-apex. If you do not have external connectivity to use this repository you need to download
275     the OpenVSwitch RPM from the RDO Project repositories and install it with the opnfv-apex RPM.
276
277 3.  After the operating system and the opnfv-apex RPM are installed, login to your Jumphost as root.
278
279 4.  Configure IP addresses on the interfaces that you have selected as your networks.
280
281 5.  Configure the IP gateway to the Internet either, preferably on the public interface.
282
283 6.  Configure your ``/etc/resolv.conf`` to point to a DNS server (8.8.8.8 is provided by Google).
284
285 Creating a Node Inventory File
286 ------------------------------
287
288 IPMI configuration information gathered in section `Execution Requirements (Bare Metal Only)`_
289 needs to be added to the ``instackenv.json`` file.
290
291 1.  Make a copy of ``/var/opt/opnfv/instackenv.json.example`` into root's home directory: ``/root/instackenv.json``
292
293 2.  Edit the file in your favorite editor.
294
295 3.  The nodes dictionary contains a definition block for each baremetal host that will be deployed.
296     1 or more compute nodes and 3 controller nodes are required.
297     (The example file contains blocks for each of these already).
298     It is optional at this point to add more compute nodes into the dictionary.
299
300 4.  Edit the following values for each node:
301
302     - ``pm_type``: Power Management driver to use for the node
303     - ``pm_addr``: IPMI IP Address
304     - ``pm_user``: IPMI username
305     - ``pm_password``: IPMI password
306     - ``capabilities``: Intended node role (profile:control or profile:compute)
307     - ``cpu``: CPU cores available
308     - ``memory``: Memory available in Mib
309     - ``disk``: Disk space available in Gb
310     - ``arch``: System architecture
311     - ``mac``: MAC of the interface that will PXE boot from Instack
312
313 5.  Save your changes.
314
315 Creating a Network Environment File
316 -----------------------------------
317
318 Network environment information gathered in section `Network Requirements`_
319 needs to be added to the ``network-environment.yaml`` file.
320
321 1. Make a copy of ``/var/opt/opnfv/network-environment.yaml`` into root's home
322 directory: ``/root/network-environment.yaml``
323
324 2. Edit the file in your favorite editor.
325
326 3. Update the information (TODO: More Cowbell please!)
327
328 Running ``opnfv-deploy``
329 ------------------------
330
331 You are now ready to deploy OPNFV!
332 ``opnfv-deploy`` will use the instackenv.json and network-environment.yaml to deploy OPNFV.
333 The names of these files are important.  ``opnfv-deploy`` will look for ``instackenv.json`` and
334 ``network-environment.yaml`` in the present working directory when it is run.
335
336 Follow the steps below to execute:
337
338 1.  execute ``sudo opnfv-deploy -i /path/to/instackenv.json -n /path/to/network-environment.yaml``
339
340 2.  It will take about approximately 30 minutes to stand up instack,
341     configure the deployment and execute the deployment.
342     If something goes wrong during this part of the process,
343     it is most likely a problem with the setup of your network or the information in your configuration files.
344     You will also notice different outputs in your shell.
345
346 3.  The message "Overcloud Deployed" will display when When the deployment is complete.  Just above this message there
347     will be a URL that ends in port http://<host>:5000. This url is also the endpoint for the OPNFV Horizon Dashboard
348     if connected to on port 80.
349
350 Verifying the Setup
351 -------------------
352
353 Once the deployment has finished, the OPNFV deployment can be accessed via the Instack node. From
354 the jump host ssh to the instack host and become the stack user. Alternativly ssh keys have been
355 setup such that the root user on the jump host can ssh to Instack directly as the stack user.
356
357 | ``ssh root@192.0.2.1``
358 | ``su - stack``
359
360 Once connected to Instack as the stack user look for two keystone files that can be used to
361 interact with the undercloud and the overcloud. Source the appropriate RC file to interact with
362 the respective OpenStack deployment.
363
364 | ``source stackrc`` (undercloud / Instack)
365 | ``source overcloudrc`` (overcloud / OPNFV)
366
367 The contents of these files include the credentials for the administrative user for Instack and
368 OPNFV respectivly. At this point both Instack and OPNFV can be interacted with just as any
369 OpenStack installation can be. Start by listing the nodes in the undercloud that were used
370 to deploy the overcloud.
371
372 | ``source stackrc``
373 | ``openstack server list``
374
375 The control and compute nodes will be listed in the output of this server list command. The IP
376 addresses that are listed are the control plane addresses that were used to provision the nodes.
377 Use these IP addresses to connect to these nodes. Initial authentication requires using the
378 user heat-admin.
379
380 | ``ssh heat-admin@192.0.2.7``
381
382 To begin creating users, images, networks, servers, etc in OPNFV source the overcloudrc file or
383 retrieve the admin user's credentials from the overcloudrc file and connect to the web Dashboard.
384
385
386 You are now able to follow the `OpenStack Verification`_ section.
387
388 OpenStack Verification
389 ----------------------
390
391 Once connected to the OPNFV Dashboard make sure the OPNFV target system is working correctly:
392
393 1.  In the left pane, click Compute -> Images, click Create Image.
394
395 2.  Insert a name "cirros", Insert an Image Location
396     ``http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img``.
397
398 3.  Select format "QCOW2", select Public, then click Create Image.
399
400 4.  Now click Project -> Network -> Networks, click Create Network.
401
402 5.  Enter a name "internal", click Next.
403
404 6.  Enter a subnet name "internal_subnet", and enter Network Address ``172.16.1.0/24``, click Next.
405
406 7. Now go to Project -> Compute -> Instances, click Launch Instance.
407
408 8. Enter Instance Name "first_instance", select Instance Boot Source "Boot from image",
409    and then select Image Name "cirros".
410
411 9. Click Launch, status will cycle though a couple states before becoming "Active".
412
413 10. Steps 7 though 9 can be repeated to launch more instances.
414
415 11. Once an instance becomes "Active" their IP addresses will display on the Instances page.
416
417 12. Click the name of an instance, then the "Console" tab and login as "cirros"/"cubswin:)"
418
419 13. To verify storage is working, click Project -> Compute -> Volumes, Create Volume
420
421 14. Give the volume a name and a size of 1 GB
422
423 15. Once the volume becomes "Available" click the dropdown arrow and attach it to an instance.
424
425 Congratulations you have successfully installed OPNFV!
426
427 Installation Guide - VM Deployment
428 ==================================
429
430 This section goes step-by-step on how to correctly install and provision the OPNFV target system to VM nodes.
431
432 Install Jumphost
433 ----------------
434
435 Follow the instructions in the `Install Bare Metal Jumphost`_ section.
436
437 Running ``opnfv-deploy``
438 ------------------------
439
440 You are now ready to deploy OPNFV!
441 ``opnfv-deploy`` has virtual deployment capability that includes all of
442 the configuration nessesary to deploy OPNFV with no modifications.
443
444 If no modifications are made to the included configurations the target environment
445 will deploy with the following architecture:
446
447     - 1 Instack VM
448
449     - The option of 3 control and 2 compute VMs (HA Deploy / default)
450       or 1 control and 1 compute VM (Non-HA deploy / pass -n)
451
452     - 2 networks, one for provisioning, internal API,
453       storage and tenant networking traffic and a second for the external network
454
455 Follow the steps below to execute:
456
457 1.  ``sudo opnfv-deploy --virtual [ --no-ha ]``
458
459 2.  It will take approximately 30 minutes to stand up instack,
460     define the target virtual machines, configure the deployment and execute the deployment.
461     You will notice different outputs in your shell.
462
463 3.  When the deployment is complete you will see "Overcloud Deployed"
464
465 Verifying the Setup - VMs
466 -------------------------
467
468 To verify the set you can follow the instructions in the `Verifying the Setup`_ section.
469
470 Before you get started following these instructions you will need to add IP addresses on the networks that have been
471 created for the External and provisioning networks. By default the External network is 192.168.37.0/24 and the
472 provisioning network is 192.0.2.0/24. To access these networks simply add an IP to brbm and brbm1 and set their link to
473 up. This will provide a route from the hypervisor into the virtual networks acting as OpenStack's underlay network in
474 the virtual deployment.
475
476 | ``ip addr add 192.0.2.252/24 dev brbm``
477 | ``ip link set up dev brbm``
478 | ``ip addr add 192.168.37.252/24 dev brbm1``
479 | ``ip link set up dev brbm1``
480
481 Once these IP addresses are assigned and the links are up the gateways on the overcloud's networks should be pingable
482 and read to be SSHed to.
483
484 | ``ping 192.0.2.1``
485 | ``ping 192.168.37.1``
486
487 Now continue with the `Verifying the Setup`_ section.
488
489 OpenStack Verification - VMs
490 ----------------------------
491
492 Follow the steps in `OpenStack Verification`_ section.
493
494 Frequently Asked Questions
495 ==========================
496
497 License
498 =======
499
500 All Apex and "common" entities are protected by the `Apache 2.0 License <http://www.apache.org/licenses/>`_.
501
502 References
503 ==========
504
505 OPNFV
506 -----
507
508 `OPNFV Home Page <www.opnfv.org>`_
509
510 `OPNFV Genesis project page <https://wiki.opnfv.org/get_started>`_
511
512 `OPNFV Apex project page <https://wiki.opnfv.org/apex>`_
513
514 OpenStack
515 ---------
516
517 `OpenStack Liberty Release artifacts <http://www.openstack.org/software/liberty>`_
518
519 `OpenStack documentation <http://docs.openstack.org>`_
520
521 OpenDaylight
522 ------------
523
524 Upstream OpenDaylight provides `a number of packaging and deployment options <https://wiki.opendaylight.org/view/Deployment>`_ meant for consumption by downstream projects like OPNFV.
525
526 Currently, OPNFV Apex uses `OpenDaylight's Puppet module <https://github.com/dfarrell07/puppet-opendaylight>`_, which in turn depends on `OpenDaylight's RPM <http://cbs.centos.org/repos/nfv7-opendaylight-3-candidate/x86_64/os/Packages/opendaylight-3.0.0-2.el7.noarch.rpm>`_.
527
528 RDO Manager
529 -----------
530
531 `RDO Manager website <https://www.rdoproject.org/rdo-manager>`_
532
533 :Authors: Tim Rozet (trozet@redhat.com)
534 :Authors: Dan Radez (dradez@redhat.com)
535 :Version: 1.0