summaryrefslogtreecommitdiffstats
path: root/docs/release/installation/installation_baremetal.rst
blob: ff4e6e53640a4914f6e0085e4b48aae05e6c5a07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
.. highlight:: bash


Bare Metal Installation
=======================
Before proceeding, make sure that your hardware infrastructure satisfies the
:ref:`setup-requirements`.


Networking
----------
Make sure you have at least two networks configured:

1.  *Admin* (management) network with gateway to access the Internet (for
    downloading installation resources).
2.*public/floating* network to consume by tenants for floating IPs.

You may configure other networks, e.g. for data or storage, based on your
network options for Openstack.


.. _jumphost-install-os:

Jumphost installation and configuration
---------------------------------------

1.  Install Ubuntu 16.04 (Xenial) LTS server on Jumphost (one of the physical
    nodes).

    .. tip::
        Use ``ubuntu`` as username as password, as this matches the MAAS
        credentials installed later.

        During the OS installation, install the OpenSSH server package to
        allow SSH connections to the Jumphost.

        If the data size of the image is too big or slow (e.g. when mounted
        through a slow virtual console), you can also use the Ubuntu mini ISO.
        Install packages: standard system utilities, basic Ubuntu server,
        OpenSSH server, Virtual Machine host.

        If you have issues with blank console after booting, see
        `this SO answer <https://askubuntu.com/a/38782>`_ and set
        ``nomodeset``, (removing ``quiet splash`` can also be useful to see log
        during booting) either through console in recovery mode or via SSH (if
        installed).

2.  Install git and bridge-utils packages

    ::

       sudo apt install git bridge-utils

