blob: ebccf129efb289b36b7fa96cc5c1c7d778d2207e [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;
77 enum terminate;
78 enum vl-terminate-phase;
79 enum terminated;
80 enum failed;
81 }
82 }
83
84 typedef vnf-operational-status {
85 type enumeration {
86 enum pre-init;
87 enum init;
88 enum vl-init-phase;
89 enum vm-init-phase;
90 enum running;
91 enum terminate;
92 enum vm-terminate-phase;
93 enum vl-terminate-phase;
94 enum terminated;
95 enum failed;
96 }
97 }
98
velandy88a64f12017-06-07 23:32:49 -040099 grouping placement-group-info {
100 list placement-groups-info {
101 description
102 "
103 Placement groups to which this VDU belongs and its
104 cloud construct
105 ";
106 key "name";
107 uses manotypes:placement-group-info;
108 uses manotypes:placement-group-input;
Adam Israelcc14dd72017-06-28 14:31:45 -0400109 }
velandy88a64f12017-06-07 23:32:49 -0400110 }
Adam Israelcc14dd72017-06-28 14:31:45 -0400111
velandy88a64f12017-06-07 23:32:49 -0400112 grouping virtual-interface {
113 container virtual-interface {
114 description
115 "Container for the virtual interface properties";
116
117 leaf type {
118 description
119 "Specifies the type of virtual interface
120 between VM and host.
121 VIRTIO : Use the traditional VIRTIO interface.
122 PCI-PASSTHROUGH : Use PCI-PASSTHROUGH interface.
123 SR-IOV : Use SR-IOV interface.";
124 type enumeration {
125 enum VIRTIO;
126 enum PCI-PASSTHROUGH;
127 enum SR-IOV;
128 }
129 }
130
131 leaf bandwidth {
132 description
133 "Aggregate bandwidth of the NIC.";
134 type uint64;
135 }
136
137 leaf ovs-offload {
138 description
139 "Defines if the NIC supports OVS offload.
140 MANDATORY : OVS offload support in the NIC is mandatory.
141 PREFERRED : OVS offload support in the NIC is preferred.";
142 type enumeration {
143 enum MANDATORY;
144 enum PREFERRED;
145 }
146 }
147
148 leaf vendor-id {
149 description
150 "Specifies the vendor specific id for
151 the device. This is used when a NIC from
152 specific HW vendor is required.";
153 type string;
154 }
155
156 leaf datapath-library {
157 description
158 "Specifies the name and version of the datapath
159 library the NIC is expected to support.";
160 type string;
161 }
162
163 leaf provider-network-name {
164 description
165 "Name of the provider network to which this
166 NIC is attached.";
167 type string;
168 }
169 }
170 }
171
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400172 grouping associated-virtual-cps {
173 list virtual-cps {
174 key "name";
175 uses vnfd-base:common-connection-point;
velandy88a64f12017-06-07 23:32:49 -0400176
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400177 leaf ip-address {
178 description
179 "IP address assigned to the virtual connection point";
180 type inet:ip-address;
velandy88a64f12017-06-07 23:32:49 -0400181 }
182
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400183 leaf mac-address {
velandy88a64f12017-06-07 23:32:49 -0400184 description
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400185 "MAC address assigned to the virtual connection point";
186 type string;
187 }
188
189 leaf connection-point-id {
190 description "VIM identifier for connection point";
191 type string;
192 }
193 }
194 }
195
196 augment "/rw-project:project" {
197 container vnfr-catalog {
198 config false;
199 list vnfr {
200 description
201 "Virtual Network Function Record (VNFR).";
202 key "id";
203 unique "name";
204
205 leaf id {
206 description "Identifier for the VNFR.";
207 type yang:uuid;
208 }
209
210 leaf nsr-id-ref {
211 description
velandy88a64f12017-06-07 23:32:49 -0400212 "NS instance identifier.
213 This is a leafref /nsr:ns-instance-config/nsr:nsr/nsr:id";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400214 type yang:uuid;
velandy88a64f12017-06-07 23:32:49 -0400215 }
velandy88a64f12017-06-07 23:32:49 -0400216
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400217 leaf member-vnf-index-ref {
218 description "Reference to member VNF index in Network service.";
219 type leafref {
220 path "../../../project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:constituent-vnfd/project-nsd:member-vnf-index";
221 }
222 }
velandy88a64f12017-06-07 23:32:49 -0400223
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400224 leaf dashboard-url {
225 description "Dashboard URL";
226 type inet:uri;
227 }
velandy88a64f12017-06-07 23:32:49 -0400228
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400229 leaf name {
230 description "VNFR name.";
231 type string;
232 }
velandy88a64f12017-06-07 23:32:49 -0400233
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400234 leaf short-name {
235 description "VNFR short name.";
236 type string;
237 }
velandy88a64f12017-06-07 23:32:49 -0400238
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400239 leaf vendor {
240 description "Vendor of the VNFR.";
241 type string;
242 }
velandy88a64f12017-06-07 23:32:49 -0400243
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400244 leaf description {
245 description "Description of the VNFR.";
246 type string;
247 }
velandy88a64f12017-06-07 23:32:49 -0400248
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400249 leaf version {
250 description "Version of the VNFR";
251 type string;
252 }
253
254 leaf create-time {
255 description
256 "Creation timestamp of this Virtual Network
Adam Israelcc14dd72017-06-28 14:31:45 -0400257 Function. The timestamp is expressed as
velandy88a64f12017-06-07 23:32:49 -0400258 seconds since unix epoch - 1970-01-01T00:00:00Z";
259
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400260 type uint32;
261 }
velandy88a64f12017-06-07 23:32:49 -0400262
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400263 leaf uptime {
264 description
265 "Active period of this Virtual Network Function.
velandy88a64f12017-06-07 23:32:49 -0400266 Uptime is expressed in seconds";
267
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400268 type uint32;
269 }
velandy88a64f12017-06-07 23:32:49 -0400270
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400271 container vnfd {
272 description "VNF descriptor used to instantiate this VNF";
273 uses vnfd-base:vnfd-descriptor;
274 }
velandy88a64f12017-06-07 23:32:49 -0400275
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400276 leaf vnfd-ref {
277 description "Reference to VNFD";
278 type leafref {
279 path "../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd/project-vnfd:id";
280 }
281 }
282
283 // Use parameters provided here to configure this VNF
Adam Israelcc14dd72017-06-28 14:31:45 -0400284 container vnf-configuration {
285 uses manotypes:vca-configuration;
286 }
velandy88a64f12017-06-07 23:32:49 -0400287
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400288 // Mainly used by Mon-params & dashboard url
289 container mgmt-interface {
290 leaf ip-address {
291 type inet:ip-address;
292 }
velandy88a64f12017-06-07 23:32:49 -0400293
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400294 leaf port {
295 type inet:port-number;
296 }
velandy88a64f12017-06-07 23:32:49 -0400297
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400298 container ssh-key {
299 description "SSH key pair used for this VNF";
300 leaf public-key {
301 description "Public key configured on this VNF";
302 type string;
303 }
304
305 leaf private-key-file {
306 description "Path to the private key file";
307 type string;
308 }
velandy88a64f12017-06-07 23:32:49 -0400309 }
310 }
311
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400312 list internal-vlr {
313 key "vlr-ref";
314
315 leaf vlr-ref {
316 description "Reference to a VLR record in the VLR catalog";
317 type leafref {
318 path "../../../../vlr:vlr-catalog/vlr:vlr/vlr:id";
319 }
320 }
321
322 leaf-list internal-connection-point-ref {
323 type leafref {
324 path "../../vdur/internal-connection-point/id";
325 }
velandy88a64f12017-06-07 23:32:49 -0400326 }
327 }
velandy88a64f12017-06-07 23:32:49 -0400328
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400329 list connection-point {
330 key "name";
331 description
velandy88a64f12017-06-07 23:32:49 -0400332 "List for external connection points. Each VNF has one
333 or more external connection points. As the name
334 implies that external connection points are used for
335 connecting the VNF to other VNFs or to external networks.
336 Each VNF exposes these connection points to the
337 orchestrator. The orchestrator can construct network
338 services by connecting the connection points between
339 different VNFs. The NFVO will use VLDs and VNFFGs at
340 the network service level to construct network services.";
341
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400342 uses vnfd-base:common-connection-point;
velandy88a64f12017-06-07 23:32:49 -0400343
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400344 leaf vlr-ref {
345 description
velandy88a64f12017-06-07 23:32:49 -0400346 "Reference to the VLR associated with this connection point";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400347 type leafref {
348 path "../../../../vlr:vlr-catalog/vlr:vlr/vlr:id";
349 }
velandy88a64f12017-06-07 23:32:49 -0400350 }
velandy88a64f12017-06-07 23:32:49 -0400351
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400352 leaf ip-address {
353 description
velandy88a64f12017-06-07 23:32:49 -0400354 "IP address assigned to the external connection point";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400355 type inet:ip-address;
velandy88a64f12017-06-07 23:32:49 -0400356 }
Rajesh989442e2017-10-08 04:13:32 +0000357
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400358 leaf mac-address {
359 description
360 "MAC address assigned to the external connection point";
361 // type inet:mac-address;
362 type string;
363 }
364
365 leaf connection-point-id {
366 type string;
367 }
368
369 uses associated-virtual-cps;
velandy88a64f12017-06-07 23:32:49 -0400370 }
371
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400372 list vdur {
373 description "List of Virtual Deployment Units";
374 key "id";
375 unique "name";
velandy88a64f12017-06-07 23:32:49 -0400376
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400377 leaf id {
378 description "Unique id for the VDU";
379 type yang:uuid;
380 }
velandy88a64f12017-06-07 23:32:49 -0400381
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400382 leaf name {
383 description "name of the instantiated VDUR";
384 type string;
385 }
velandy88a64f12017-06-07 23:32:49 -0400386
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400387 leaf unique-short-name {
388 description "Short Unique name of the VDU
389 This will be of the format NSR name-ShortnedString-VDUname
390 NSR name and VDU name shall be constrained to 10 characters";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400391 type string;
392 }
velandy88a64f12017-06-07 23:32:49 -0400393
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400394 leaf vdu-id-ref {
395 type leafref {
396 path "../../vnfd/vdu/id";
397 }
398 }
velandy88a64f12017-06-07 23:32:49 -0400399
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400400 leaf vim-id {
401 description "Allocated VM resource id";
402 type string;
403 }
velandy88a64f12017-06-07 23:32:49 -0400404
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400405 leaf flavor-id {
406 description "VIM assigned flavor id";
407 type string;
408 }
velandy88a64f12017-06-07 23:32:49 -0400409
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400410 leaf image-id {
411 description "VIM assigned image id";
412 type string;
413 }
414
415 leaf management-ip {
416 description "Management IP address";
417 type inet:ip-address;
418 }
419
420 leaf vm-management-ip {
421 description "VM Private Management IP address";
422 type inet:ip-address;
423 }
424
425 leaf console-url {
426 description "Console URL for this VDU, if available";
427 type inet:uri;
428 }
429
430 uses manotypes:vm-flavor;
431 uses manotypes:guest-epa;
432 uses manotypes:vswitch-epa;
433 uses manotypes:hypervisor-epa;
434 uses manotypes:host-epa;
435
436 uses manotypes:supplemental-boot-data;
velandy88a64f12017-06-07 23:32:49 -0400437
Adam Israelcc14dd72017-06-28 14:31:45 -0400438 container vdu-configuration {
439 uses manotypes:vca-configuration;
440 }
441
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400442 list volumes {
443 key "name";
velandy88a64f12017-06-07 23:32:49 -0400444
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400445 leaf name {
446 description "Name of the disk-volumes, e.g. vda, vdb etc";
447 type string;
448 }
449
450 leaf volume-id {
451 description "VIM assigned volume id";
452 type string;
453 }
454
455 uses manotypes:volume-info;
velandy88a64f12017-06-07 23:32:49 -0400456 }
457
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400458 list internal-connection-point {
459 key "id";
460 description
velandy88a64f12017-06-07 23:32:49 -0400461 "List for internal connection points. Each VNFC
462 has zero or more internal connection points.
463 Internal connection points are used for connecting
464 the VNF components internal to the VNF. If a VNF
465 has only one VNFC, it may not have any internal
466 connection points.";
467
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400468 uses vnfd-base:common-connection-point;
velandy88a64f12017-06-07 23:32:49 -0400469
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400470 leaf ip-address {
471 description
velandy88a64f12017-06-07 23:32:49 -0400472 "IP address assigned to the internal connection point";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400473 type inet:ip-address;
474 }
Rajesh989442e2017-10-08 04:13:32 +0000475
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400476 leaf mac-address {
477 description
velandy88a64f12017-06-07 23:32:49 -0400478 "MAC address assigned to the internal connection point";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400479 // type inet:mac-address;
480 type string;
481 }
velandy88a64f12017-06-07 23:32:49 -0400482
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400483 leaf connection-point-id {
484 type string;
485 }
486
487 uses associated-virtual-cps;
488 }
489
490 list interface {
velandy88a64f12017-06-07 23:32:49 -0400491 description
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400492 "List of interfaces (internal and external) for the VNF";
velandy88a64f12017-06-07 23:32:49 -0400493 key name;
494
495 leaf name {
496 description
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400497 "Name of the interface. Note that this
498 name has only local significance to the VDU.";
velandy88a64f12017-06-07 23:32:49 -0400499 type string;
500 }
501
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400502 leaf position {
503 description
504 "Explicit Position of the interface within the list";
505 type uint32;
506 }
507
508 leaf type {
509 description
510 "Type of the Interface";
511
512 type vnfd-base:interface-type;
513
514 default "EXTERNAL";
515 }
516 choice connection-point-type {
517 case internal {
518 leaf internal-connection-point-ref {
519 description
520 "Leaf Ref to the particular internal connection point";
521 type leafref {
522 path "../../internal-connection-point/id";
523 }
524 }
525 }
526 case external {
527 leaf external-connection-point-ref {
528 description
529 "Leaf Ref to the particular external connection point";
530 type leafref {
531 path "../../../connection-point/name";
532 }
533 }
velandy88a64f12017-06-07 23:32:49 -0400534 }
535 }
536 uses virtual-interface;
537 }
538
Rajesh989442e2017-10-08 04:13:32 +0000539 leaf operational-status {
540 description
541 "The operational status of the VDU
542 init : The VDU has just started.
543 vm-init-phase : The VDUs in the VNF is being created in VIM.
544 vm-alloc-pending : The VM alloc is pending in VIM
545 running : The VDU is active in VM
546 terminate : The VDU is being terminated
547 vm-terminate-phase : The VDU in the VNF is being terminated in VIM.
548 terminated : The VDU is in the terminated state.
549 failed : The VDU instantiation failed.
550 ";
551 type vdu-operational-status;
552 }
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400553
554 uses placement-group-info;
555 }
556
557 uses manotypes:monitoring-param;
558
559 leaf operational-status {
560 description
561 "The operational status of the VNFR instance
562 pre-init : The VNF before Input Param Substitution.
563 init : The VNF has just started.
564 vl-init-phase : The internal VLs in the VNF are being instantiated.
565 vm-init-phase : The VMs for VDUs in the VNF are being instantiated.
566 running : The VNF is in running state.
567 terminate : The VNF is being terminated.
568 vm-terminate-phase : The VMs in the VNF are being terminated.
569 vl-terminate-phase : The internal VLs in the VNF are being terminated.
570 terminated : The VNF is in the terminated state.
571 failed : The VNF instantiation failed
572 ";
Rajesh989442e2017-10-08 04:13:32 +0000573 type vnf-operational-status;
velandy88a64f12017-06-07 23:32:49 -0400574 }
velandy88a64f12017-06-07 23:32:49 -0400575
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400576 leaf config-status {
577 description
578 "The configuration status of the NS instance
velandy88a64f12017-06-07 23:32:49 -0400579 configuring: At least one of the VNFs in this instance is in configuring state
580 configured: All the VNFs in this NS instance are configured or config-not-needed state
581 ";
582
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400583 type enumeration {
584 enum configuring {
585 value 1;
586 }
587 enum configured {
588 value 2;
589 }
590 enum failed {
591 value 3;
592 }
593 enum config-not-needed {
594 value 4;
595 }
velandy88a64f12017-06-07 23:32:49 -0400596 }
597 }
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400598 uses placement-group-info;
velandy88a64f12017-06-07 23:32:49 -0400599
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400600 container cloud-config {
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400601 uses manotypes:cloud-config;
602 }
velandy88a64f12017-06-07 23:32:49 -0400603 }
604 }
605 }
606}