blob: 69f5265e7c531c276b3bf53daf0f5471367a63f8 [file] [log] [blame]
Rajesh Velandye27e0b22017-09-18 17:21:48 -04001
2/*
3 *
4 * Copyright 2017 RIFT.IO Inc
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 *
19 */
20
21module vnfd-base
22{
23 namespace "http://riftio.com/ns/riftware-1.0/vnfd-base";
24 prefix "vnfd-base";
25
26 import mano-types {
27 prefix "manotypes";
28 }
29
30 import ietf-inet-types {
31 prefix "inet";
32 }
33
34 revision 2017-02-28 {
35 description
36 "Initial revision. This YANG file defines
37 the common types for Virtual Network Function
38 (VNF) descriptor";
39 reference
40 "Derived from earlier versions of base YANG files";
41 }
42
43 grouping common-connection-point {
44 leaf name {
45 description "Name of the connection point";
46 type string;
47 }
48
49 leaf id {
50 description "Identifier for the internal connection points";
51 type string;
52 }
53
54 leaf short-name {
55 description "Short name to appear as label in the UI";
56 type string;
57 }
58
59 leaf type {
60 description "Type of the connection point.";
61 type manotypes:connection-point-type;
62 }
63
64 leaf port-security-enabled {
garciadeblas0ec676d2017-12-18 18:22:27 +010065 description "Enables the port security for the port.";
Rajesh Velandye27e0b22017-09-18 17:21:48 -040066 type boolean;
tiernod4f15a72017-10-14 14:28:30 +020067 default true;
Rajesh Velandye27e0b22017-09-18 17:21:48 -040068 }
69 }
70
71 typedef interface-type {
72 type enumeration {
73 enum INTERNAL;
74 enum EXTERNAL;
75 }
76 }
77
Adam Israelfcfb1cb2017-10-10 12:12:30 -040078 typedef vnf-operational-status {
79 type enumeration {
80 enum init;
81 enum running;
82 enum upgrading;
83 enum terminate;
84 enum terminated;
85 enum failed;
86 }
87 }
88
Rajesh Velandye27e0b22017-09-18 17:21:48 -040089 grouping virtual-interface {
90 container virtual-interface {
91 description
92 "Container for the virtual interface properties";
93
94 leaf type {
95 description
96 "Specifies the type of virtual interface
97 between VM and host.
98 VIRTIO : Use the traditional VIRTIO interface.
99 PCI-PASSTHROUGH : Use PCI-PASSTHROUGH interface.
100 SR-IOV : Use SR-IOV interface.
101 E1000 : Emulate E1000 interface.
102 RTL8139 : Emulate RTL8139 interface.
103 PCNET : Emulate PCNET interface.
tierno19a20de2017-11-03 16:29:05 +0100104 OM-MGMT : Deprecated! Use VIRTIO instead and set the VNF management interface at vnfd:mgmt-interface:cp";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400105
106 type enumeration {
107 enum OM-MGMT;
108 enum PCI-PASSTHROUGH;
109 enum SR-IOV;
110 enum VIRTIO;
111 enum E1000;
112 enum RTL8139;
113 enum PCNET;
114 }
115 default "VIRTIO";
116 }
117
118 leaf vpci {
119 description
120 "Specifies the virtual PCI address. Expressed in
121 the following format dddd:dd:dd.d. For example
122 0000:00:12.0. This information can be used to
123 pass as metadata during the VM creation.";
124 type string;
125 }
126
127 leaf bandwidth {
128 description
129 "Aggregate bandwidth of the NIC.";
130 type uint64;
131 }
132 }
133 }
134
135 grouping vnfd-descriptor {
136 leaf id {
137 description "Identifier for the VNFD.";
138 type string {
139 length "1..63";
140 }
141 }
142
143 leaf name {
144 description "VNFD name.";
145 mandatory true;
146 type string;
147 }
148
149 leaf short-name {
150 description "Short name to appear as label in the UI";
151 type string;
152 }
153
154 leaf vendor {
155 description "Vendor of the VNFD.";
156 type string;
157 }
158
159 leaf logo {
160 description
161 "Vendor logo for the Virtual Network Function";
162 type string;
163 }
164
165 leaf description {
166 description "Description of the VNFD.";
167 type string;
168 }
169
170 leaf version {
171 description "Version of the VNFD";
172 type string;
173 }
174
Rajesh Velandyce30ffe2017-09-25 15:15:25 +0000175 container vnf-configuration {
176 uses manotypes:vca-configuration;
177 }
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400178
Adam Israelfcfb1cb2017-10-10 12:12:30 -0400179 leaf operational-status {
180 description
181 "The operational status of the VNF
182 init : The VNF has just started.
183 running : The VNF is active in VM
184 upgrading : The VNF is being upgraded (EXPERIMENTAL)
185 terminate : The VNF is being terminated
186 terminated : The VNF is in the terminated state.
187 failed : The VNF instantiation failed.
188 ";
189 type vnf-operational-status;
190 }
191
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400192 container mgmt-interface {
193 description
194 "Interface over which the VNF is managed.";
195
196 choice endpoint-type {
197 description
198 "Indicates the type of management endpoint.";
199
200 case ip {
201 description
202 "Specifies the static IP address for managing the VNF.";
203 leaf ip-address {
204 type inet:ip-address;
205 }
206 }
207
208 case vdu-id {
209 description
210 "Use the default management interface on this VDU.";
211 leaf vdu-id {
212 type leafref {
213 path "../../vdu/id";
214 }
215 }
216 }
217
218 case cp {
219 description
tierno19a20de2017-11-03 16:29:05 +0100220 "Use the ip address associated with this connection point. This cp is then considered as management.";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400221 leaf cp {
222 type leafref {
223 path "../../connection-point/name";
224 }
225 }
226 }
227 }
228
229 leaf port {
230 description
231 "Port for the management interface.";
232 type inet:port-number;
233 }
234
235 container dashboard-params {
236 description "Parameters for the VNF dashboard";
237
238 leaf path {
239 description "The HTTP path for the dashboard";
240 type string;
241 }
242
243 leaf https {
244 description "Pick HTTPS instead of HTTP , Default is false";
245 type boolean;
246 }
247
248 leaf port {
249 description "The HTTP port for the dashboard";
250 type inet:port-number;
251 }
252 }
253 }
254
255 list internal-vld {
256 key "id";
257 description
258 "List of Internal Virtual Link Descriptors (VLD).
259 The internal VLD describes the basic topology of
260 the connectivity such as E-LAN, E-Line, E-Tree.
261 between internal VNF components of the system.";
262
263 leaf id {
264 description "Identifier for the VLD";
265 type string;
266 }
267
268 leaf name {
269 description "Name of the internal VLD";
270 type string;
271 }
272
273 leaf short-name {
274 description "Short name to appear as label in the UI";
275 type string;
276 }
277
278 leaf description {
279 type string;
280 }
281
282 leaf type {
283 type manotypes:virtual-link-type;
284 }
285
286 leaf root-bandwidth {
287 description
288 "For ELAN this is the aggregate bandwidth.";
289 type uint64;
290 }
291
292 leaf leaf-bandwidth {
293 description
294 "For ELAN this is the bandwidth of branches.";
295 type uint64;
296 }
297
298 list internal-connection-point {
299 key "id-ref";
300 description "List of internal connection points in this VLD";
301 leaf id-ref {
garciadeblas0ec676d2017-12-18 18:22:27 +0100302 description "Reference to the internal connection point id";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400303 type leafref {
304 path "../../../vdu/internal-connection-point/id";
305 }
306 }
garciadeblas0ec676d2017-12-18 18:22:27 +0100307
garciadeblas1edb98c2017-12-05 13:47:09 +0100308 leaf ip-address {
309 description "IP address of the internal connection point";
310 type inet:ip-address;
311 }
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400312 }
313
314 uses manotypes:provider-network;
315 choice init-params {
316 description "Extra parameters for VLD instantiation";
317
318 case vim-network-ref {
319 leaf vim-network-name {
320 description
321 "Name of network in VIM account. This is used to indicate
322 pre-provisioned network name in cloud account.";
323 type string;
324 }
325 }
326
327 case vim-network-profile {
328 leaf ip-profile-ref {
329 description "Named reference to IP-profile object";
330 type string;
331 }
332 }
333
334 }
335 }
336
337 uses manotypes:ip-profile-list;
338
339 list connection-point {
340 key "name";
341 description
342 "List for external connection points. Each VNF has one
343 or more external connection points that connect the VNF
344 to other VNFs or to external networks. Each VNF exposes
345 connection points to the orchestrator, which can construct
346 network services by connecting the connection points
347 between different VNFs. The NFVO will use VLDs and VNFFGs
348 at the network service level to construct network services.";
349
350 uses common-connection-point;
garciadeblasa75e0bb2017-12-12 13:33:33 +0100351
352 leaf internal-vld-ref {
353 description
354 "Reference to an internal VLD of the VNF. This field is
355 optional. It allows exposing an internal VLD through a
356 connection point. When building a NS, this VNF CP might be
357 connected to a NS VLD, then both VLDs (the i-VLD of the VNF and the
358 VLD of the NS) will become the same network and the IP profile will
359 be the one configured at NS level.";
360 type leafref {
361 path "../../internal-vld/id";
362 }
363 }
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400364 }
365
366 list vdu {
367 description "List of Virtual Deployment Units";
368 key "id";
369
370 leaf id {
371 description "Unique id for the VDU";
372 type string;
373 }
374
375 leaf name {
376 description "Unique name for the VDU";
377 type string;
378 }
379
380 leaf description {
381 description "Description of the VDU.";
382 type string;
383 }
384
garciadeblas0ec676d2017-12-18 18:22:27 +0100385 leaf pdu-type {
386 description
387 "Type of PDU. If this field exists, the deployment unit must be
388 understood as a PDU, not as a VDU. This field is used to identify
389 the category of PDU instances to be used at instantiation time. For
390 the instantiation to be successful, there must be available
391 PDU instances of this type in the selected datacenter.";
392 type string;
393 }
394
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400395 leaf count {
396 description "Number of instances of VDU";
397 type uint64;
398 }
399
400 leaf mgmt-vpci {
401 description
402 "Specifies the virtual PCI address. Expressed in
403 the following format dddd:dd:dd.d. For example
404 0000:00:12.0. This information can be used to
405 pass as metadata during the VM creation.";
406 type string;
407 }
408
409 uses manotypes:vm-flavor;
410 uses manotypes:guest-epa;
411 uses manotypes:vswitch-epa;
412 uses manotypes:hypervisor-epa;
413 uses manotypes:host-epa;
414
415 list alarm {
416 key "alarm-id";
417
418 uses manotypes:alarm;
419 }
420
421 uses manotypes:image-properties;
422
garciadeblase304a4d2017-12-05 12:30:17 +0100423 list alternative-images {
424 key "vim-type";
425 description
426 "List of alternative images per VIM type.
427 Different images can be used for specific types of VIMs instead
428 of the default image. This allows deployments in sites where the
429 image identifier in the VIM is given by the VIM provider and
430 cannot be modified.
431 If an alternative image is specified for a VIM type, it will prevail
432 over the default image";
433
434 leaf vim-type {
435 description "VIM type: openvim, openstack, vmware, aws, etc.";
436 type string;
437 }
438
439 uses manotypes:image-properties;
440 }
441
Rajesh Velandyce30ffe2017-09-25 15:15:25 +0000442 container vdu-configuration {
443 uses manotypes:vca-configuration;
444 }
445
garciadeblas8efd85e2018-04-02 17:29:08 +0200446 list monitoring-param {
447 description
448 "List of VDU-related monitoring parameters at NFVI level";
449 key id;
450 leaf id {
451 description "The unique id of the monitoring param at VDU level";
452 type string;
453 }
454
455 leaf nfvi-metric {
456 description "The associated NFVI metric to be monitored";
457 type manotypes:nfvi-metric-type;
458 }
459
460 leaf interface-name-ref {
461 description
462 "Reference to a VDU interface name. Applicable only when the nfvi-metric
463 refers to an interface and not to the VM";
464 type leafref {
465 path "../../interface/name";
466 }
467 }
468 }
469
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400470 choice cloud-init-input {
471 description
472 "Indicates how the contents of cloud-init script are provided.
473 There are 2 choices - inline or in a file";
474
475 case inline {
476 leaf cloud-init {
477 description
478 "Contents of cloud-init script, provided inline, in cloud-config format";
479 type string;
480 }
481 }
482
483 case filename {
484 leaf cloud-init-file {
485 description
486 "Name of file with contents of cloud-init script in cloud-config format";
487 type string;
488 }
489 }
490 }
491
492 uses manotypes:supplemental-boot-data;
493
494 list internal-connection-point {
495 key "id";
496 description
497 "List for internal connection points. Each VNFC
498 has zero or more internal connection points.
499 Internal connection points are used for connecting
500 the VNF with components internal to the VNF. If a VNF
501 has only one VNFC, it may not have any internal
502 connection points.";
503
504 uses common-connection-point;
505
506 leaf internal-vld-ref {
507 type leafref {
508 path "../../../internal-vld/id";
509 }
510 }
511 }
512
513 list interface {
514 description
515 "List of Interfaces (external and internal) for the VNF";
516 key name;
517
518 leaf name {
519 description
520 "Name of the interface. Note that this
521 name has only local significance to the VDU.";
522 type string;
523 }
524
525 leaf position {
526 description
527 "Explicit Position of the interface within the list";
528 type uint32;
529 }
530
531 leaf type {
532 description
533 "Type of the Interface";
534 type interface-type;
535
536 default "EXTERNAL";
537 }
538
garciadeblas98048d22017-12-05 10:30:26 +0100539 leaf mac-address {
540 description
541 "MAC address of the interface.
542 Some VNFs require a specific MAC address to be configured
543 in the interface. While this is not recommended at all in
544 NFV environments, this parameter exists to allow those
545 scenarios.
546 This parameter will be likely deprecated in the future.";
547 type string;
548 }
549
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400550 choice connection-point-type {
551 case internal {
552 leaf internal-connection-point-ref {
553 description
554 "Leaf Ref to the particular internal connection point";
555 type leafref {
556 path "../../internal-connection-point/id";
557 }
558 }
559 }
560 case external {
561 leaf external-connection-point-ref {
562 description
563 "Leaf Ref to the particular external connection point";
564 type leafref {
565 path "../../../connection-point/name";
566 }
567 }
568 }
569 }
570
571 uses virtual-interface;
572 }
573
574
575 list volumes {
576 key "name";
577
578 leaf name {
579 description "Name of the disk-volumes, e.g. vda, vdb etc";
580 type string;
581 }
582
583 uses manotypes:volume-info;
584 }
585 }
586
587 list vdu-dependency {
588 description
589 "List of VDU dependencies.";
590
591 key vdu-source-ref;
592 leaf vdu-source-ref {
593 type leafref {
594 path "../../vdu/id";
595 }
596 }
597
598 leaf vdu-depends-on-ref {
599 description
600 "Reference to the VDU on which
601 the source VDU depends.";
602 type leafref {
603 path "../../vdu/id";
604 }
605 }
606 }
607
608 leaf service-function-chain {
609 description "Type of node in Service Function Chaining Architecture";
610
611 type enumeration {
612 enum UNAWARE;
613 enum CLASSIFIER;
614 enum SF;
615 enum SFF;
616 }
617 default "UNAWARE";
618 }
619
620 leaf service-function-type {
621 description
622 "Type of Service Function.
623 NOTE: This needs to map with Service Function Type in ODL to
624 support VNFFG. Service Function Type is mandatory param in ODL
625 SFC. This is temporarily set to string for ease of use";
626 type string;
627 }
628
garciadeblas8efd85e2018-04-02 17:29:08 +0200629 uses manotypes:http-endpoints;
630
631 list scaling-group-descriptor {
632 description
633 "scaling group descriptor within the VNF.
634 The scaling group defines a group of VDUs,
635 and the ratio of VDUs in the VNF
636 that is used as target for scaling action";
637
638 key "name";
639
640 leaf name {
641 description "Name of this scaling group.";
642 type string;
643 }
644
645 list scaling-policy {
646
647 key "name";
648
649 leaf name {
650 description
651 "Name of the scaling policy";
652 type string;
653 }
654
655 leaf scaling-type {
656 description
657 "Type of scaling";
658 type manotypes:scaling-policy-type;
659 }
660
661 leaf enabled {
662 description
663 "Specifies if the scaling policy can be applied";
664 type boolean;
665 default true;
666 }
667
668 leaf scale-in-operation-type {
669 description
670 "Operation to be applied to check between scaling criterias to
671 check if the scale in threshold condition has been met.
672 Defaults to AND";
673 type manotypes:scaling-criteria-operation;
674 default AND;
675 }
676
677 leaf scale-out-operation-type {
678 description
679 "Operation to be applied to check between scaling criterias to
680 check if the scale out threshold condition has been met.
681 Defauls to OR";
682 type manotypes:scaling-criteria-operation;
683 default OR;
684 }
685
686 leaf threshold-time {
687 description
688 "The duration for which the criteria must hold true";
689 type uint32;
690 mandatory true;
691 }
692
693 leaf cooldown-time {
694 description
695 "The duration after a scaling-in/scaling-out action has been
696 triggered, for which there will be no further optional";
697 type uint32;
698 mandatory true;
699 }
700
701 list scaling-criteria {
702 description
703 "list of conditions to be met for generating scaling
704 requests";
705 key "name";
706
707 leaf name {
708 type string;
709 }
710
711 leaf scale-in-threshold {
712 description
713 "Value below which scale-in requests are generated";
714 type uint64;
715 }
716
717 leaf scale-in-relational-operation {
718 description
719 "The relational operator used to compare the monitoring param
720 against the scale-in-threshold.";
721 type manotypes:relational-operation-type;
722 default LE;
723 }
724
725 leaf scale-out-threshold {
726 description
727 "Value above which scale-out requests are generated";
728 type uint64;
729 }
730
731 leaf scale-out-relational-operation {
732 description
733 "The relational operator used to compare the monitoring param
734 against the scale-out-threshold.";
735 type manotypes:relational-operation-type;
736 default GE;
737 }
738
739 leaf vnf-monitoring-param-ref {
740 description
741 "Reference to the VNF level monitoring parameter
742 that is aggregated";
743 type leafref {
744 path "../../../../monitoring-param/id";
745 }
746 }
747 }
748 }
749
750 list vdu {
751 description "List of VDUs in this scaling group";
752 key "vdu-id-ref";
753
754 leaf vdu-id-ref {
755 description "Reference to the VDU id";
756 type leafref {
757 path "../../../vdu/id";
758 }
759 }
760
761 leaf count {
762 description
763 "count of this VDU id within this scaling group.
764 The count allows to define the number of instances
765 when a scaling action targets this scaling group";
766 type uint32;
767 default 1;
768 }
769 }
770
771 leaf min-instance-count {
772 description
773 "Minimum instances of the scaling group which are allowed.
774 These instances are created by default when the network service
775 is instantiated.";
776 type uint32;
777 default 0;
778 }
779
780 leaf max-instance-count {
781 description
782 "Maximum instances of this scaling group that are allowed
783 in a single network service. The network service scaling
784 will fail, when the number of service group instances
785 exceed the max-instance-count specified.";
786 type uint32;
787 default 10;
788 }
789
790 list scaling-config-action {
791 description "List of scaling config actions";
792 key "trigger";
793
794 leaf trigger {
795 description "scaling trigger";
796 type manotypes:scaling-trigger;
797 }
798
799 leaf vnf-config-primitive-name-ref {
800 description "Reference to the VNF config primitive";
801 type leafref {
802 path "../../../vnf-configuration/config-primitive/name";
803 }
804 }
805 }
806 }
807
808 list monitoring-param {
809 description
810 "List of monitoring parameters at the network service level";
811 key id;
812 leaf id {
813 type string;
814 }
815
816 leaf name {
817 type string;
818 }
819
820 uses manotypes:monitoring-param-aggregation;
821
822 choice monitoring-type {
823 description
824 "Defines the type of monitoring param to be used:
825 * vdu-monitorin-param: VDU-related metric (from NFVI)
826 * vnf-metric: VNF-related metric (from VCA)
827 * vdu-metric: VDU-related metric (from VCA)
828 ";
829
830 case vdu-monitoring-param {
831 description "VDU-related metric from the infrastructure";
832 leaf vdu-ref {
833 type leafref {
834 path "../../vdu/id";
835 }
836 }
837 leaf vdu-monitoring-param-ref {
838 type leafref {
839 path "../../vdu[id = current()/../vdu-ref]/monitoring-param/id";
840 }
841 }
842 }
843
844 case vnf-metric {
845 description "VNF-related metric (from VCA)";
846 leaf vnf-metric-name-ref {
847 type leafref {
848 path "../../vnf-configuration/metrics/name";
849 }
850 }
851 }
852
853 case vdu-metric {
854 description "VDU-related metric (from VCA)";
855 leaf vdu-id-ref {
856 type leafref {
857 path "../../vdu/id";
858 }
859 }
860 leaf vdu-metric-name-ref {
861 type leafref {
862 path "../../vdu[id = current()/../vdu-id-ref]/vdu-configuration/metrics/name";
863 }
864 }
865 }
866
867 }
868
869 leaf http-endpoint-ref {
870 type leafref {
871 path "../../http-endpoint/path";
872 }
873 }
874
875 leaf json-query-method {
876 type manotypes:json-query-method;
877 default "NAMEKEY";
878 }
879
880 container json-query-params {
881 leaf json-path {
882 description
883 "The jsonpath to use to extract value from JSON structure";
884 type string;
885 }
886 leaf object-path {
887 description
888 "The objectpath to use to extract value from JSON structure";
889 type string;
890 }
891 }
892
893 uses manotypes:monitoring-param-ui-data;
894 uses manotypes:monitoring-param-value;
895
896 }
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400897
898 list placement-groups {
899 description "List of placement groups at VNF level";
900
901 key "name";
902 uses manotypes:placement-group-info;
903
904 list member-vdus {
905
906 description
907 "List of VDUs that are part of this placement group";
908 key "member-vdu-ref";
909
910 leaf member-vdu-ref {
911 type leafref {
912 path "../../../vdu/id";
913 }
914 }
915 }
916 }
917 }
918}
919
920// vim: sw=2