3.  Configure bridges for each network to be used.

    Example ``/etc/network/interfaces`` file:

    ::

        source /etc/network/interfaces.d/*

        # The loopback network interface (set by Ubuntu)
        auto lo
        iface lo inet loopback

        # Admin network interface
        iface eth0 inet manual
        auto brAdmin
        iface brAdmin inet static
                bridge_ports eth0
                address 10.5.1.1
                netmask 255.255.255.0

        # Ext. network for floating IPs
        iface eth1 inet manual
        auto brExt
        iface brExt inet static
                bridge_ports eth1
                address 10.5.15.1
                netmask 255.255.255.0

    ..

    .. note::
        If you choose to use the separate network for management, public, data
        and storage, then you need to create bridge for each interface. In case
        of VLAN tags, use the appropriate network on Jumphost depending on the
        VLAN ID on the interface.


Configure JOID for your lab
---------------------------

All configuration for the JOID deployment is specified in a ``labconfig.yaml``
file. Here you describe all your physical nodes, their roles in OpenStack,
their network interfaces, IPMI parameters etc. It's also where you configure
your OPNFV deployment and MAAS networks/spaces.
You can find example configuration files from already existing nodes in the
`repository <https://gerrit.opnfv.org/gerrit/gitweb?p=joid.git;a=tree;f=labconfig>`_.

First of all, download JOID to your Jumphost. We recommend doing this in your
home directory.

::

      git clone https://gerrit.opnfv.org/gerrit/p/joid.git

.. tip::
    You can select the stable version of your choice by specifying the git
    branch, for example:

    ::

        git clone -b stable/danube https://gerrit.opnfv.org/gerrit/p/joid.git

Create a directory in ``joid/labconfig/<company_name>/<pod_number>/`` and
create or copy a ``labconfig.yaml`` configuration file to that directory.
For example:

::

    # All JOID actions are done from the joid/ci directory
    cd joid/ci
    mkdir -p ../labconfig/your_company/pod1
    cp ../labconfig/nokia/pod1/labconfig.yaml ../labconfig/your_company/pod1/

Example ``labconfig.yaml`` configuration file:

::

    lab:
      location: your_company
      racks:
      - rack: pod1
        nodes:
        - name: rack-1-m1
          architecture: x86_64
          roles: [network,control]
          nics:
          - ifname: eth0
            spaces: [admin]
            mac: ["12:34:56:78:9a:bc"]
          - ifname: eth1
            spaces: [floating]
            mac: ["12:34:56:78:9a:bd"]
          power:
            type: ipmi
            address: 192.168.10.101
            user: admin
            pass: admin
        - name: rack-1-m2
          architecture: x86_64
          roles: [compute,control,storage]
          nics:
          - ifname: eth0
            spaces: [admin]
            mac: ["23:45:67:89:ab:cd"]
          - ifname: eth1
            spaces: [floating]
            mac: ["23:45:67:89:ab:ce"]
          power:
            type: ipmi
            address: 192.168.10.102
            user: admin
            pass: admin
        - name: rack-1-m3
          architecture: x86_64
          roles: [compute,control,storage]
          nics:
          - ifname: eth0
            spaces: [admin]
            mac: ["34:56:78:9a:bc:de"]
          - ifname: eth1
            spaces: [floating]
            mac: ["34:56:78:9a:bc:df"]
          power:
            type: ipmi
            address: 192.168.10.103
            user: admin
            pass: admin
        - name: rack-1-m4
          architecture: x86_64
          roles: [compute,storage]
          nics:
          - ifname: eth0
            spaces: [admin]
            mac: ["45:67:89:ab:cd:ef"]
          - ifname: eth1
            spaces: [floating]
            mac: ["45:67:89:ab:ce:f0"]
          power:
            type: ipmi
            address: 192.168.10.104
            user: admin
            pass: admin
        - name: rack-1-m5
          architecture: x86_64
          roles: [compute,storage]
          nics:
          - ifname: eth0
            spaces: [admin]
            mac: ["56:78:9a:bc:de:f0"]
          - ifname: eth1
            spaces: [floating]
            mac: ["56:78:9a:bc:df:f1"]
          power:
            type: ipmi
            address: 192.168.10.105
            user: admin
            pass: admin
        floating-ip-range: 10.5.15.6,10.5.15.250,10.5.15.254,10.5.15.0/24
        ext-port: "eth1"
        dns: 8.8.8.8
    opnfv:
        release: d
        distro: xenial
        type: noha
        openstack: ocata
        sdncontroller:
        - type: nosdn
        storage:
        - type: ceph
          disk: /dev/sdb
        feature: odl_l2
        spaces:
        - type: admin
          bridge: brAdmin
          cidr: 10.5.1.0/24
          gateway:
          vlan:
        - type: floating
          bridge: brExt
          cidr: 10.5.15.0/24
          gateway: 10.5.15.1
          vlan:

.. TODO: Details about the labconfig.yaml file

Once you have prepared the configuration file, you may begin with the automatic
MAAS deployment.

MAAS Install
------------

This section will guide you through the MAAS deployment. This is the first of
two JOID deployment steps.

.. note::
    For all the commands in this document, please do not use a ``root`` user
    account to run but instead use a non-root user account. We recommend using
    the ``ubuntu`` user as described above.

    If you have already enabled maas for your environment and installed it then
    there is no need to enabled it again or install it. If you have patches
    from previous MAAS install, then you can apply them here.

    Pre-installed MAAS without using the ``03-maasdeploy.sh`` script is not
    supported. We strongly suggest to use ``03-maasdeploy.sh`` script to deploy
    the MAAS and JuJu environment.

With the ``labconfig.yaml`` configuration file ready, you can start the MAAS
deployment. In the joid/ci directory, run the following command:

::

    # in joid/ci directory
    ./03-maasdeploy.sh custom <absolute path of config>/labconfig.yaml

..

If you prefer, you can also host your ``labconfig.yaml`` file remotely and JOID
will download it from there. Just run

::

    # in joid/ci directory
    ./03-maasdeploy.sh custom http://<web_site_location>/labconfig.yaml

..

This step will take approximately 30 minutes to a couple of hours depending on
your environment.
This script will do the following:

*   If this is your first time running this script, it will download all the
    required packages.
*   Install MAAS on the Jumphost.
*   Configure MAAS to enlist and commission a VM for Juju bootstrap node.
*   Configure MAAS to enlist and commission bare metal servers.
*   Download and load Ubuntu server images to be used by MAAS.

Already during deployment, once MAAS is installed, configured and launched,
you can visit the MAAS Web UI and observe the progress of the deployment.
Simply open the IP of your jumphost in a web browser and navigate to the
``/MAAS`` directory (e.g. ``http://10.5.1.1/MAAS`` in our example). You can
login with username ``ubuntu`` and password ``ubuntu``. In the *Nodes* page,
you can see the bootstrap node and the bare metal servers and their status.

.. hint::
    If you need to re-run this step, first undo the performed actions by
    running

    ::

        # in joid/ci
        ./cleanvm.sh
        ./cleanmaas.sh
        # now you can run the ./03-maasdeploy.sh script again

    ..


Juju Install
------------

This section will guide you through the Juju an OPNFV deployment. This is the
second of two JOID deployment steps.

JOID allows you to deploy different combinations of OpenStack and SDN solutions
in HA or no-HA mode. For OpenStack, it supports Newton and Ocata. For SDN, it
supports Open vSwitch, OpenContrail, OpenDaylight and ONOS (Open Network
Operating System). In addition to HA or no-HA mode, it also supports deploying
the latest from the development tree (tip).

To deploy OPNFV on the previously deployed MAAS system, use the ``deploy.sh``
script. For example:

::

    # in joid/ci directory
    ./deploy.sh -d xenial -m openstack -o ocata -s nosdn -f none -t noha -l custom

The above command starts an OPNFV deployment with Ubuntu Xenial (16.04) distro,
OpenStack model, Ocata version of OpenStack, Open vSwitch (and no other SDN),
no special features, no-HA OpenStack mode and with custom labconfig. I.e. this
corresponds to the ``os-nosdn-nofeature-noha`` OPNFV deployment scenario.

.. note::
    You can see the usage info of the script by running

    ::

        ./deploy.sh --help

    Possible script arguments are as follows.

    **Ubuntu distro to deploy**
    ::

        [-d <trusty|xenial>]

    -   ``trusty``: Ubuntu 16.04.
    -   ``xenial``: Ubuntu 17.04.

    **Model to deploy**
    ::

        [-m <openstack|kubernetes>]

    JOID introduces two various models to deploy.

    -   ``openstack``:  Openstack, which will be used for KVM/LXD
        container-based workloads.
    -   ``kubernetes``: Kubernetes model will be used for docker-based
        workloads.

    **Version of Openstack deployed**
    ::

        [-o <newton|mitaka>]

    -   ``newton``: Newton version of OpenStack.
    -   ``ocata``:  Ocata version of OpenStack.

    **SDN controller**
    ::

        [-s <nosdn|odl|opencontrail|onos>]

    -   ``nosdn``:        Open vSwitch only and no other SDN.
    -   ``odl``:          OpenDayLight Boron version.
    -   ``opencontrail``: OpenContrail SDN.
    -   ``onos``:         ONOS framework as SDN.

    **Feature to deploy** (comma separated list)
    ::

        [-f <lxd|dvr|sfc|dpdk|ipv6|none>]

    -   ``none``: No special feature will be enabled.
    -   ``ipv6``: IPv6 will be enabled for tenant in OpenStack.
    -   ``lxd``:  With this feature hypervisor will be LXD rather than KVM.
    -   ``dvr``:  Will enable distributed virtual routing.
    -   ``dpdk``: Will enable DPDK feature.
    -   ``sfc``:  Will enable sfc feature only supported with ONOS deployment.
    -   ``lb``:   Load balancing in case of Kubernetes will be enabled.

    **Mode of Openstack deployed**
    ::

        [-t <noha|ha|tip>]

    -   ``noha``: No High Availability.
    -   ``ha``:   High Availability.
    -   ``tip``:  The latest from the development tree.

    **Where to deploy**
    ::

        [-l <custom|default|...>]

    -   ``custom``: For bare metal deployment where labconfig.yaml was provided
        externally and not part of JOID package.
    -   ``default``: For virtual deployment where installation will be done on
        KVM created using ``03-maasdeploy.sh``.

    **Architecture**
    ::

        [-a <amd64|ppc64el|aarch64>]

    -   ``amd64``: Only x86 architecture will be used. Future version will
        support arm64 as well.

This step may take up to a couple of hours, depending on your configuration,
internet connectivity etc. You can check the status of the deployment by
running this command in another terminal:

::

    watch juju status --format tabular


.. hint::
    If you need to re-run this step, first undo the performed actions by
    running
    ::

        # in joid/ci
        ./clean.sh
        # now you can run the ./deploy.sh script again

    ..


OPNFV Scenarios in JOID
-----------------------
Following OPNFV scenarios can be deployed using JOID. Separate yaml bundle will
be created to deploy the individual scenario.

======================= ======= ===============================================
Scenario                Owner   Known Issues
======================= ======= ===============================================
os-nosdn-nofeature-ha   Joid
os-nosdn-nofeature-noha Joid
os-odl_l2-nofeature-ha  Joid    Floating ips are not working on this deployment.
os-nosdn-lxd-ha         Joid    Yardstick team is working to support.
os-nosdn-lxd-noha       Joid    Yardstick team is working to support.
os-onos-nofeature-ha    ONOSFW
os-onos-sfc-ha          ONOSFW
k8-nosdn-nofeature-noha Joid    No support from Functest and Yardstick
k8-nosdn-lb-noha        Joid    No support from Functest and Yardstick
======================= ======= ===============================================


.. _troubleshooting:

Troubleshoot
------------
By default debug is enabled in script and error messages will be printed on ssh
terminal where you are running the scripts.

Logs are indispensable when it comes time to troubleshoot. If you want to see
all the service unit deployment logs, you can run ``juju debug-log`` in another
terminal. The debug-log command shows the consolidated logs of all Juju agents
(machine and unit logs) running in the environment.

To view a single service unit deployment log, use ``juju ssh`` to access to the
deployed unit. For example to login into ``nova-compute`` unit and look for
``/var/log/juju/unit-nova-compute-0.log`` for more info:

::

  ubuntu@R4N4B1:~$ juju ssh nova-compute/0
  Warning: Permanently added '172.16.50.60' (ECDSA) to the list of known hosts.
  Warning: Permanently added '3-r4n3b1-compute.maas' (ECDSA) to the list of known hosts.
  Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 3.13.0-77-generic x86_64)

  * Documentation:  https://help.ubuntu.com/
  <skipped>
  Last login: Tue Feb  2 21:23:56 2016 from bootstrap.maas
  ubuntu@3-R4N3B1-compute:~$ sudo -i
  root@3-R4N3B1-compute:~# cd /var/log/juju/
  root@3-R4N3B1-compute:/var/log/juju# ls
  machine-2.log  unit-ceilometer-agent-0.log  unit-ceph-osd-0.log  unit-neutron-contrail-0.log  unit-nodes-compute-0.log  unit-nova-compute-0.log  unit-ntp-0.log
  root@3-R4N3B1-compute:/var/log/juju#

.. note::
    By default Juju will add the Ubuntu user keys for authentication into the
    deployed server and only ssh access will be available.

Once you resolve the error, go back to the jump host to rerun the charm hook
with

::

  $ juju resolved --retry <unit>

If you would like to start over, run
``juju destroy-environment <environment name>`` to release the resources, then
you can run ``deploy.sh`` again.

To access of any of the nodes or containers, use

::

    juju ssh <service name>/<instance id>

For example:

::

    juju ssh openstack-dashboard/0
    juju ssh nova-compute/0
    juju ssh neutron-gateway/0

You can see the available nodes and containers by running

::

    juju status

All charm log files are available under ``/var/log/juju``.

-----

If you have questions, you can join the JOID channel ``#opnfv-joid`` on
`Freenode <https://webchat.freenode.net/>`_.


Common Issues
-------------

The following are the common issues we have collected from the community:

-   The right variables are not passed as part of the deployment procedure.

    ::

        ./deploy.sh -o newton -s nosdn -t ha -l custom -f none

-   If you have not setup MAAS with ``03-maasdeploy.sh`` then the
    ``./clean.sh`` command could hang, the ``juju status`` command may hang
    because the correct MAAS API keys are not mentioned in cloud listing for
    MAAS.

    _Solution_: Please make sure you have an MAAS cloud listed using juju
    clouds and the correct MAAS API key has been added.
-   Deployment times out: use the command ``juju status`` and make sure all
    service containers receive an IP address and they are executing code.
    Ensure there is no service in the error state.
-   In case the cleanup process hangs,run the juju destroy-model command
    manually.

**Direct console access** via the OpenStack GUI can be quite helpful if you
need to login to a VM but cannot get to it over the network.
It can be enabled by setting the ``console-access-protocol`` in the
``nova-cloud-controller`` to ``vnc``. One option is to directly edit the
``juju-deployer`` bundle and set it there prior to deploying OpenStack.

::

    nova-cloud-controller:
      options:
        console-access-protocol: vnc

To access the console, just click on the instance in the OpenStack GUI and
select the Console tab.



.. Links:
.. _`Ubuntu download`: https://www.ubuntu.com/download/server