blob: b669f978a61b12ffd5f1e89a5556b508325a7aeb [file] [log] [blame]
velandy88a64f12017-06-07 23:32:49 -04001
2/*
Adam Israelcc14dd72017-06-28 14:31:45 -04003 *
Rajesh Velandye27e0b22017-09-18 17:21:48 -04004 * Copyright 2016-2017 RIFT.IO Inc
velandy88a64f12017-06-07 23:32:49 -04005 *
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 vnfr
22{
23 namespace "urn:ietf:params:xml:ns:yang:nfvo:vnfr";
24 prefix "vnfr";
25
26 import mano-types {
27 prefix "manotypes";
28 }
29
Rajesh Velandye27e0b22017-09-18 17:21:48 -040030 import vnfd-base {
31 prefix "vnfd-base";
velandy88a64f12017-06-07 23:32:49 -040032 }
33
Rajesh Velandye27e0b22017-09-18 17:21:48 -040034 import project-vnfd {
35 prefix "project-vnfd";
36 }
37
38 import project-nsd {
39 prefix "project-nsd";
velandy88a64f12017-06-07 23:32:49 -040040 }
41
42 import vlr {
43 prefix "vlr";
44 }
45
46 import ietf-yang-types {
47 prefix "yang";
48 }
49
50 import ietf-inet-types {
51 prefix "inet";
52 }
53
Rajesh Velandye27e0b22017-09-18 17:21:48 -040054 import rw-project {
55 prefix "rw-project";
56 }
57
58 revision 2017-02-28 {
59 description
60 "Update model to support projects.";
61 }
62
velandy88a64f12017-06-07 23:32:49 -040063 revision 2015-09-10 {
64 description
65 "Initial revision. This YANG file defines
66 the Virtual Network Function Record (VNFR)";
67 reference
68 "Derived from earlier versions of base YANG files";
69 }
70
Rajesh989442e2017-10-08 04:13:32 +000071 typedef vdu-operational-status {
72 type enumeration {
73 enum init;
74 enum vm-init-phase;
75 enum vm-alloc-pending;
76 enum running;
Adam Israelfcfb1cb2017-10-10 12:12:30 -040077 enum upgrading;
Rajesh989442e2017-10-08 04:13:32 +000078 enum terminate;
79 enum vl-terminate-phase;
80 enum terminated;
81 enum failed;
82 }
83 }
84
85 typedef vnf-operational-status {
86 type enumeration {
87 enum pre-init;
88 enum init;
89 enum vl-init-phase;
90 enum vm-init-phase;
91 enum running;
Adam Israelfcfb1cb2017-10-10 12:12:30 -040092 enum upgrading; // Experimental
Rajesh989442e2017-10-08 04:13:32 +000093 enum terminate;
94 enum vm-terminate-phase;
95 enum vl-terminate-phase;
96 enum terminated;
97 enum failed;
98 }
99 }
100
velandy88a64f12017-06-07 23:32:49 -0400101 grouping placement-group-info {
102 list placement-groups-info {
103 description
104 "
105 Placement groups to which this VDU belongs and its
106 cloud construct
107 ";
108 key "name";
109 uses manotypes:placement-group-info;
110 uses manotypes:placement-group-input;
Adam Israelcc14dd72017-06-28 14:31:45 -0400111 }
velandy88a64f12017-06-07 23:32:49 -0400112 }
Adam Israelcc14dd72017-06-28 14:31:45 -0400113
velandy88a64f12017-06-07 23:32:49 -0400114 grouping virtual-interface {
115 container virtual-interface {
116 description
117 "Container for the virtual interface properties";
118
119 leaf type {
120 description
121 "Specifies the type of virtual interface
122 between VM and host.
123 VIRTIO : Use the traditional VIRTIO interface.
124 PCI-PASSTHROUGH : Use PCI-PASSTHROUGH interface.
125 SR-IOV : Use SR-IOV interface.";
126 type enumeration {
127 enum VIRTIO;
128 enum PCI-PASSTHROUGH;
129 enum SR-IOV;
130 }
131 }
132
133 leaf bandwidth {
134 description
135 "Aggregate bandwidth of the NIC.";
136 type uint64;
137 }
138
139 leaf ovs-offload {
140 description
141 "Defines if the NIC supports OVS offload.
142 MANDATORY : OVS offload support in the NIC is mandatory.
143 PREFERRED : OVS offload support in the NIC is preferred.";
144 type enumeration {
145 enum MANDATORY;
146 enum PREFERRED;
147 }
148 }
149
150 leaf vendor-id {
151 description
152 "Specifies the vendor specific id for
153 the device. This is used when a NIC from
154 specific HW vendor is required.";
155 type string;
156 }
157
158 leaf datapath-library {
159 description
160 "Specifies the name and version of the datapath
161 library the NIC is expected to support.";
162 type string;
163 }
164
165 leaf provider-network-name {
166 description
167 "Name of the provider network to which this
168 NIC is attached.";
169 type string;
170 }
171 }
172 }
173
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400174 grouping associated-virtual-cps {
175 list virtual-cps {
176 key "name";
177 uses vnfd-base:common-connection-point;
velandy88a64f12017-06-07 23:32:49 -0400178
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400179 leaf ip-address {
180 description
181 "IP address assigned to the virtual connection point";
182 type inet:ip-address;
velandy88a64f12017-06-07 23:32:49 -0400183 }
184
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400185 leaf mac-address {
velandy88a64f12017-06-07 23:32:49 -0400186 description
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400187 "MAC address assigned to the virtual connection point";
188 type string;
189 }
190
191 leaf connection-point-id {
192 description "VIM identifier for connection point";
193 type string;
194 }
195 }
196 }
197
198 augment "/rw-project:project" {
199 container vnfr-catalog {
200 config false;
201 list vnfr {
202 description
203 "Virtual Network Function Record (VNFR).";
204 key "id";
205 unique "name";
206
207 leaf id {
208 description "Identifier for the VNFR.";
209 type yang:uuid;
210 }
211
212 leaf nsr-id-ref {
213 description
velandy88a64f12017-06-07 23:32:49 -0400214 "NS instance identifier.
215 This is a leafref /nsr:ns-instance-config/nsr:nsr/nsr:id";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400216 type yang:uuid;
velandy88a64f12017-06-07 23:32:49 -0400217 }
velandy88a64f12017-06-07 23:32:49 -0400218
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400219 leaf member-vnf-index-ref {
220 description "Reference to member VNF index in Network service.";
221 type leafref {
222 path "../../../project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:constituent-vnfd/project-nsd:member-vnf-index";
223 }
224 }
velandy88a64f12017-06-07 23:32:49 -0400225
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400226 leaf dashboard-url {
227 description "Dashboard URL";
228 type inet:uri;
229 }
velandy88a64f12017-06-07 23:32:49 -0400230
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400231 leaf name {
232 description "VNFR name.";
233 type string;
234 }
velandy88a64f12017-06-07 23:32:49 -0400235
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400236 leaf short-name {
237 description "VNFR short name.";
238 type string;
239 }
velandy88a64f12017-06-07 23:32:49 -0400240
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400241 leaf vendor {
242 description "Vendor of the VNFR.";
243 type string;
244 }
velandy88a64f12017-06-07 23:32:49 -0400245
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400246 leaf description {
247 description "Description of the VNFR.";
248 type string;
249 }
velandy88a64f12017-06-07 23:32:49 -0400250
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400251 leaf version {
252 description "Version of the VNFR";
253 type string;
254 }
255
256 leaf create-time {
257 description
258 "Creation timestamp of this Virtual Network
Adam Israelcc14dd72017-06-28 14:31:45 -0400259 Function. The timestamp is expressed as
velandy88a64f12017-06-07 23:32:49 -0400260 seconds since unix epoch - 1970-01-01T00:00:00Z";
261
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400262 type uint32;
263 }
velandy88a64f12017-06-07 23:32:49 -0400264
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400265 leaf uptime {
266 description
267 "Active period of this Virtual Network Function.
velandy88a64f12017-06-07 23:32:49 -0400268 Uptime is expressed in seconds";
269
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400270 type uint32;
271 }
velandy88a64f12017-06-07 23:32:49 -0400272
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400273 container vnfd {
274 description "VNF descriptor used to instantiate this VNF";
275 uses vnfd-base:vnfd-descriptor;
276 }
velandy88a64f12017-06-07 23:32:49 -0400277
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400278 leaf vnfd-ref {
279 description "Reference to VNFD";
280 type leafref {
281 path "../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd/project-vnfd:id";
282 }
283 }
284
285 // Use parameters provided here to configure this VNF
Adam Israelcc14dd72017-06-28 14:31:45 -0400286 container vnf-configuration {
287 uses manotypes:vca-configuration;
288 }
velandy88a64f12017-06-07 23:32:49 -0400289
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400290 // Mainly used by Mon-params & dashboard url
291 container mgmt-interface {
292 leaf ip-address {
293 type inet:ip-address;
294 }
velandy88a64f12017-06-07 23:32:49 -0400295
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400296 leaf port {
297 type inet:port-number;
298 }
velandy88a64f12017-06-07 23:32:49 -0400299
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400300 container ssh-key {
301 description "SSH key pair used for this VNF";
302 leaf public-key {
303 description "Public key configured on this VNF";
304 type string;
305 }
306
307 leaf private-key-file {
308 description "Path to the private key file";
309 type string;
310 }
velandy88a64f12017-06-07 23:32:49 -0400311 }
312 }
313
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400314 list internal-vlr {
315 key "vlr-ref";
316
317 leaf vlr-ref {
318 description "Reference to a VLR record in the VLR catalog";
319 type leafref {
320 path "../../../../vlr:vlr-catalog/vlr:vlr/vlr:id";
321 }
322 }
323
324 leaf-list internal-connection-point-ref {
325 type leafref {
326 path "../../vdur/internal-connection-point/id";
327 }
velandy88a64f12017-06-07 23:32:49 -0400328 }
329 }
velandy88a64f12017-06-07 23:32:49 -0400330
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400331 list connection-point {
332 key "name";
333 description
velandy88a64f12017-06-07 23:32:49 -0400334 "List for external connection points. Each VNF has one
335 or more external connection points. As the name
336 implies that external connection points are used for
337 connecting the VNF to other VNFs or to external networks.
338 Each VNF exposes these connection points to the
339 orchestrator. The orchestrator can construct network
340 services by connecting the connection points between
341 different VNFs. The NFVO will use VLDs and VNFFGs at
342 the network service level to construct network services.";
343
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400344 uses vnfd-base:common-connection-point;
velandy88a64f12017-06-07 23:32:49 -0400345
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400346 leaf vlr-ref {
347 description
velandy88a64f12017-06-07 23:32:49 -0400348 "Reference to the VLR associated with this connection point";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400349 type leafref {
350 path "../../../../vlr:vlr-catalog/vlr:vlr/vlr:id";
351 }
velandy88a64f12017-06-07 23:32:49 -0400352 }
velandy88a64f12017-06-07 23:32:49 -0400353
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400354 leaf ip-address {
355 description
velandy88a64f12017-06-07 23:32:49 -0400356 "IP address assigned to the external connection point";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400357 type inet:ip-address;
velandy88a64f12017-06-07 23:32:49 -0400358 }
Rajesh989442e2017-10-08 04:13:32 +0000359
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400360 leaf mac-address {
361 description
362 "MAC address assigned to the external connection point";
363 // type inet:mac-address;
364 type string;
365 }
366
367 leaf connection-point-id {
368 type string;
369 }
370
371 uses associated-virtual-cps;
velandy88a64f12017-06-07 23:32:49 -0400372 }
373
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400374 list vdur {
375 description "List of Virtual Deployment Units";
376 key "id";
377 unique "name";
velandy88a64f12017-06-07 23:32:49 -0400378
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400379 leaf id {
380 description "Unique id for the VDU";
381 type yang:uuid;
382 }
velandy88a64f12017-06-07 23:32:49 -0400383
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400384 leaf name {
385 description "name of the instantiated VDUR";
386 type string;
387 }
velandy88a64f12017-06-07 23:32:49 -0400388
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400389 leaf unique-short-name {
390 description "Short Unique name of the VDU
391 This will be of the format NSR name-ShortnedString-VDUname
392 NSR name and VDU name shall be constrained to 10 characters";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400393 type string;
394 }
velandy88a64f12017-06-07 23:32:49 -0400395
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400396 leaf vdu-id-ref {
397 type leafref {
398 path "../../vnfd/vdu/id";
399 }
400 }
velandy88a64f12017-06-07 23:32:49 -0400401
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400402 leaf vim-id {
403 description "Allocated VM resource id";
404 type string;
405 }
velandy88a64f12017-06-07 23:32:49 -0400406
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400407 leaf flavor-id {
408 description "VIM assigned flavor id";
409 type string;
410 }
velandy88a64f12017-06-07 23:32:49 -0400411
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400412 leaf image-id {
413 description "VIM assigned image id";
414 type string;
415 }
416
417 leaf management-ip {
418 description "Management IP address";
419 type inet:ip-address;
420 }
421
422 leaf vm-management-ip {
423 description "VM Private Management IP address";
424 type inet:ip-address;
425 }
426
427 leaf console-url {
428 description "Console URL for this VDU, if available";
429 type inet:uri;
430 }
431
432 uses manotypes:vm-flavor;
433 uses manotypes:guest-epa;
434 uses manotypes:vswitch-epa;
435 uses manotypes:hypervisor-epa;
436 uses manotypes:host-epa;
437
438 uses manotypes:supplemental-boot-data;
velandy88a64f12017-06-07 23:32:49 -0400439
Adam Israelcc14dd72017-06-28 14:31:45 -0400440 container vdu-configuration {
441 uses manotypes:vca-configuration;
442 }
443
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400444 list volumes {
445 key "name";
velandy88a64f12017-06-07 23:32:49 -0400446
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400447 leaf name {
448 description "Name of the disk-volumes, e.g. vda, vdb etc";
449 type string;
450 }
451
452 leaf volume-id {
453 description "VIM assigned volume id";
454 type string;
455 }
456
457 uses manotypes:volume-info;
velandy88a64f12017-06-07 23:32:49 -0400458 }
459
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400460 list internal-connection-point {
461 key "id";
462 description
velandy88a64f12017-06-07 23:32:49 -0400463 "List for internal connection points. Each VNFC
464 has zero or more internal connection points.
465 Internal connection points are used for connecting
466 the VNF components internal to the VNF. If a VNF
467 has only one VNFC, it may not have any internal
468 connection points.";
469
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400470 uses vnfd-base:common-connection-point;
velandy88a64f12017-06-07 23:32:49 -0400471
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400472 leaf ip-address {
473 description
velandy88a64f12017-06-07 23:32:49 -0400474 "IP address assigned to the internal connection point";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400475 type inet:ip-address;
476 }
Rajesh989442e2017-10-08 04:13:32 +0000477
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400478 leaf mac-address {
479 description
velandy88a64f12017-06-07 23:32:49 -0400480 "MAC address assigned to the internal connection point";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400481 // type inet:mac-address;
482 type string;
483 }
velandy88a64f12017-06-07 23:32:49 -0400484
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400485 leaf connection-point-id {
486 type string;
487 }
488
489 uses associated-virtual-cps;
490 }
491
492 list interface {
velandy88a64f12017-06-07 23:32:49 -0400493 description
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400494 "List of interfaces (internal and external) for the VNF";
velandy88a64f12017-06-07 23:32:49 -0400495 key name;
496
497 leaf name {
498 description
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400499 "Name of the interface. Note that this
500 name has only local significance to the VDU.";
velandy88a64f12017-06-07 23:32:49 -0400501 type string;
502 }
503
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400504 leaf position {
505 description
506 "Explicit Position of the interface within the list";
507 type uint32;
508 }
509
510 leaf type {
511 description
512 "Type of the Interface";
513
514 type vnfd-base:interface-type;
515
516 default "EXTERNAL";
517 }
518 choice connection-point-type {
519 case internal {
520 leaf internal-connection-point-ref {
521 description
522 "Leaf Ref to the particular internal connection point";
523 type leafref {
524 path "../../internal-connection-point/id";
525 }
526 }
527 }
528 case external {
529 leaf external-connection-point-ref {
530 description
531 "Leaf Ref to the particular external connection point";
532 type leafref {
533 path "../../../connection-point/name";
534 }
535 }
velandy88a64f12017-06-07 23:32:49 -0400536 }
537 }
538 uses virtual-interface;
539 }
540
Rajesh989442e2017-10-08 04:13:32 +0000541 leaf operational-status {
542 description
543 "The operational status of the VDU
544 init : The VDU has just started.
545 vm-init-phase : The VDUs in the VNF is being created in VIM.
546 vm-alloc-pending : The VM alloc is pending in VIM
547 running : The VDU is active in VM
Adam Israelfcfb1cb2017-10-10 12:12:30 -0400548 upgrading : The VDU is being upgraded (EXPERIMENTAL)
Rajesh989442e2017-10-08 04:13:32 +0000549 terminate : The VDU is being terminated
550 vm-terminate-phase : The VDU in the VNF is being terminated in VIM.
551 terminated : The VDU is in the terminated state.
552 failed : The VDU instantiation failed.
553 ";
554 type vdu-operational-status;
555 }
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400556
557 uses placement-group-info;
558 }
559
560 uses manotypes:monitoring-param;
561
562 leaf operational-status {
563 description
564 "The operational status of the VNFR instance
565 pre-init : The VNF before Input Param Substitution.
566 init : The VNF has just started.
567 vl-init-phase : The internal VLs in the VNF are being instantiated.
568 vm-init-phase : The VMs for VDUs in the VNF are being instantiated.
569 running : The VNF is in running state.
570 terminate : The VNF is being terminated.
571 vm-terminate-phase : The VMs in the VNF are being terminated.
572 vl-terminate-phase : The internal VLs in the VNF are being terminated.
573 terminated : The VNF is in the terminated state.
574 failed : The VNF instantiation failed
575 ";
Rajesh989442e2017-10-08 04:13:32 +0000576 type vnf-operational-status;
velandy88a64f12017-06-07 23:32:49 -0400577 }
velandy88a64f12017-06-07 23:32:49 -0400578
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400579 leaf config-status {
580 description
581 "The configuration status of the NS instance
velandy88a64f12017-06-07 23:32:49 -0400582 configuring: At least one of the VNFs in this instance is in configuring state
583 configured: All the VNFs in this NS instance are configured or config-not-needed state
584 ";
585
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400586 type enumeration {
587 enum configuring {
588 value 1;
589 }
590 enum configured {
591 value 2;
592 }
593 enum failed {
594 value 3;
595 }
596 enum config-not-needed {
597 value 4;
598 }
velandy88a64f12017-06-07 23:32:49 -0400599 }
600 }
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400601 uses placement-group-info;
velandy88a64f12017-06-07 23:32:49 -0400602
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400603 container cloud-config {
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400604 uses manotypes:cloud-config;
605 }
velandy88a64f12017-06-07 23:32:49 -0400606 }
607 }
608 }
609}