summaryrefslogtreecommitdiffstats
path: root/book-enea-nfv-core-installation-guide/doc/post_deploy_scripts.xml
blob: c4668e444602e2faf46714dd9c6ba61c9cf3740c (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
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<chapter id="post_dep_scripts">
  <title>Post Deploy Scripts</title>

  <para>The Post Deploy Scripts is a collection of ENEA specific software that
  can be used to easily modify existing environments. These projects can be
  used in many situations, from installing new components to configuring
  existing ones in a fast and efficient way. They are located on the Fuel
  Master in <literal>/opt/enea/postdeployscripts/</literal>.</para>

  <section id="provider_net">
    <title>Post Deploy Provider Networks</title>

    <para>OpenStack Networking allows you to create and manage network objects
    such as networks, subnets, and ports, which other OpenStack services can
    use.</para>

    <para>Provider networks offer layer-2 connectivity to instances, with
    optional support for DHCP and metadata services. These networks connect or
    map, to existing layer-2 networks within the data center, typically using
    VLAN (802.1q) tagging to identify and separate them. Provider networks
    generally offer simplicity, performance, and reliability at the cost of
    flexibility.</para>

    <note>
      <para>Provider networks only handle layer-2 connectivity for instances,
      lacking support for features such as routers and floating IP addresses.
      Please refer to the <ulink
      url="https://docs.openstack.org/ocata/install-guide-ubuntu/launch-instance-networks-provider.html">Openstack
      documentation</ulink> for examples on using provider networks.</para>
    </note>

    <para>In the example provided here, an instance uses a provider (external)
    network that connects to the physical network infrastructure via layer-2
    (bridging/switching). This network includes a DHCP server that provides IP
    addresses to instances.</para>

    <mediaobject>
      <imageobject role="fo">
        <imagedata align="center" contentwidth="600"
                   fileref="images/network1-overview.svg" />
      </imageobject>

      <imageobject role="html">
        <imagedata align="center" fileref="images/network1-overview.png" />
      </imageobject>
    </mediaobject>

    <para>DPDK acceleration is automatically enabled based on the setting of
    the Private Network in Fuel (<link
    linkend="allocate_nodes_assign_roles">See chapter 2.13, bullet 4 -
    Configure Compute nodes interfaces</link>).</para>

    <para>If DPDK is enabled on one of the nodes, the playbook will configure
    the interface connected to the provider network as type
    <literal>DPDKOVSPort</literal>. Otherwise the interface will be configured
    as type <literal>OVSPort</literal>. You can check the port type by looking
    at the configuration files in <literal>/etc/network/interfaces.d</literal>
    on the corresponding node.</para>

    <para>For best results, it is recommended to run this playbook right after
    the deployment process has completed successfully. It can also be run at a
    later time, but in this case it is best to leave the neutron and
    OpenVSwitch configuration untouched.</para>

    <para><emphasis role="bold">How to run the Provider Networks
    Playbook</emphasis></para>

    <orderedlist>
      <listitem>
        <para>Log into the Fuel master.</para>
      </listitem>

      <listitem>
        <para>Install Ansible: <programlisting>yum install ansible</programlisting></para>
      </listitem>

      <listitem>
        <para>Run the initialization script:<programlisting>cd /opt/enea/postdeployscripts/provider-net
./init.sh</programlisting></para>

        <para>This will create a hosts file that will be used by Ansible to
        associate the nodes into groups and to access them. </para>

        <para>It will also create a file named
        <filename>samplenetworks.json</filename>, which will contain a single
        network in which all nodes (computes and controllers) are plugged in.
        The <filename>samplenetworks.json</filename> file will have the
        following content:<programlisting>   {
    "networks": [
        {
            "name": "prov-net",
            "nodes": [
                {
                    "interfaces": [],
                    "name": "node-1"
                },
                [...] # all other controller and compute nodes: node-X
                ]
        }
   }</programlisting></para>

        <note>
          <para>The interface list is empty and has to be populated by the
          user. If the interface lists are left empty the node will simply not
          be processed, though the script/playbook will attempt to perform
          certain checks.</para>
        </note>
      </listitem>

      <listitem>
        <para>Populate the <filename>networks.json</filename> file (located in
        <literal>/opt/enea/postdeployscripts/provider-net/files/networks.json</literal>).</para>

        <para>The <filename>networks.json</filename> file will be used in the
        playbook to map the interfaces on the nodes to the corresponding
        provider networks to which they are connected. The
        <filename>samplenetworks.json</filename> file generated during step 3
        can be used as a base for this file.</para>

        <para>Below is an example of the
        <filename>samplenetworks.json</filename> file as seen in step 3. with
        some interfaces included:<programlisting> {
    "networks":[
       {
          "name":"prov-net",
          "nodes":[
             {
                "name":"node-4",
                "interfaces":[
                   "em2p1s0f5"
                ]
             },
             {
                "name":"node-5",
                "interfaces":[
                   "em2p1s0f5"
                ]
             }
          ]
       }
    ]
 }

 cp samplenetworks.json /opt/enea/postdeployscripts/provider-net/files/networks.json</programlisting>The
        snippet shown above infers the following:</para>

        <itemizedlist>
          <listitem>
            <para>An Openstack provider network called
            <filename>prov-net</filename> will be created.</para>
          </listitem>

          <listitem>
            <para>Two nodes (node-4 and node-5) each have an interface
            connected to the underlying physical network associated with the
            provider network.</para>
          </listitem>
        </itemizedlist>

        <note>
          <para>All of these components are lists in terms of json format, and
          can be extended accordingly, making it possible for there to be
          potentially X networks with Y nodes with Z interfaces.</para>
        </note>
      </listitem>

      <listitem>
        <para>Final checklist:</para>

        <itemizedlist>
          <listitem>
            <para>Verify that the node names in the file match the actual
            hostnames of the nodes.</para>
          </listitem>

          <listitem>
            <para>Check that the interfaces in the file exist on the
            nodes.</para>
          </listitem>
        </itemizedlist>
      </listitem>

      <listitem>
        <para>Run the playbook:<programlisting>ansible-playbook deploy.yaml</programlisting>Various
        checks are in place to minimize user error.<literal><filename>
        deploy.yaml</filename></literal> is located at
        <literal>/opt/enea/postdeployscripts/provider-net/deploy.yaml</literal>.</para>

        <note>
          <para>After the playbook is executed the nodes will be
          rebooted.</para>
        </note>

        <para>On the processed nodes there should be new OVS bridges,
        connecting the physical interfaces to <literal>br-int</literal>. For
        example, on a non-DPDK enabled setup, the new configuration will look
        like the following:</para>

        <para><programlisting>   Bridge br-prov-net
        Controller "tcp:127.0.0.1:6633"
            is_connected: true
        fail_mode: secure
        Port phy-br-prov-net
            Interface phy-br-prov-net
                type: patch
                options: {peer=int-br-prov-net}
        Port br-prov-net
            Interface br-prov-net
                type: internal
    ovs_version: "2.9.0"</programlisting></para>
      </listitem>
    </orderedlist>
  </section>
</chapter>