Refactoring
[sdnvpn.git] / docs / userguide / feature.userguide.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. (c) Tim Irnich, Nikolas Hermanns, Christopher Price and others
4
5 Introduction
6 ============
7 .. Describe the specific features and how it is realised in the scenario in a brief manner
8 .. to ensure the user understand the context for the user guide instructions to follow.
9
10 This document will provide an overview of how to work with the SDN VPN features in
11 OPNFV.
12
13 SDN VPN feature description
14 ===========================
15 .. Describe the specific usage for <XYZ> feature.
16 .. Provide enough information that a user will be able to operate the feature on a deployed scenario.
17
18 A high-level description of the scenarios is provided in this section.
19 For details of the scenarios and their provided capabilities refer to
20 the scenario description document:
21 http://artifacts.opnfv.org/colorado/sdnpvn/scenarios/os-odl_l2-bgpvpn/index.html
22
23 The BGPVPN feature enables creation of BGP VPNs on the Neutron API according to the OpenStack
24 BGPVPN blueprint at https://blueprints.launchpad.net/neutron/+spec/neutron-bgp-vpn.
25 In a nutshell, the blueprint defines a BGPVPN object and a number of ways
26 how to associate it with the existing Neutron object model, as well as a unique
27 definition of the related semantics. The BGPVPN framework supports a backend
28 driver model with currently available drivers for Bagpipe, OpenContrail, Nuage
29 and OpenDaylight. The OPNFV scenario makes use of the OpenDaylight driver and backend
30 implementation through the ODL VPNService project.
31
32 Hardware requirements
33 =====================
34
35 The SDNVPN scenarios can be deployed as a bare-metal or a virtual environment on a single host.
36
37 Bare metal deployment on Pharos Lab
38 -----------------------------------
39
40 Hardware requirements for bare-metal deployments of the OPNFV infrastructure are specified
41 by the Pharos project. The Pharos project provides an OPNFV hardware specification for
42 configuring your hardware at: http://artifacts.opnfv.org/pharos/docs/pharos-spec.html.
43
44 Virtual deployment hardware requirements
45 ----------------------------------------
46
47 To perform a virtual deployment of an OPNFV scenario on a single host, that host has to
48 meet the hardware requirements outlined in the <missing spec>.
49
50 When ODL is used as an SDN Controller in an OPNFV virtual deployment, ODL is
51 running on the OpenStack Controller VMs. It is therefore recommended to
52 increase the amount of resources for these VMs.
53
54 Our recommendation is to have 2 additional virtual cores and 8GB additional virtual memory
55 on top of the normally recommended configuration.
56
57 Together with the commonly used recommendation this sums up to:
58 ::
59
60  4 virtual cores
61  16 GB virtual memory
62
63 See in Installation section below how to configure this.
64
65 Preparing the host to install Fuel by script
66 ============================================
67 .. Not all of these options are relevant for all scenario's.  I advise following the
68 .. instructions applicable to the deploy tool used in the scenario.
69
70 Before starting the installation of the <scenario> scenario some preparation of the
71 machine that will host the Fuel VM must be done.
72
73 Installation of required packages
74 ---------------------------------
75 To be able to run the installation of the basic OPNFV fuel installation the
76 Jumphost (or the host which serves the VMs for the virtual deployment) needs to
77 install the following packages:
78 ::
79
80  sudo apt-get install -y git make curl libvirt-bin libpq-dev qemu-kvm \
81                          qemu-system tightvncserver virt-manager sshpass \
82                          fuseiso genisoimage blackbox xterm python-pip \
83                          python-git python-dev python-oslo.config \
84                          python-pip python-dev libffi-dev libxml2-dev \
85                         libxslt1-dev libffi-dev libxml2-dev libxslt1-dev \
86                         expect curl python-netaddr p7zip-full
87
88  sudo pip install GitPython pyyaml netaddr paramiko lxml scp \
89                   python-novaclient python-neutronclient python-glanceclient \
90                   python-keystoneclient debtcollector netifaces enum
91
92 Download the source code and artifact
93 -------------------------------------
94 To be able to install the scenario os-odl_l2-bgpvpn one can follow the way
95 CI is deploying the scenario.
96 First of all the opnfv-fuel repository needs to be cloned:
97 ::
98
99  git clone ssh://<user>@gerrit.opnfv.org:29418/fuel
100
101 This command downloads the whole repository fuel. We need now to switch it to
102 the stable Colorado branch:
103 ::
104
105  cd fuel
106  git checkout stable/colorado
107
108 Now download the appropriate OPNFV Fuel ISO into an appropriate folder:
109 ::
110
111  wget http://artifacts.opnfv.org/fuel/colorado/opnfv-colorado.1.0.iso
112
113 The exact name of the ISO image may change.
114 Check https://www.opnfv.org/opnfv-colorado-fuel-users to get the latest ISO.
115
116 Simplified scenario deployment procedure using Fuel
117 ===================================================
118
119 This section describes the installation of the os-odl_l2-bgpvpn-ha or
120 os-odl_l2-bgpvpn-noha OPNFV reference platform stack across a server cluster
121 or a single host as a virtual deployment.
122
123 Scenario Preparation
124 --------------------
125 dea.yaml and dha.yaml need to be copied and changed according to the lab-name/host
126 where you deploy.
127 Copy the full lab config from:
128 ::
129
130  cp <path-to-opnfv-fuel-repo>/deploy/config/labs/devel-pipeline/elx \
131     <path-to-opnfv-fuel-repo>/deploy/config/labs/devel-pipeline/<your-lab-name>
132
133 Add at the bottom of dha.yaml
134 ::
135
136  disks:
137    fuel: 100G
138    controller: 100G
139    compute: 100G
140
141  define_vms:
142    controller:
143      vcpu:
144        value: 4
145      memory:
146        attribute_equlas:
147          unit: KiB
148        value: 16388608
149      currentMemory:
150        attribute_equlas:
151          unit: KiB
152        value: 16388608
153
154
155 Check if the default settings in dea.yaml are in line with your intentions
156 and make changes as required.
157
158 Installation procedures
159 -----------------------
160
161 We describe several alternative procedures in the following. 
162 First, we describe several methods that are based on the deploy.sh script, which is also used by the OPNFV CI system. 
163 It can be found in the Fuel repository. 
164
165 In addition, the SDNVPN feature can also be configured manually in the Fuel GUI. 
166 This is described in the last subsection. 
167
168 Before starting any of the following procedures, go to
169 ::
170
171  cd <opnfv-fuel-repo>/ci
172
173 Full automatic virtual deployment High Availablity Mode
174 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
175
176 The following command will deploy the high-availability flavor of SDNVPN scenario os-odl_l2-bgpvpn-ha
177 in a fully automatic way, i.e. all installation steps (Fuel server installation, configuration,
178 node discovery and platform deployment) will take place without any further prompt for user input.
179 ::
180
181  sudo bash ./deploy.sh -b file://<path-to-opnfv-fuel-repo>/config/ -l devel-pipeline -p <your-lab-name> -s os-odl_l2-bgpvpn-ha -i file://<path-to-fuel-iso>
182
183 Full automatic virtual deployment NO High Availability Mode
184 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
185
186 The following command will deploy the SDNVPN scenario in its non-high-availability flavor (note the 
187 different scenario name for the -s switch). Otherwise it does the same as described above.
188 ::
189
190  sudo bash ./deploy.sh -b file://<path-to-opnfv-fuel-repo>/config/ -l devel-pipeline -p <your-lab-name> -s os-odl_l2-bgpvpn-noha -i file://<path-to-fuel-iso>
191
192 Automatic Fuel installation and manual scenario deployment
193 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
194
195 A useful alternative to the full automatic procedure is to only autodeploy the Fuel host and to run host selection, role assignment and SDNVPN scenario configuration manually.
196 ::
197
198  sudo bash ./deploy.sh -b file://<path-to-opnfv-fuel-repo>/config/ -l devel-pipeline -p <your-lab-name> -s os-odl_l2-bgpvpn-ha -i file://<path-to-fuel-iso> -e
199
200 With -e option the installer does not launch environment deployment, so
201 a user can do some modification before the scenario is really deployed.
202 Another interesting option is the -f option which deploys the scenario using an existing Fuel host.
203
204 The result of this installation is a fuel sever with the right config for
205 BGPVPN. Now the deploy button on fuel dashboard can be used to deploy the environment.
206 It is as well possible to do the configuration manuell.
207
208 Feature configuration on existing Fuel
209 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
210 If a Fuel server is already provided but the fuel plugins for Opendaylight, Openvswitch
211 and BGPVPN are not provided install them by:
212 ::
213
214  cd /opt/opnfv/
215  fuel plugins --install fuel-plugin-ovs-*.noarch.rpm
216  fuel plugins --install opendaylight-*.noarch.rpm
217  fuel plugins --install bgpvpn-*.noarch.rpm
218
219 If plugins are installed and you want to update them use --force flag.
220
221 Now the feature can be configured. Create a new environment with "Neutron with ML2 plugin" and
222 in there "Neutron with tunneling segmentation".
223 Then go to settings/other and check "OpenDaylight plugin", "Install Openvswitch with NSH/DPDK" and
224 "BGPVPN plugin". Then you should be able to check "BGPVPN extensions" in OpenDaylight plugin section.
225
226 Now the deploy button on fuel dashboard can be used to deploy the environment.
227
228 Feature and API usage guidelines and example
229 ============================================
230 .. Describe with examples how to use specific features, provide API examples and details required to
231 .. operate the feature on the platform.
232
233 For the details of using OpenStack BGPVPN API, please refer to the documentation
234 at http://docs.openstack.org/developer/networking-bgpvpn/.
235
236 Example
237 -------
238 In the example we will show a BGPVPN associated to 2 neutron networks. The BGPVPN
239 will have the import and export routes in the way that it imports its own Route. The outcome will be that vms sitting on these two networks will be able to have a full L3
240 connectivity.
241
242 Some defines:
243 ::
244
245  net_1="Network1"
246  net_2="Network2"
247  subnet_net1="10.10.10.0/24"
248  subnet_net2="10.10.11.0/24"
249
250 Create neutron networks and save network IDs:
251 ::
252
253  neutron net-create --provider:network_type=local $net_1
254  export net_1_id=`echo "$rv" | grep " id " |awk '{print $4}'`
255  neutron net-create --provider:network_type=local $net_2
256  export net_2_id=`echo "$rv" | grep " id " |awk '{print $4}'`
257
258 Create neutron subnets:
259 ::
260
261  neutron subnet-create $net_1 --disable-dhcp $subnet_net1
262  neutron subnet-create $net_2 --disable-dhcp $subnet_net2
263
264 Create BGPVPN:
265 ::
266
267  neutron bgpvpn-create --route-distinguishers 100:100 --route-targets 100:2530 --name L3_VPN
268
269 Start VMs on both networks:
270 ::
271
272  nova boot --flavor 1 --image <some-image> --nic net-id=$net_1_id vm1
273  nova boot --flavor 1 --image <some-image> --nic net-id=$net_2_id vm2
274
275 The VMs should not be able to see each other.
276
277 Associate to Neutron networks:
278 ::
279
280  neutron bgpvpn-net-assoc-create L3_VPN --network $net_1_id
281  neutron bgpvpn-net-assoc-create L3_VPN --network $net_2_id
282
283 Now the VMs should be able to ping each other
284
285 Troubleshooting
286 ===============
287 Check neutron logs on the controller:
288 ::
289
290  tail -f /var/log/neutron/server.log |grep -E "ERROR|TRACE"
291
292 Check Opendaylight logs:
293 ::
294
295  tail -f /opt/opendaylight/data/logs/karaf.log
296
297 Restart Opendaylight:
298 ::
299
300  service opendaylight restart