cbbada7219c2a40143fd712506771bac90941005
[genesis.git] / foreman / docs / src / installation-instructions.rst
1 =======================================================================================================
2 OPNFV Installation instructions for the Arno release of OPNFV when using Foreman 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 Arno SR1 release of OPNFV when using Foreman/Quickstack as a
14 deployment tool covering it's limitations, dependencies and required system resources.
15
16 License
17 =======
18 Arno SR1 release of OPNFV when using Foreman as a deployment tool Docs (c) by Tim Rozet (RedHat)
19
20 Arno SR1 release of OPNFV when using Foreman as a deployment tool Docs are licensed under a Creative
21 Commons Attribution 4.0 International License. You should have received a copy of the license along
22 with this. If not, see <http://creativecommons.org/licenses/by/4.0/>.
23
24 Version history
25 ===================
26
27 +--------------------+--------------------+--------------------+--------------------+
28 | **Date**           | **Ver.**           | **Author**         | **Comment**        |
29 |                    |                    |                    |                    |
30 +--------------------+--------------------+--------------------+--------------------+
31 | 2015-05-07         | 0.0.1              | Tim Rozet          | First draft        |
32 |                    |                    | (RedHat)           |                    |
33 +--------------------+--------------------+--------------------+--------------------+
34 | 2015-05-27         | 0.0.2              | Christopher Price  | Minor changes &    |
35 |                    |                    | (Ericsson AB)      | formatting         |
36 +--------------------+--------------------+--------------------+--------------------+
37 | 2015-06-02         | 0.0.3              | Christopher Price  | Minor changes &    |
38 |                    |                    | (Ericsson AB)      | formatting         |
39 +--------------------+--------------------+--------------------+--------------------+
40 | 2015-06-03         | 0.0.4              | Ildiko Vancsa      | Minor changes      |
41 |                    |                    | (Ericsson)         |                    |
42 +--------------------+--------------------+--------------------+--------------------+
43 | 2015-09-10         | 0.2.0              | Tim Rozet          | Update to SR1      |
44 |                    |                    | (Red Hat)          |                    |
45 +--------------------+--------------------+--------------------+--------------------+
46
47 Introduction
48 ============
49
50 This document describes the steps to install an OPNFV Arno SR1 reference platform, as defined by the
51 Bootstrap/Getting-Started (BGS) Project using the Foreman/QuickStack installer.
52
53 The audience is assumed to have a good background in networking and Linux administration.
54
55 Preface
56 =======
57
58 Foreman/QuickStack uses the Foreman Open Source project as a server management tool, which in turn
59 manages and executes Genesis/QuickStack.  Genesis/QuickStack consists of layers of Puppet modules that
60 are capable of provisioning the OPNFV Target System (3 controllers, n number of compute nodes).
61
62 The Genesis repo contains the necessary tools to get install and deploy an OPNFV target system using
63 Foreman/QuickStack.  These tools consist of the Foreman/QuickStack bootable ISO
64 (``arno.2015.2.0.foreman.iso``), and the automatic deployment script (``deploy.sh``).
65
66 An OPNFV install requires a "Jumphost" in order to operate.  The bootable ISO will allow you to install
67 a customized CentOS 7 release to the Jumphost, which then gives you the required packages needed to
68 run ``deploy.sh``.  If you already have a Jumphost with CentOS 7 installed, you may choose to ignore
69 the ISO step and instead move directly to cloning the git repository and running ``deploy.sh``.  In
70 this case, ``deploy.sh`` will install the necessary packages for you in order to execute.
71
72 ``deploy.sh`` installs Foreman/QuickStack VM server using Vagrant with VirtualBox as its provider.
73 This VM is then used to provision the OPNFV target system (3 controllers, n compute nodes).  These
74 nodes can be either virtual or bare metal. This guide contains instructions for installing both.
75
76 Setup Requirements
77 ==================
78
79 Jumphost Requirements
80 ---------------------
81
82 The Jumphost requirements are outlined below:
83
84 1.     CentOS 7 (from ISO or self-installed).
85
86 2.     Root access.
87
88 3.     libvirt or other hypervisors disabled (no kernel modules loaded).
89
90 4.     3-4 NICs for bare metal deployment/only 1 NIC required for virtual deployment, untagged
91 (no 802.1Q tagging), with IP addresses.
92
93 5.     Internet access for downloading packages, with a default gateway configured.
94
95 6.     4 GB of RAM for a bare metal deployment, 18 GB (HA) or 8 GB (non-HA) of RAM for a VM deployment.
96
97 Network Requirements
98 --------------------
99
100 Network requirements include:
101
102 1.     No DHCP or TFTP server running on networks used by OPNFV (bare metal deployment only).
103
104 2.     1, 3, or 4 separate VLANs (untagged) with connectivity between Jumphost and nodes (bare metal
105 deployment only).  These make up the admin, private, public and optional storage networks.  If only
106 1 VLAN network used for baremetal, then all of the previously listed logical networks will be
107 consolidated to that single network.
108
109 3.     Lights out OOB network access from Jumphost with IPMI node enabled (bare metal deployment only).
110
111 4.     Admin or public network has Internet access, meaning a gateway and DNS availability.
112
113 **Note: Storage network will be consolidated to the private network if only 3 networks are used.**
114
115 Bare Metal Node Requirements
116 ----------------------------
117
118 Bare metal nodes require:
119
120 1.     IPMI enabled on OOB interface for power control.
121
122 2.     BIOS boot priority should be PXE first then local hard disk.
123
124 3.     BIOS PXE interface should include admin network mentioned above.
125
126 Execution Requirements (Bare Metal Only)
127 ----------------------------------------
128
129 In order to execute a deployment, one must gather the following information:
130
131 1.     IPMI IP addresses for the nodes.
132
133 2.     IPMI login information for the nodes (user/pass).
134
135 3.     MAC address of admin interfaces on nodes.
136
137 4.     MAC address of private interfaces on 3 nodes that will be controllers.
138
139 **Note: For single NIC/network barmetal deployment, the MAC address of the admin and private
140 interface will be the same.**
141
142 Installation High-Level Overview - Bare Metal Deployment
143 ========================================================
144
145 The setup presumes that you have 6 bare metal servers and have already setup connectivity on at least
146 1 or 3 interfaces for all servers via a TOR switch or other network implementation.
147
148 The physical TOR switches are **not** automatically configured from the OPNFV reference platform. All
149 the networks involved in the OPNFV infrastructure as well as the provider networks and the private
150 tenant VLANs needs to be manually configured.
151
152 The Jumphost can be installed using the bootable ISO.  The Jumphost should then be configured with an
153 IP gateway on its admin or public interface and configured with a working DNS server.  The Jumphost
154 should also have routable access to the lights out network.
155
156 ``deploy.sh`` is then executed in order to install the Foreman/QuickStack Vagrant VM.  ``deploy.sh``
157 uses a configuration file with YAML format in order to know how to install and provision the OPNFV
158 target system.  The information gathered under section `Execution Requirements (Bare Metal Only)`_
159 is put into this configuration file.
160
161 ``deploy.sh`` brings up a CentOS 7 Vagrant VM, provided by VirtualBox.  The VM then executes an
162 Ansible project called Khaleesi in order to install Foreman and QuickStack.  Once the
163 Foreman/QuickStack VM is up, Foreman will be configured with the nodes' information.  This includes
164 MAC address, IPMI, OpenStack type (controller, compute, OpenDaylight controller) and other information.
165 At this point Khaleesi makes a REST API call to Foreman to instruct it to provision the hardware.
166
167 Foreman will then reboot the nodes via IPMI.  The nodes should already be set to PXE boot first off the
168 admin interface.  Foreman will then allow the nodes to PXE and install CentOS 7 as well as Puppet.
169 Foreman/QuickStack VM server runs a Puppet Master and the nodes query this master to get their
170 appropriate OPNFV configuration.  The nodes will then reboot one more time and once back up, will DHCP
171 on their private, public and storage NICs to gain IP addresses.  The nodes will now check in via
172 Puppet and start installing OPNFV.
173
174 Khaleesi will wait until these nodes are fully provisioned and then return a success or failure based
175 on the outcome of the Puppet application.
176
177 Installation High-Level Overview - VM Deployment
178 ================================================
179
180 The VM nodes deployment operates almost the same way as the bare metal deployment with a few
181 differences.  ``deploy.sh`` still installs Foreman/QuickStack VM the exact same way, however the part
182 of the Khaleesi Ansible playbook which IPMI reboots/PXE boots the servers is ignored.  Instead,
183 ``deploy.sh`` brings up N number more Vagrant VMs (where N is 3 control nodes + n compute).  These VMs
184 already come up with CentOS 7 so instead of re-provisioning the entire VM, ``deploy.sh`` initiates a
185 small Bash script that will signal to Foreman that those nodes are built and install/configure Puppet
186 on them.
187
188 To Foreman these nodes look like they have just built and register the same way as bare metal nodes.
189
190 VM deployment will automatically use the default gateway interface on the host for all of the VMs
191 internet access via bridging the VMs NICs (public network).  The other networks - such as admin,
192 private, storage will all be created as internal VirtualBox networks.  Therefore only a single
193 interface on the host is needed for VM deployment.
194
195 Installation Guide - Bare Metal Deployment
196 ==========================================
197
198 This section goes step-by-step on how to correctly install and provision the OPNFV target system to
199 bare metal nodes.
200
201 Install Bare Metal Jumphost
202 ---------------------------
203
204 1.  If your Jumphost does not have CentOS 7 already on it, or you would like to do a fresh install,
205 then download the Foreman/QuickStack bootable ISO
206 <http://artifacts.opnfv.org/arno.2015.2.0/foreman/arno.2015.2.0.foreman.iso> here.  If you already
207 have a CentOS 7 install that you would like to use then go to step 3.
208
209 2.  Boot the ISO off of a USB or other installation media and walk through installing OPNFV CentOS 7.
210
211 3.  After OS is installed login to your Jumphost as root.  If /root/genesis does not exist then
212 ``git clone -b arno.2015.2.0 https://gerrit.opnfv.org/gerrit/genesis /root/genesis``
213
214 4.  Configure IP addresses on 3-4 interfaces that you have selected as your admin, private, public,
215 and storage (optional) networks.
216
217 5.  Configure the IP gateway to the Internet either, preferably on the public interface.
218
219 6.  Configure your ``/etc/resolv.conf`` to point to a DNS server (8.8.8.8 is provided by Google).
220
221 7.  Disable selinux:
222
223     - ``setenforce 0``
224     - ``sed -i 's/SELINUX=.*/SELINUX=permissive/' /etc/selinux/config``
225
226 8.  Disable firewalld:
227
228     - ``systemctl stop firewalld``
229     - ``systemctl disable firewalld``
230
231 Creating an Inventory File
232 --------------------------
233
234 You now need to take the MAC address/IPMI info gathered in section
235 `Execution Requirements (Bare Metal Only)`_ and create the YAML inventory (also known as configuration)
236 file for ``deploy.sh``.
237
238 1.  Copy the ``opnfv_ksgen_settings.yml`` file (for HA) or ``opnfv_ksgen_settings_no_HA.yml`` from
239 ``/root/genesis/foreman/ci/`` to another directory and rename it to be what you want Example:
240 ``/root/my_ksgen_settings.yml``
241
242 2.  Edit the file in your favorite editor.  There is a lot of information in this file, but you
243 really only need to be concerned with the "nodes:" dictionary.
244
245 3.  The nodes dictionary contains each bare metal host you want to deploy.  You can have 1 or more
246 compute nodes and must have 3 controller nodes (these are already defined for you) if ha_flag is set
247 to true.  If ha_flag is set to false, please only define 1 controller node.  It is optional at this
248 point to add more compute nodes into the dictionary.  You must use a different name, hostname,
249 short_name and dictionary keyname for each node.
250
251 4.  Once you have decided on your node definitions you now need to modify the MAC address/IPMI info
252 dependent on your hardware.  Edit the following values for each node:
253
254     - ``mac_address``: change to MAC address of that node's admin NIC (defaults to 1st NIC)
255     - ``bmc_ip``: change to IP Address of BMC (out-of-band)/IPMI IP
256     - ``bmc_mac``: same as above, but MAC address
257     - ``bmc_user``: IPMI username
258     - ``bmc_pass``: IPMI password
259
260 5.  Also edit the following for only controller nodes:
261
262     - ``private_mac`` - change to MAC address of node's private NIC (default to 2nd NIC)
263
264 6.  You may also define a unique domain name by editing the ``domain_name`` global parameter.
265
266 7.  Save your changes.
267
268 Running ``deploy.sh``
269 ---------------------
270
271 You are now ready to deploy OPNFV!  ``deploy.sh`` will use your ``/var/opt/opnfv/`` directory to store
272 its Vagrant VMs.  Your Foreman/QuickStack Vagrant VM will be running out of
273 ``/var/opt/opnfv/foreman_vm/``.
274
275 It is also recommended that you power off your nodes before running ``deploy.sh``  If there are DHCP
276 servers or other network services that are on those nodes it may conflict with the installation.
277
278 Follow the steps below to execute:
279
280 1.  ``cd /root/genesis/foreman/ci/``
281
282 2.  ``./deploy.sh -base_config /root/my_ksgen_settings.yml``
283
284 **Note:  This is for default detection of at least 3 VLAN/interfaces configured on your jumphost
285 with defaulting interface assignment by the NIC order (1st Admin, 2nd Private, 3rd Public).  If you
286 wish to use a single interface for baremetal install, see help output for "-single_baremetal_nic".
287 If you would like to specify the NIC mapping to logical network, see help output for "-admin_nic",
288 "-private_nic", "-public_nic", "-storage_nic".**
289
290 3.  It will take about 20-25 minutes to install Foreman/QuickStack VM.  If something goes wrong during
291 this part of the process, it is most likely a problem with the setup of your Jumphost.  You will also
292 notice different outputs in your shell.  When you see messages that say "TASK:" or "PLAY:" this is
293 Khalessi running and installing Foreman/QuickStack inside of your VM or deploying your nodes.  Look
294 for "PLAY [Deploy Nodes]" as a sign that Foreman/QuickStack is finished installing and now your nodes
295 are being rebuilt.
296
297 4.  Your nodes will take 40-60 minutes to re-install CentOS 7 and install/configure OPNFV.  When
298 complete you will see "Finished: SUCCESS"
299
300 Verifying the Setup
301 -------------------
302
303 Now that the installer has finished it is a good idea to check and make sure things are working
304 correctly.  To access your Foreman/QuickStack VM:
305
306 1.  ``cd /var/opt/opnfv/foreman_vm/``
307
308 2.  ``vagrant ssh`` (password is "vagrant")
309
310 3.  You are now in the VM and can check the status of Foreman service, etc.  For example:
311 ``systemctl status foreman``
312
313 4.  Type "exit" and leave the Vagrant VM.  Now execute:
314 ``cat /var/opt/opnfv/foreman_vm/opnfv_ksgen_settings.yml | grep foreman_url``
315
316 5.  This is your Foreman URL on your public interface.  You can go to your web browser,
317 ``http://<foreman_ip>``, login will be "admin"/"octopus".  This way you can look around in Foreman and
318 check that your hosts are in a good state, etc.
319
320 6.  In Foreman GUI, you can now go to Infrastructure -> Global Parameters.  This is a list of all the
321 variables being handed to Puppet for configuring OPNFV.  Look for ``horizon_public_vip``.  This is
322 your IP address to Horizon GUI.
323
324 **Note: You can find out more about how to use Foreman by going to http://www.theforeman.org/ or
325 by watching a walkthrough video here: https://bluejeans.com/s/89gb/**
326
327 7.  Now go to your web browser and insert the Horizon public VIP.  The login will be "admin"/"octopus".
328
329 8.  You are now able to follow the `OpenStack Verification`_ section.
330
331 OpenStack Verification
332 ----------------------
333
334 Now that you have Horizon access, let's make sure OpenStack the OPNFV target system are working
335 correctly:
336
337 1.  In Horizon, click Project -> Compute -> Volumes, Create Volume
338
339 2.  Make a volume "test_volume" of size 1 GB
340
341 3.  Now in the left pane, click Compute -> Images, click Create Image
342
343 4.  Insert a name "cirros", Insert an Image Location
344 ``http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img``
345
346 5.  Select format "QCOW2", select Public, then hit Create Image
347
348 6.  Now click Project -> Network -> Networks, click Create Network
349
350 7.  Enter a name "test_network", click Next
351
352 8.  Enter a subnet name "test_subnet", and enter Network Address ``10.0.0.0/24``, click Next
353
354 9.  Enter ``10.0.0.5,10.0.0.9`` under Allocation Pools, then hit Create
355
356 **Note: You may also want to expand this pool by giving a larger range,
357 or you can simply hit Create with entering nothing and the entire subnet
358 range will be used for DHCP**
359
360 10. Go to Project -> Network -> Routers
361
362 11. Click "provider_router".  Then select "Add Interface"
363
364 12. From the pop up menu, select test_subnet in the "Subnet" field.  Press "Add interface"
365
366 13. Verify your Network Topology looks correct in Project -> Network -> Network Topology
367
368 14. Now go to Project -> Compute -> Instances, click Launch Instance
369
370 15. Enter Instance Name "cirros1", select Instance Boot Source "Boot from image", and then select
371 Image Name "cirros"
372
373 16. Click Launch, status should show "Spawning" while it is being built
374
375 17. You can now repeat steps 15 and 16, but create a "cirros2" named instance
376
377 18. Once both instances are up you can see their IP addresses on the Instances page.  Click the
378 Instance Name of cirros1.
379
380 19. Now click the "Console" tab and login as "cirros"/"cubswin:)"
381
382 20. Verify you can ping the IP address of cirros2
383
384 21. Continue to the next steps to provide external network access to cirros1.
385
386 22. Go to Project -> Compute -> Instances.  From the drop down menu under "Actions" select
387 "Associate Floating IP"
388
389 23. Press the "+" symbol next under "IP Address".  Select "Allocate IP" on the new pop up.
390
391 24. You should now see an external IP address filled into the "IP Address" field.  Click
392 "Associate".
393
394 25. Now from your external network you should be able to ping/ssh to the floating IP address.
395
396 Congratulations you have successfully installed OPNFV!
397
398 Installation Guide - VM Deployment
399 ==================================
400
401 This section goes step-by-step on how to correctly install and provision the OPNFV target system
402 to VM nodes.
403
404 Install Jumphost
405 ----------------
406
407 Follow the instructions in the `Install Bare Metal Jumphost`_ section, except that you only need 1
408 network interface on the host system with internet connectivity.
409
410 Creating an Inventory File
411 --------------------------
412
413 It is optional to create an inventory file for virtual deployments.  Since the nodes are virtual you
414 are welcome to use the provided opnfv_ksgen_settings files.  You may also elect to customize your
415 deployment.  Those options include modifying domain name of your deployment as well as allocating
416 specific resources per node.
417
418 Modifying VM resources is necessary for bigger virtual deployments in order to run more nova
419 instances.  To modify these resources you can edit each of the follow node paramters in the
420 Inventory file:
421
422 1.  memory - set in KiB
423
424 2.  cpus - number of vcpus to allocate to this VM
425
426 3.  disk - size in GB (cannot be less than 40)
427
428 Running ``deploy.sh``
429 ---------------------
430
431 You are now ready to deploy OPNFV!  ``deploy.sh`` will use your ``/var/opt/opnfv/`` directory to store
432 its Vagrant VMs.  Your Foreman/QuickStack Vagrant VM will run out of ``/var/opt/opnfv/foreman_vm/``.
433 Your compute and subsequent controller nodes will run in:
434
435 - ``/var/opt/opnfv/compute``
436 - ``/var/opt/opnfv/controller1``
437 - ``/var/opt/opnfv/controller2``
438 - ``/var/opt/opnfv/controller3``
439
440 Each VM will be brought up and bridged to your Jumphost NIC for the public network.  ``deploy.sh`` will
441 first bring up your Foreman/QuickStack Vagrant VM and afterwards it will bring up each of the nodes
442 listed above, in order of controllers first.
443
444 Follow the steps below to execute:
445
446 1.  ``cd /root/genesis/foreman/ci/``
447
448 2.  ``./deploy.sh -virtual -static_ip_range <your_range>``, Where <your_range> is a range of at least
449 20 IP addresses (non-HA you need only 5) that are useable on your public subnet.
450 ``Ex: -static_ip_range 192.168.1.101,192.168.1.120``
451
452 **Note: You may also wish to use other options like manually selecting the NIC to be used on your host,
453 etc.  Please use ``deploy.sh -h`` to see a full list of options available.**
454
455 3.  It will take about 20-25 minutes to install Foreman/QuickStack VM.  If something goes wrong during
456 this part of the process, it is most likely a problem with the setup of your Jumphost.  You will also
457 notice different outputs in your shell.  When you see messages that say "TASK:" or "PLAY:" this is
458 Khalessi running and installing Foreman/QuickStack inside of your VM or deploying your nodes.  When
459 you see "Foreman is up!", that means deploy will now move on to bringing up your other nodes.
460
461 4.  ``deploy.sh`` will now bring up your other nodes, look for logging messages like "Starting Vagrant
462 Node <node name>", "<node name> VM is up!"  These are indicators of how far along in the process you
463 are.  ``deploy.sh`` will start each Vagrant VM, then run provisioning scripts to inform Foreman they
464 are built and initiate Puppet.
465
466 5.  The speed at which nodes are provisioned is totally dependent on your Jumphost server specs.  When
467 complete you will see "All VMs are UP!"
468
469 6.  The deploy will then print out the URL for your foreman server as well as the URL to access horizon.
470
471 Verifying the Setup - VMs
472 -------------------------
473
474 Follow the instructions in the `Verifying the Setup`_ section.
475
476 Also, for VM deployment you are able to easily access your nodes by going to
477 ``/var/opt/opnfv/<node name>`` and then ``vagrant ssh`` (password is "vagrant").  You can use this to
478 go to a controller and check OpenStack services, OpenDaylight, etc.
479
480 OpenStack Verification - VMs
481 ----------------------------
482
483 Follow the steps in `OpenStack Verification`_ section.
484
485 Frequently Asked Questions
486 ==========================
487
488 Please see the `Arno FAQ <https://wiki.opnfv.org/releases/arno/faq>`_.
489
490 License
491 =======
492
493 All Foreman/QuickStack and "common" entities are protected by the
494 `Apache 2.0 License <http://www.apache.org/licenses/>`_.
495
496 References
497 ==========
498
499 OPNFV
500 -----
501
502 `OPNFV Home Page <www.opnfv.org>`_
503
504 `OPNFV Genesis project page <https://wiki.opnfv.org/get_started>`_
505
506 OpenStack
507 ---------
508
509 `OpenStack Juno Release artifacts <http://www.openstack.org/software/juno>`_
510
511 `OpenStack documentation <http://docs.openstack.org>`_
512
513 OpenDaylight
514 ------------
515
516 Upstream OpenDaylight provides `a number of packaging and deployment options
517 <https://wiki.opendaylight.org/view/Deployment>`_ meant for consumption by downstream projects like
518 OPNFV.
519
520 Currently, OPNFV Foreman uses `OpenDaylight's Puppet module
521 <https://github.com/dfarrell07/puppet-opendaylight>`_, which in turn depends on `OpenDaylight's RPM
522 <https://github.com/opendaylight/integration-packaging/tree/master/rpm>`_ hosted on the `CentOS Community
523 Build System <http://cbs.centos.org/repos/nfv7-opendaylight-2-candidate/x86_64/os/Packages/>`_.
524
525 Foreman
526 -------
527
528 `Foreman documentation <http://theforeman.org/documentation.html>`_
529
530 :Authors: Tim Rozet (trozet@redhat.com)
531 :Version: 0.2.0
532
533 **Documentation tracking**
534
535 Revision: _sha1_
536
537 Build date:  _date_
538