vxlan: vxlan/vxlan.api API cleanup
[vpp.git] / extras / vpp_config / README.rst
1 Summary:\r
2 \r
3 The purpose of the VPP configuration utility is to allow the user to configure\r
4 VPP in a simple and safe manner. The utility takes input from the user and\r
5 then modifies the key configuration files. The user can then examine these files\r
6 to be sure they are correct and then actually apply the configuration. The user\r
7 can also install a released and stable version of VPP. This is currently\r
8 released with release 17.10.\r
9 \r
10 Use:\r
11 \r
12 The installation and executing of the VPP configuration utility is simple. First\r
13 install the python pip module. Using pip install, then pip install vpp-config.\r
14 Then simply type �vpp-config� and answer the questions. If you are not sure what\r
15 to answer choose the default. For yes or no questions the capital letter\r
16 designates the default. For example, for a question that shows [Y/n] Y is the\r
17 default. For numbers the default is within the brackets for example for a\r
18 question that shows [1024]. 1024 is the default. \r
19 \r
20 The flow of the utility is to inspect the system, if VPP is not install it,\r
21 create dry run configurations, inspect the files created during the dry run,\r
22 apply the configuration and then inspect the system again and then repeat.  \r
23 \r
24 Caveats:\r
25 \r
26 - Supports Ubuntu, centos7, RedHat is coming shortly.\r
27 \r
28 For Developers:\r
29 \r
30 Modifying the code is reasonable simple. The process would be edit and debug the\r
31 code from the root directory. In order to do this, we need a script that will copy\r
32 or data files to the proper place. This is where they end up with pip install. For\r
33 Ubuntu, this is /usr/local/vpp/vpp-config. I have provided a script that will copy\r
34 the relevant files correctly. I have also provided a script that will clean the\r
35 environment so you can start from scratch. These are the steps to run the utility\r
36 in this environment. The scripts are meant to be run from the root directory.\r
37 \r
38   ./scripts/clean.sh\r
39   ./scripts/cp-data.sh\r
40   ./vpp-config\r
41 \r
42 When the utility is installed with pip the wrapper scripts/vpp-config is written to\r
43 /usr/local/bin. However, the starting point when debugging this script locally is\r
44 vpp-config. Run the utility by executing vpp-config.\r
45 \r
46 The start point in the code is in vpp_config.py. However, most of the work is\r
47 done in\r
48 the files in ./vpplib\r
49 \r
50 Uploading to PyPi:\r
51 \r
52 To upload this utility to PpPi simple do the following. Currently, I have my own account\r
53 when we want everyone to contribute we will need to change that.\r
54 \r
55   sudo �H bash\r
56   cd vpp_config\r
57   python setup.py sdist bdist_wheel\r
58   twine upload dist/*\r
59 \r
60 Example Run:\r
61 \r
62 # pip install vpp-config\r
63 # vpp-config\r
64 \r
65 Welcome to the VPP system configuration utility\r
66 \r
67 These are the files we will modify:\r
68     /etc/vpp/startup.conf\r
69     /etc/sysctl.d/80-vpp.conf\r
70     /etc/default/grub\r
71 \r
72 Before we change them, we'll create working copies in /usr/local/vpp/vpp-config/dryrun\r
73 Please inspect them carefully before applying the actual configuration (option 3)!\r
74 \r
75 What would you like to do?\r
76 \r
77 1) Show basic system information\r
78 2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)\r
79        and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml\r
80 3) Full configuration (WARNING: This will change the system configuration)\r
81 4) Install/Uninstall VPP.\r
82 5) Dry Run from /usr/local/vpp/vpp-config/auto-config.yaml (will not ask questions).\r
83 6) Install QEMU patch (Needed when running openstack).\r
84 9 or q) Quit\r
85 \r
86 Command: 1\r
87 \r
88 ==============================\r
89 NODE: DUT1\r
90 \r
91 CPU:\r
92           Model name:    Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz\r
93               CPU(s):    32\r
94   Thread(s) per core:    2\r
95   Core(s) per socket:    8\r
96            Socket(s):    2\r
97    NUMA node0 CPU(s):    0-7,16-23\r
98    NUMA node1 CPU(s):    8-15,24-31\r
99          CPU max MHz:    3600.0000\r
100          CPU min MHz:    1200.0000\r
101                  SMT:    Enabled\r
102 \r
103 VPP Threads: (Name: Cpu Number)\r
104 \r
105 Grub Command Line:\r
106   Current: BOOT_IMAGE=/boot/vmlinuz-4.4.0-96-generic root=UUID=d760b82f-f37b-47e2-9815-db8d479a3557 ro\r
107   Configured: GRUB_CMDLINE_LINUX_DEFAULT=""\r
108 \r
109 Huge Pages:\r
110   Total System Memory           : 65863484 kB\r
111   Total Free Memory             : 41325924 kB\r
112   Actual Huge Page Total        : 8192\r
113   Configured Huge Page Total    : 1024\r
114   Huge Pages Free               : 8192\r
115   Huge Page Size                : 2048 kB\r
116 \r
117 Devices:\r
118 \r
119 Status:\r
120   Not Installed\r
121 \r
122 ==============================\r
123 \r
124 What would you like to do?\r
125 \r
126 1) Show basic system information\r
127 2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)\r
128        and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml\r
129 3) Full configuration (WARNING: This will change the system configuration)\r
130 4) Install/Uninstall VPP.\r
131 5) Dry Run from /usr/local/vpp/vpp-config/auto-config.yaml (will not ask questions).\r
132 6) Install QEMU patch (Needed when running openstack).\r
133 9 or q) Quit\r
134 \r
135 Command: 4\r
136 \r
137 There are no VPP packages on node localhost.\r
138 Do you want to install VPP [Y/n]? \r
139 INFO:root: Local Command: ls /etc/apt/sources.list.d/99fd.io.list.orig\r
140 INFO:root:  /etc/apt/sources.list.d/99fd.io.list.orig\r
141 ��..\r
142 \r
143 What would you like to do?\r
144 \r
145 1) Show basic system information\r
146 2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)\r
147        and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml\r
148 3) Full configuration (WARNING: This will change the system configuration)\r
149 4) Install/Uninstall VPP.\r
150 5) Dry Run from /usr/local/vpp/vpp-config/auto-config.yaml (will not ask questions).\r
151 6) Install QEMU patch (Needed when running openstack).\r
152 9 or q) Quit\r
153 \r
154 Command: 1\r
155 \r
156 ==============================\r
157 NODE: DUT1\r
158 \r
159 CPU:\r
160           Model name:    Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz\r
161               CPU(s):    32\r
162   Thread(s) per core:    2\r
163   Core(s) per socket:    8\r
164            Socket(s):    2\r
165    NUMA node0 CPU(s):    0-7,16-23\r
166    NUMA node1 CPU(s):    8-15,24-31\r
167          CPU max MHz:    3600.0000\r
168          CPU min MHz:    1200.0000\r
169                  SMT:    Enabled\r
170 \r
171 VPP Threads: (Name: Cpu Number)\r
172   vpp_main  : 0   \r
173   vpp_stats : 0   \r
174 \r
175 Grub Command Line:\r
176   Current: BOOT_IMAGE=/boot/vmlinuz-4.4.0-96-generic root=UUID=d760b82f-f37b-47e2-9815-db8d479a3557 ro\r
177   Configured: GRUB_CMDLINE_LINUX_DEFAULT=""\r
178 \r
179 Huge Pages:\r
180   Total System Memory           : 65863484 kB\r
181   Total Free Memory             : 55877364 kB\r
182   Actual Huge Page Total        : 1024\r
183   Configured Huge Page Total    : 1024\r
184   Huge Pages Free               : 1024\r
185   Huge Page Size                : 2048 kB\r
186 \r
187 Devices:\r
188 Name                           Socket RXQs RXDescs TXQs TXDescs\r
189 \r
190 Status:\r
191   active (running)\r
192 \r
193 ==============================\r
194 \r
195 What would you like to do?\r
196 \r
197 1) Show basic system information\r
198 2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)\r
199        and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml\r
200 3) Full configuration (WARNING: This will change the system configuration)\r
201 4) Install/Uninstall VPP.\r
202 5) Dry Run from /usr/local/vpp/vpp-config/auto-config.yaml (will not ask questions).\r
203 6) Install QEMU patch (Needed when running openstack).\r
204 9 or q) Quit\r
205 \r
206 Command: 2\r
207 \r
208 These device(s) are currently NOT being used by VPP or the OS.\r
209 \r
210 PCI ID          Description                                       \r
211 ----------------------------------------------------------------\r
212 0000:02:00.0    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
213 0000:02:00.1    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
214 \r
215 Would you like to give any of these devices back to the OS [y/N]? y\r
216 Would you like to use device 0000:02:00.0 for the OS [y/N]? y\r
217 Would you like to use device 0000:02:00.1 for the OS [y/N]? y\r
218 \r
219 These devices have kernel interfaces, but appear to be safe to use with VPP.\r
220 \r
221 PCI ID          Kernel Interface(s)       Description                                       \r
222 ------------------------------------------------------------------------------------------\r
223 0000:90:00.0    enp144s0                  VIC Ethernet NIC                                  \r
224 0000:8f:00.0    enp143s0                  VIC Ethernet NIC                                  \r
225 0000:84:00.0    enp132s0f0,enp132s0f0d1   Ethernet Controller XL710 for 40GbE QSFP+         \r
226 0000:84:00.1    enp132s0f1,enp132s0f1d1   Ethernet Controller XL710 for 40GbE QSFP+         \r
227 0000:08:00.1    enp8s0f1                  I350 Gigabit Network Connection                   \r
228 0000:02:00.0    enp2s0f0                  82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
229 0000:02:00.1    enp2s0f1                  82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
230 0000:86:00.0    enp134s0f0                82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
231 0000:86:00.1    enp134s0f1                82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
232 \r
233 Would you like to use any of these device(s) for VPP [y/N]? y\r
234 Would you like to use device 0000:90:00.0 for VPP [y/N]? \r
235 Would you like to use device 0000:8f:00.0 for VPP [y/N]? \r
236 Would you like to use device 0000:84:00.0 for VPP [y/N]? \r
237 Would you like to use device 0000:84:00.1 for VPP [y/N]? \r
238 Would you like to use device 0000:08:00.1 for VPP [y/N]? \r
239 Would you like to use device 0000:02:00.0 for VPP [y/N]? y\r
240 Would you like to use device 0000:02:00.1 for VPP [y/N]? y\r
241 Would you like to use device 0000:86:00.0 for VPP [y/N]? y\r
242 Would you like to use device 0000:86:00.1 for VPP [y/N]? y\r
243 \r
244 These device(s) will be used by VPP.\r
245 \r
246 PCI ID          Description                                       \r
247 ----------------------------------------------------------------\r
248 0000:86:00.0    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
249 0000:86:00.1    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
250 0000:02:00.0    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
251 0000:02:00.1    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
252 \r
253 Would you like to remove any of these device(s) [y/N]? \r
254 \r
255 These device(s) will be used by VPP, please rerun this option if this is incorrect.\r
256 \r
257 PCI ID          Description                                       \r
258 ----------------------------------------------------------------\r
259 0000:86:00.0    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
260 0000:86:00.1    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
261 0000:02:00.0    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
262 0000:02:00.1    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
263 \r
264 Your system has 32 core(s) and 2 Numa Nodes.\r
265 To begin, we suggest not reserving any cores for VPP or other processes.\r
266 Then to improve performance try reserving cores as needed. \r
267 \r
268 How many core(s) do you want to reserve for processes other than VPP? [0-16][0]? 4\r
269 How many core(s) shall we reserve for VPP workers[0-4][0]? 2\r
270 Should we reserve 1 core for the VPP Main thread? [Y/n]? \r
271 \r
272 There currently 1024 2048 kB huge pages free.\r
273 Do you want to reconfigure the number of huge pages [y/N]? y\r
274 \r
275 There currently a total of 1024 huge pages.\r
276 How many huge pages do you want [1024 - 22511][1024]? 8192\r
277 \r
278 What would you like to do?\r
279 \r
280 1) Show basic system information\r
281 2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)\r
282        and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml\r
283 3) Full configuration (WARNING: This will change the system configuration)\r
284 4) Install/Uninstall VPP.\r
285 5) Dry Run from /usr/local/vpp/vpp-config/auto-config.yaml (will not ask questions).\r
286 6) Install QEMU patch (Needed when running openstack).\r
287 9 or q) Quit\r
288 \r
289 Command: 3\r
290 \r
291 We are now going to configure your system(s).\r
292 \r
293 Are you sure you want to do this [Y/n]? \r
294 These are the changes we will apply to\r
295 the huge page file (/etc/sysctl.d/80-vpp.conf).\r
296 \r
297 1,2d0\r
298 < # Number of 2MB hugepages desired\r
299 < vm.nr_hugepages=1024\r
300 4,7c2,3\r
301 < # Must be greater than or equal to (2 * vm.nr_hugepages).\r
302 < vm.max_map_count=3096\r
303\r
304 < # All groups allowed to access hugepages\r
305 ---\r
306 > vm.nr_hugepages=8192\r
307 > vm.max_map_count=17408\r
308 8a5\r
309 > kernel.shmmax=17179869184\r
310 10,15d6\r
311 < # Shared Memory Max must be greator or equal to the total size of hugepages.\r
312 < # For 2MB pages, TotalHugepageSize = vm.nr_hugepages * 2 * 1024 * 1024\r
313 < # If the existing kernel.shmmax setting  (cat /sys/proc/kernel/shmmax)\r
314 < # is greater than the calculated TotalHugepageSize then set this parameter\r
315 < # to current shmmax value.\r
316 < kernel.shmmax=2147483648\r
317 \r
318 \r
319 Are you sure you want to apply these changes [Y/n]? \r
320 These are the changes we will apply to\r
321 the VPP startup file (/etc/vpp/startup.conf).\r
322 \r
323 3c3\r
324 <   nodaemon\r
325 ---\r
326 >   interactive\r
327 5a6\r
328 >   cli-listen /run/vpp/cli.sock\r
329 17c18,25\r
330 <       ## In the VPP there is one main thread and optionally the user can create worker(s)\r
331 ---\r
332\r
333 >   main-core 8\r
334 >   corelist-workers 9-10,5-6\r
335\r
336 >   scheduler-policy fifo\r
337 >   scheduler-priority 50\r
338\r
339 >         ## In the VPP there is one main thread and optionally the user can create worker(s)\r
340 52,53c60,76\r
341 < # dpdk {\r
342 <       ## Change default settings for all intefaces\r
343 ---\r
344 > dpdk {\r
345\r
346 >   dev 0000:86:00.0 { \r
347 >     num-rx-queues 2\r
348 >   }\r
349 >   dev 0000:86:00.1 { \r
350 >     num-rx-queues 2\r
351 >   }\r
352 >   dev 0000:02:00.0 { \r
353 >     num-rx-queues 2\r
354 >   }\r
355 >   dev 0000:02:00.1 { \r
356 >     num-rx-queues 2\r
357 >   }\r
358 >   num-mbufs 71680\r
359\r
360 >         ## Change default settings for all intefaces\r
361 82a106,115\r
362 >       ## Specify bonded interface and its slaves via PCI addresses\r
363 >       ## \r
364 >         ## Bonded interface in XOR load balance mode (mode 2) with L3 and L4 headers \r
365 >       # vdev eth_bond0,mode=2,slave=0000:02:00.0,slave=0000:03:00.0,xmit_policy=l34\r
366 >       # vdev eth_bond1,mode=2,slave=0000:02:00.1,slave=0000:03:00.1,xmit_policy=l34\r
367 >       ##\r
368 >       ## Bonded interface in Active-Back up mode (mode 1)\r
369 >       # vdev eth_bond0,mode=1,slave=0000:02:00.0,slave=0000:03:00.0\r
370 >       # vdev eth_bond1,mode=1,slave=0000:02:00.1,slave=0000:03:00.1\r
371\r
372 99c132\r
373 < # }\r
374 ---\r
375 > }\r
376 108a142\r
377\r
378 \r
379 \r
380 Are you sure you want to apply these changes [Y/n]? \r
381 \r
382 The configured grub cmdline looks like this:\r
383 GRUB_CMDLINE_LINUX_DEFAULT="intel_pstate=disable isolcpus=1-4,8,9-10,5-6 nohz_full=1-4,8,9-10,5-6 rcu_nocbs=1-4,8,9-10,5-6"\r
384 \r
385 The current boot cmdline looks like this:\r
386 BOOT_IMAGE=/boot/vmlinuz-4.4.0-96-generic root=UUID=d760b82f-f37b-47e2-9815-db8d479a3557 ro\r
387 \r
388 Do you want to keep the current boot cmdline [Y/n]? \r
389 \r
390 What would you like to do?\r
391 \r
392 1) Show basic system information\r
393 2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)\r
394        and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml\r
395 3) Full configuration (WARNING: This will change the system configuration)\r
396 4) Install/Uninstall VPP.\r
397 5) Dry Run from /usr/local/vpp/vpp-config/auto-config.yaml (will not ask questions).\r
398 6) Install QEMU patch (Needed when running openstack).\r
399 9 or q) Quit\r
400 \r
401 Command: 1\r
402 \r
403 ==============================\r
404 NODE: DUT1\r
405 \r
406 CPU:\r
407           Model name:    Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz\r
408               CPU(s):    32\r
409   Thread(s) per core:    2\r
410   Core(s) per socket:    8\r
411            Socket(s):    2\r
412    NUMA node0 CPU(s):    0-7,16-23\r
413    NUMA node1 CPU(s):    8-15,24-31\r
414          CPU max MHz:    3600.0000\r
415          CPU min MHz:    1200.0000\r
416                  SMT:    Enabled\r
417 \r
418 VPP Threads: (Name: Cpu Number)\r
419 \r
420 Grub Command Line:\r
421   Current: BOOT_IMAGE=/boot/vmlinuz-4.4.0-96-generic root=UUID=d760b82f-f37b-47e2-9815-db8d479a3557 ro\r
422   Configured: GRUB_CMDLINE_LINUX_DEFAULT="intel_pstate=disable isolcpus=1-4,8,9-10,5-6 nohz_full=1-4,8,9-10,5-6 rcu_nocbs=1-4,8,9-10,5-6"\r
423 \r
424 Huge Pages:\r
425   Total System Memory           : 65863484 kB\r
426   Total Free Memory             : 41163916 kB\r
427   Actual Huge Page Total        : 8192\r
428   Configured Huge Page Total    : 8192\r
429   Huge Pages Free               : 3108\r
430   Huge Page Size                : 2048 kB\r
431 \r
432 Devices:\r
433 Total Number of Buffers: 71680\r
434 \r
435 Status:\r
436   active (running)\r
437   Sep 27 12:49:59 tf-ucs-3 vpp[13671]: EAL: No free hugepages reported in hugepages-1048576kB\r
438 \r
439 ==============================\r
440 \r
441 What would you like to do?\r
442 \r
443 1) Show basic system information\r
444 2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)\r
445        and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml\r
446 3) Full configuration (WARNING: This will change the system configuration)\r
447 4) Install/Uninstall VPP.\r
448 5) Dry Run from /usr/local/vpp/vpp-config/auto-config.yaml (will not ask questions).\r
449 6) Install QEMU patch (Needed when running openstack).\r
450 9 or q) Quit\r
451 \r
452 Command: 1\r
453 \r
454 ==============================\r
455 NODE: DUT1\r
456 \r
457 CPU:\r
458           Model name:    Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz\r
459               CPU(s):    32\r
460   Thread(s) per core:    2\r
461   Core(s) per socket:    8\r
462            Socket(s):    2\r
463    NUMA node0 CPU(s):    0-7,16-23\r
464    NUMA node1 CPU(s):    8-15,24-31\r
465          CPU max MHz:    3600.0000\r
466          CPU min MHz:    1200.0000\r
467                  SMT:    Enabled\r
468 \r
469 VPP Threads: (Name: Cpu Number)\r
470   vpp_stats : 0   \r
471   vpp_wk_2  : 9   \r
472   vpp_wk_3  : 10  \r
473   vpp_wk_0  : 5   \r
474   vpp_wk_1  : 6   \r
475   vpp_main  : 8   \r
476 \r
477 Grub Command Line:\r
478   Current: BOOT_IMAGE=/boot/vmlinuz-4.4.0-96-generic root=UUID=d760b82f-f37b-47e2-9815-db8d479a3557 ro\r
479   Configured: GRUB_CMDLINE_LINUX_DEFAULT="intel_pstate=disable isolcpus=1-4,8,9-10,5-6 nohz_full=1-4,8,9-10,5-6 rcu_nocbs=1-4,8,9-10,5-6"\r
480 \r
481 Huge Pages:\r
482   Total System Memory           : 65863484 kB\r
483   Total Free Memory             : 41170684 kB\r
484   Actual Huge Page Total        : 8192\r
485   Configured Huge Page Total    : 8192\r
486   Huge Pages Free               : 7936\r
487   Huge Page Size                : 2048 kB\r
488 \r
489 Devices:\r
490 Total Number of Buffers: 71680\r
491 Name                           Socket RXQs RXDescs TXQs TXDescs\r
492 TenGigabitEthernet2/0/0             0    2    1024    5    1024\r
493 TenGigabitEthernet2/0/1             0    2    1024    5    1024\r
494 TenGigabitEthernet86/0/0            1    2    1024    5    1024\r
495 TenGigabitEthernet86/0/1            1    2    1024    5    1024\r
496 \r
497 Status:\r
498   active (running)\r
499 \r
500 ==============================\r
501 \r
502 What would you like to do?\r
503 \r
504 1) Show basic system information\r
505 2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)\r
506        and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml\r
507 3) Full configuration (WARNING: This will change the system configuration)\r
508 4) Install/Uninstall VPP.\r
509 5) Dry Run from /usr/local/vpp/vpp-config/auto-config.yaml (will not ask questions).\r
510 6) Install QEMU patch (Needed when running openstack).\r
511 9 or q) Quit\r
512 \r
513 Command: q\r
514\r