Debian Codegraph @

ansible_collections/dellemc/enterprise_sonic/docs/dellemc.enterprise_sonic.sonic_sflow_module.rst

raw
1 .. _dellemc.enterprise_sonic.sonic_sflow_module:
2
3
4 ************************************
5 dellemc.enterprise_sonic.sonic_sflow
6 ************************************
7
8 **configure sflow settings on SONiC**
9
10
11 Version added: 2.5.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - This module provides configuration for sflow sampling on devices running SONiC
21
22
23
24
25 Parameters
26 ----------
27
28 .. raw:: html
29
30 <table border=0 cellpadding=0 class="documentation-table">
31 <tr>
32 <th colspan="3">Parameter</th>
33 <th>Choices/<font color="blue">Defaults</font></th>
34 <th width="100%">Comments</th>
35 </tr>
36 <tr>
37 <td colspan="3">
38 <div class="ansibleOptionAnchor" id="parameter-"></div>
39 <b>config</b>
40 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
41 <div style="font-size: small">
42 <span style="color: purple">dictionary</span>
43 </div>
44 </td>
45 <td>
46 </td>
47 <td>
48 <div>Defines configuration and operational state data related to data plane traffic sampling based on sflow.</div>
49 </td>
50 </tr>
51 <tr>
52 <td class="elbow-placeholder"></td>
53 <td colspan="2">
54 <div class="ansibleOptionAnchor" id="parameter-"></div>
55 <b>agent</b>
56 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
57 <div style="font-size: small">
58 <span style="color: purple">string</span>
59 </div>
60 </td>
61 <td>
62 </td>
63 <td>
64 <div>The Agent interface</div>
65 </td>
66 </tr>
67 <tr>
68 <td class="elbow-placeholder"></td>
69 <td colspan="2">
70 <div class="ansibleOptionAnchor" id="parameter-"></div>
71 <b>collectors</b>
72 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
73 <div style="font-size: small">
74 <span style="color: purple">list</span>
75 / <span style="color: purple">elements=dictionary</span>
76 </div>
77 </td>
78 <td>
79 </td>
80 <td>
81 <div>Configuration data for sflow collectors.</div>
82 </td>
83 </tr>
84 <tr>
85 <td class="elbow-placeholder"></td>
86 <td class="elbow-placeholder"></td>
87 <td colspan="1">
88 <div class="ansibleOptionAnchor" id="parameter-"></div>
89 <b>address</b>
90 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
91 <div style="font-size: small">
92 <span style="color: purple">string</span>
93 / <span style="color: red">required</span>
94 </div>
95 </td>
96 <td>
97 </td>
98 <td>
99 <div>IP address of the sflow collector.</div>
100 </td>
101 </tr>
102 <tr>
103 <td class="elbow-placeholder"></td>
104 <td class="elbow-placeholder"></td>
105 <td colspan="1">
106 <div class="ansibleOptionAnchor" id="parameter-"></div>
107 <b>network_instance</b>
108 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
109 <div style="font-size: small">
110 <span style="color: purple">string</span>
111 </div>
112 </td>
113 <td>
114 <b>Default:</b><br/><div style="color: blue">"default"</div>
115 </td>
116 <td>
117 <div>name of the network instance containing the sflow collector</div>
118 </td>
119 </tr>
120 <tr>
121 <td class="elbow-placeholder"></td>
122 <td class="elbow-placeholder"></td>
123 <td colspan="1">
124 <div class="ansibleOptionAnchor" id="parameter-"></div>
125 <b>port</b>
126 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
127 <div style="font-size: small">
128 <span style="color: purple">integer</span>
129 </div>
130 </td>
131 <td>
132 <b>Default:</b><br/><div style="color: blue">6343</div>
133 </td>
134 <td>
135 <div>UDP port number for the sflow collector.</div>
136 </td>
137 </tr>
138
139 <tr>
140 <td class="elbow-placeholder"></td>
141 <td colspan="2">
142 <div class="ansibleOptionAnchor" id="parameter-"></div>
143 <b>enabled</b>
144 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
145 <div style="font-size: small">
146 <span style="color: purple">boolean</span>
147 </div>
148 </td>
149 <td>
150 <ul style="margin: 0; padding: 0"><b>Choices:</b>
151 <li>no</li>
152 <li>yes</li>
153 </ul>
154 </td>
155 <td>
156 <div>Enables or disables sflow sampling for the device.</div>
157 </td>
158 </tr>
159 <tr>
160 <td class="elbow-placeholder"></td>
161 <td colspan="2">
162 <div class="ansibleOptionAnchor" id="parameter-"></div>
163 <b>interfaces</b>
164 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
165 <div style="font-size: small">
166 <span style="color: purple">list</span>
167 / <span style="color: purple">elements=dictionary</span>
168 </div>
169 </td>
170 <td>
171 </td>
172 <td>
173 <div>Configuration data for sflow data on interfaces.</div>
174 </td>
175 </tr>
176 <tr>
177 <td class="elbow-placeholder"></td>
178 <td class="elbow-placeholder"></td>
179 <td colspan="1">
180 <div class="ansibleOptionAnchor" id="parameter-"></div>
181 <b>enabled</b>
182 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
183 <div style="font-size: small">
184 <span style="color: purple">boolean</span>
185 </div>
186 </td>
187 <td>
188 <ul style="margin: 0; padding: 0"><b>Choices:</b>
189 <li>no</li>
190 <li>yes</li>
191 </ul>
192 </td>
193 <td>
194 <div>If sflow is globally enabled, enables or disables sflow on the interface</div>
195 </td>
196 </tr>
197 <tr>
198 <td class="elbow-placeholder"></td>
199 <td class="elbow-placeholder"></td>
200 <td colspan="1">
201 <div class="ansibleOptionAnchor" id="parameter-"></div>
202 <b>name</b>
203 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
204 <div style="font-size: small">
205 <span style="color: purple">string</span>
206 / <span style="color: red">required</span>
207 </div>
208 </td>
209 <td>
210 </td>
211 <td>
212 <div>Name of the interface</div>
213 </td>
214 </tr>
215 <tr>
216 <td class="elbow-placeholder"></td>
217 <td class="elbow-placeholder"></td>
218 <td colspan="1">
219 <div class="ansibleOptionAnchor" id="parameter-"></div>
220 <b>sampling_rate</b>
221 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
222 <div style="font-size: small">
223 <span style="color: purple">integer</span>
224 </div>
225 </td>
226 <td>
227 </td>
228 <td>
229 <div>Override the global sampling rate for this interface</div>
230 </td>
231 </tr>
232
233 <tr>
234 <td class="elbow-placeholder"></td>
235 <td colspan="2">
236 <div class="ansibleOptionAnchor" id="parameter-"></div>
237 <b>max_header_size</b>
238 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
239 <div style="font-size: small">
240 <span style="color: purple">integer</span>
241 </div>
242 </td>
243 <td>
244 </td>
245 <td>
246 <div>sflow maximum header size in bytes.</div>
247 <div>must be in multiple of 128 bytes from 128 to 1024.</div>
248 </td>
249 </tr>
250 <tr>
251 <td class="elbow-placeholder"></td>
252 <td colspan="2">
253 <div class="ansibleOptionAnchor" id="parameter-"></div>
254 <b>polling_interval</b>
255 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
256 <div style="font-size: small">
257 <span style="color: purple">integer</span>
258 </div>
259 </td>
260 <td>
261 </td>
262 <td>
263 <div>sflow polling interval (in seconds).</div>
264 <div>must be 0 or in range 5-300</div>
265 </td>
266 </tr>
267 <tr>
268 <td class="elbow-placeholder"></td>
269 <td colspan="2">
270 <div class="ansibleOptionAnchor" id="parameter-"></div>
271 <b>sampling_rate</b>
272 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
273 <div style="font-size: small">
274 <span style="color: purple">integer</span>
275 </div>
276 </td>
277 <td>
278 </td>
279 <td>
280 <div>Sets global packet sampling rate.</div>
281 <div>Sample 1 packet for every sampling_rate number of packets flowing through the interface</div>
282 </td>
283 </tr>
284
285 <tr>
286 <td colspan="3">
287 <div class="ansibleOptionAnchor" id="parameter-"></div>
288 <b>state</b>
289 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
290 <div style="font-size: small">
291 <span style="color: purple">string</span>
292 </div>
293 </td>
294 <td>
295 <ul style="margin: 0; padding: 0"><b>Choices:</b>
296 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
297 <li>replaced</li>
298 <li>overridden</li>
299 <li>deleted</li>
300 </ul>
301 </td>
302 <td>
303 <div>Specifies the type of configuration update to be performed on the device.</div>
304 </td>
305 </tr>
306 </table>
307 <br/>
308
309
310
311
312 Examples
313 --------
314
315 .. code-block:: yaml
316
317 # Using "deleted" state to clear all configuration
318 # Before state:
319 # config:
320 # enabled: false
321 # polling_interval: 40
322 # max_header_size: 256
323 # collectors:
324 # - address: 1.1.1.1
325 # port: 6343
326 # network_instance: default
327 # interfaces:
328 # - name: Ethernet0
329 # sampling_rate: 400000
330
331 # Example
332 - name: "clear all sflow config and disable"
333 sonic_sflow:
334 config: {}
335 state: deleted
336
337 # After state:
338 # Note, "enabled" can't be deleted. It's just set to default. All values that can be cleared are deleted.
339 # config:
340 # enabled: false
341 # (no other recorded config)
342 # ------
343
344 # Using "deleted" state to clear just the interfaces and collectors
345 # Before state:
346 # config:
347 # enabled: True
348 # polling_interval: 40
349 # max_header_size: 256
350 # collectors:
351 # - address: 1.1.1.1
352 # port: 6343
353 # network_instance: default
354 # interfaces:
355 # - name: Ethernet0
356 # sampling_rate: 400000
357
358 # Example
359 - name: "clear all sflow interfaces and collectors"
360 sonic_sflow:
361 config:
362 interfaces: []
363 collectors: []
364 state: deleted
365
366 # After state:
367 # config:
368 # enabled: true
369 # polling_interval: 40
370 # max_header_size: 256
371 # Note: deletes list of items if empty list is provided. Otherwise must specify key and have values match to delete, see other Example
372 # ------
373
374 # Using "deleted" state to delete individual interfaces
375 # Before state:
376 # config:
377 # enabled: false
378 # polling_interval: 40
379 # max_header_size: 256
380 # collectors:
381 # - address: 1.1.1.1
382 # port: 6343
383 # network_instance: default
384 # interfaces:
385 # - name: Ethernet0
386 # sampling_rate: 400000
387 # - name: Ethernet8
388 # enabled: false
389 # - name: Ethernet16
390 # sampling_rate: 400000
391
392 # Example
393 # note: to delete the whole interface, just the name needs to specify the name, nothing else
394 - name: "delete individual interfaces"
395 sonic_sflow:
396 config:
397 interfaces:
398 - name: Ethernet8
399 - name: Ethernet16
400 state: deleted
401
402 # After state:
403 # All configuration deleted for the listed interfaces
404 # config:
405 # enabled: false
406 # polling_interval: 40
407 # max_header_size: 256
408 # collectors:
409 # - address: 1.1.1.1
410 # port: 6343
411 # network_instance: default
412 # interfaces:
413 # - name: Ethernet0
414 # sampling_rate: 400000
415 # ------
416
417 # Using "deleted" state to delete collectors
418 # Before state:
419 # config:
420 # enabled: false
421 # polling_interval: 40
422 # max_header_size: 256
423 # collectors:
424 # - address: 1.1.1.1
425 # port: 6343
426 # network_instance: default
427 # - address: 1.1.1.2
428 # port: 6000
429 # network_instance: "vrf_1"
430 # interfaces:
431 # - name: Ethernet0
432 # sampling_rate: 400000
433
434 # Example:
435 # Note: The values of all three fields must be known to identify a collector, but
436 # the "port" and "network instance" attributes have default values. These default
437 # values do not need to be explicitly specified in a playbook for deletion of a
438 # collector having default values configured for these attributes.
439 - name: "delete individual collectors"
440 sonic_sflow:
441 config:
442 collectors:
443 - address: 1.1.1.2
444 port: 6000
445 network_instance: "vrf_1"
446 - address: 1.1.1.1
447 state: deleted
448
449 # After state:
450 # config:
451 # enabled: false
452 # polling_interval: 40
453 # max_header_size: 256
454 # interfaces:
455 # - name: Ethernet0
456 # sampling_rate: 400000
457 # ------
458
459 # Using "deleted" state to clear individual values
460 # Before state:
461 # config:
462 # enabled: true
463 # polling_interval: 30
464 # max_header_size: 128
465 # sampling_rate: 400000
466 # collectors:
467 # - address: 1.1.1.1
468 # port: 6343
469 # network_instance: default
470 # interfaces:
471 # - name: Ethernet0
472 # enabled: true
473 # sampling_rate: 400000
474 # - name: Ethernet4
475 # enabled: true
476 # sampling_rate: 400002
477
478 # Example
479 - name: "clear specific config attributes if values match"
480 sonic_sflow:
481 config:
482 enabled: false
483 polling_interval: 30
484 max_header_size: 128
485 sampling_rate: 400000
486 interfaces:
487 - name: Ethernet0
488 sampling_rate: 400000
489 state: deleted
490
491 # After state:
492 # config:
493 # enabled: true
494 # collectors:
495 # - address: 1.1.1.1
496 # port: 6343
497 # network_instance: default
498 # interfaces:
499 # - name: Ethernet0
500 # enabled: true
501 # - name: Ethernet4
502 # enabled: true
503 # sampling_rate: 400002
504
505 # ------------
506
507
508 # Using "merged" state to add sflow collector
509 # Before state:
510 # config:
511 # enabled: false
512
513 # Example:
514 - name: "Add an sflow collector with default values for 'port' and 'network_instance"
515 sonic_sflow:
516 config:
517 collectors:
518 - address: 1.1.1.2
519 state: merged
520 # note: There can only be two collectors configured at a time.
521 # note: Only "port" and and "network_instance" have default values.
522
523 # After state:
524 # config:
525 # enabled: false
526 # collectors:
527 # - address: 1.1.1.2
528 # port: 6343
529 # network_instance: default
530 # ------
531
532 # Using "merged" state to add and modify interface configuration
533 # Before state:
534 # config:
535 # enabled: false
536 # interfaces:
537 # - name: Ethernet0
538 # sampling_rate: 400002
539 # - name: Ethernet8
540 # enabled: true
541 # sampling_rate: 400001
542
543 # Example
544 - name: "Add/modify interface settings"
545 sonic_sflow:
546 config:
547 interfaces:
548 - name: Ethernet0
549 enabled: true
550 - name: Ethernet8
551 enabled: false
552 sampling_rate: 400003
553 - name: Ethernet16
554 - name: Ethernet32
555 sampling_rate: 400001
556 state: merged
557 # Note: must set at least one of enabled or sampling_rate for interface to be added
558
559 # After state
560 # config:
561 # enabled: false
562 # interfaces:
563 # - name: Ethernet0
564 # sampling_rate: 400002
565 # enabled: true
566 # - name: Ethernet8
567 # enabled: false
568 # sampling_rate: 400003
569 # - name: Ethernet32
570 # sampling_rate: 400001
571 # ------
572
573 # Using "merged" state to add/modify global settings
574 # Before state:
575 # config:
576 # enabled: false
577 # polling_interval: 40
578 # max_header_size: 256
579
580 # Example
581 - name: "Adding/modifying other settings using 'merged'"
582 sonic_sflow:
583 config:
584 polling_interval: 50
585 enabled: true
586 agent: Ethernet0
587 max_header_size: 128
588 state: merged
589
590 # After state
591 # config:
592 # enabled: true
593 # polling_interval: 50
594 # max_header_size: 128
595 # agent: Ethernet0
596
597 # -----------
598
599
600 # using overridden to override all existing sflow config with the given settings
601 # Before state:
602 # config:
603 # enabled: false
604 # polling_interval: 50
605 # max_header_size: 128
606 # collectors:
607 # - address: 1.1.1.1
608 # port: 6343
609 # network_instance: default
610 # interfaces:
611 # - name: Ethernet0
612 # enabled: false
613 # - name: Ethernet8
614 # enabled: false
615 # - name: Ethernet16
616 # enabled: false
617 # - name: Ethernet24
618 # enabled: false
619
620 # Example:
621 - name: "override all existing sflow config with input config from a playbook task"
622 sonic_sflow:
623 config:
624 enabled: true
625 agent: Ethernet0
626 interfaces:
627 - name: Ethernet0
628 enabled: true
629 state: overridden
630
631 # After state:
632 # config:
633 # enabled: true
634 # agent: Ethernet0
635 # interfaces:
636 # - name: Ethernet0
637 # enabled: true
638 # ------------
639
640
641 # Using "replaced" state to replace specific interface settings
642 # Before state:
643 # config:
644 # enabled: false
645 # polling_interval: 50
646 # max_header_size: 128
647 # collectors:
648 # - address: 1.1.1.1
649 # port: 6343
650 # network_instance: default
651 # interfaces:
652 # - name: Ethernet0
653 # enabled: true
654 # sampling_rate: 400002
655 # - name: Ethernet4
656 # enabled: false
657 # - name: Ethernet8
658 # enabled: false
659 # sampling_rate: 400010
660 # - name: Ethernet24
661 # enabled: false
662
663 # Example:
664 - name: "only add or substitute certain interfaces"
665 sonic_sflow:
666 config:
667 enabled: false
668 polling_interval: 50
669 max_header_size: 128
670 interfaces:
671 - name: Ethernet0
672 sampling_rate: 400010
673 - name: Ethernet4
674 sampling_rate: 400010
675 - name: Ethernet16
676 enabled: false
677 state: replaced
678
679 # After state:
680 # config:
681 # enabled: false
682 # polling_interval: 50
683 # max_header_size: 128
684 # collectors:
685 # - address: 1.1.1.1
686 # port: 6343
687 # network_instance: default
688 # interfaces:
689 # - name: Ethernet0
690 # sampling_rate: 400010
691 # - name: Ethernet4
692 # sampling_rate: 400010
693 # - name: Ethernet8
694 # enabled: false
695 # sampling_rate: 400010
696 # - name: Ethernet16
697 # enabled: false
698 # - name: Ethernet24
699 # enabled: false
700 # ------
701
702 # Using "replaced" state with different top level values replaces nested components.
703 # Before state:
704 # config:
705 # enabled: false
706 # polling_interval: 50
707 # max_header_size: 128
708 # collectors:
709 # - address: 1.1.1.1
710 # port: 6343
711 # network_instance: default
712 # interfaces:
713 # - name: Ethernet0
714 # enabled: false
715 # - name: Ethernet8
716 # enabled: false
717 # - name: Ethernet16
718 # enabled: false
719 # - name: Ethernet24
720 # enabled: false
721
722 # Example:
723 - name: "replaces everything"
724 sonic_sflow:
725 config:
726 enabled: false
727 polling_interval: 30
728 max_header_size: 128
729 state: replaced
730
731 # After state:
732 # config:
733 # enabled: false
734 # polling_interval: 30
735 # max_header_size: 128
736 # -----------
737
738
739
740 Return Values
741 -------------
742 Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
743
744 .. raw:: html
745
746 <table border=0 cellpadding=0 class="documentation-table">
747 <tr>
748 <th colspan="1">Key</th>
749 <th>Returned</th>
750 <th width="100%">Description</th>
751 </tr>
752 <tr>
753 <td colspan="1">
754 <div class="ansibleOptionAnchor" id="return-"></div>
755 <b>after</b>
756 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
757 <div style="font-size: small">
758 <span style="color: purple">dictionary</span>
759 </div>
760 </td>
761 <td>when changed</td>
762 <td>
763 <div>The resulting configuration module invocation.</div>
764 <br/>
765 <div style="font-size: smaller"><b>Sample:</b></div>
766 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned will always be in the same format
767 as the parameters above.</div>
768 </td>
769 </tr>
770 <tr>
771 <td colspan="1">
772 <div class="ansibleOptionAnchor" id="return-"></div>
773 <b>before</b>
774 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
775 <div style="font-size: small">
776 <span style="color: purple">dictionary</span>
777 </div>
778 </td>
779 <td>always</td>
780 <td>
781 <div>The configuration prior to the module invocation.</div>
782 <br/>
783 <div style="font-size: smaller"><b>Sample:</b></div>
784 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned will always be in the same format
785 as the parameters above.</div>
786 </td>
787 </tr>
788 <tr>
789 <td colspan="1">
790 <div class="ansibleOptionAnchor" id="return-"></div>
791 <b>commands</b>
792 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
793 <div style="font-size: small">
794 <span style="color: purple">list</span>
795 </div>
796 </td>
797 <td>always</td>
798 <td>
799 <div>The set of commands pushed to the remote device.</div>
800 <br/>
801 <div style="font-size: smaller"><b>Sample:</b></div>
802 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;command 1&#x27;, &#x27;command 2&#x27;, &#x27;command 3&#x27;]</div>
803 </td>
804 </tr>
805 </table>
806 <br/><br/>
807
808
809 Status
810 ------
811
812
813 Authors
814 ~~~~~~~
815
816 - Xiao Han (@Xiao_Han2)