blob: d47c6a733bfda7f53eda523e8192449ff3bed568 [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
30 import rw-pb-ext {
31 prefix "rwpb";
32 }
33
Rajesh Velandye27e0b22017-09-18 17:21:48 -040034 import vnfd-base {
35 prefix "vnfd-base";
velandy88a64f12017-06-07 23:32:49 -040036 }
37
Rajesh Velandye27e0b22017-09-18 17:21:48 -040038 import project-vnfd {
39 prefix "project-vnfd";
40 }
41
42 import project-nsd {
43 prefix "project-nsd";
velandy88a64f12017-06-07 23:32:49 -040044 }
45
46 import vlr {
47 prefix "vlr";
48 }
49
50 import ietf-yang-types {
51 prefix "yang";
52 }
53
54 import ietf-inet-types {
55 prefix "inet";
56 }
57
Rajesh Velandye27e0b22017-09-18 17:21:48 -040058 import rw-project {
59 prefix "rw-project";
60 }
61
62 revision 2017-02-28 {
63 description
64 "Update model to support projects.";
65 }
66
velandy88a64f12017-06-07 23:32:49 -040067 revision 2015-09-10 {
68 description
69 "Initial revision. This YANG file defines
70 the Virtual Network Function Record (VNFR)";
71 reference
72 "Derived from earlier versions of base YANG files";
73 }
74
75 grouping placement-group-info {
76 list placement-groups-info {
77 description
78 "
79 Placement groups to which this VDU belongs and its
80 cloud construct
81 ";
82 key "name";
83 uses manotypes:placement-group-info;
84 uses manotypes:placement-group-input;
Adam Israelcc14dd72017-06-28 14:31:45 -040085 }
velandy88a64f12017-06-07 23:32:49 -040086 }
Adam Israelcc14dd72017-06-28 14:31:45 -040087
88
velandy88a64f12017-06-07 23:32:49 -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 type enumeration {
102 enum VIRTIO;
103 enum PCI-PASSTHROUGH;
104 enum SR-IOV;
105 }
106 }
107
108 leaf bandwidth {
109 description
110 "Aggregate bandwidth of the NIC.";
111 type uint64;
112 }
113
114 leaf ovs-offload {
115 description
116 "Defines if the NIC supports OVS offload.
117 MANDATORY : OVS offload support in the NIC is mandatory.
118 PREFERRED : OVS offload support in the NIC is preferred.";
119 type enumeration {
120 enum MANDATORY;
121 enum PREFERRED;
122 }
123 }
124
125 leaf vendor-id {
126 description
127 "Specifies the vendor specific id for
128 the device. This is used when a NIC from
129 specific HW vendor is required.";
130 type string;
131 }
132
133 leaf datapath-library {
134 description
135 "Specifies the name and version of the datapath
136 library the NIC is expected to support.";
137 type string;
138 }
139
140 leaf provider-network-name {
141 description
142 "Name of the provider network to which this
143 NIC is attached.";
144 type string;
145 }
146 }
147 }
148
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400149 grouping associated-virtual-cps {
150 list virtual-cps {
151 key "name";
152 uses vnfd-base:common-connection-point;
velandy88a64f12017-06-07 23:32:49 -0400153
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400154 leaf ip-address {
155 description
156 "IP address assigned to the virtual connection point";
157 type inet:ip-address;
velandy88a64f12017-06-07 23:32:49 -0400158 }
159
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400160 leaf mac-address {
velandy88a64f12017-06-07 23:32:49 -0400161 description
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400162 "MAC address assigned to the virtual connection point";
163 type string;
164 }
165
166 leaf connection-point-id {
167 description "VIM identifier for connection point";
168 type string;
169 }
170 }
171 }
172
173 augment "/rw-project:project" {
174 container vnfr-catalog {
175 config false;
176 list vnfr {
177 description
178 "Virtual Network Function Record (VNFR).";
179 key "id";
180 unique "name";
181
182 leaf id {
183 description "Identifier for the VNFR.";
184 type yang:uuid;
185 }
186
187 leaf nsr-id-ref {
188 description
velandy88a64f12017-06-07 23:32:49 -0400189 "NS instance identifier.
190 This is a leafref /nsr:ns-instance-config/nsr:nsr/nsr:id";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400191 type yang:uuid;
velandy88a64f12017-06-07 23:32:49 -0400192 }
velandy88a64f12017-06-07 23:32:49 -0400193
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400194 leaf member-vnf-index-ref {
195 description "Reference to member VNF index in Network service.";
196 type leafref {
197 path "../../../project-nsd:nsd-catalog/project-nsd:nsd/project-nsd:constituent-vnfd/project-nsd:member-vnf-index";
198 }
199 }
velandy88a64f12017-06-07 23:32:49 -0400200
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400201 leaf dashboard-url {
202 description "Dashboard URL";
203 type inet:uri;
204 }
velandy88a64f12017-06-07 23:32:49 -0400205
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400206 leaf name {
207 description "VNFR name.";
208 type string;
209 }
velandy88a64f12017-06-07 23:32:49 -0400210
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400211 leaf short-name {
212 description "VNFR short name.";
213 type string;
214 }
velandy88a64f12017-06-07 23:32:49 -0400215
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400216 leaf vendor {
217 description "Vendor of the VNFR.";
218 type string;
219 }
velandy88a64f12017-06-07 23:32:49 -0400220
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400221 leaf description {
222 description "Description of the VNFR.";
223 type string;
224 }
velandy88a64f12017-06-07 23:32:49 -0400225
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400226 leaf version {
227 description "Version of the VNFR";
228 type string;
229 }
230
231 leaf create-time {
232 description
233 "Creation timestamp of this Virtual Network
Adam Israelcc14dd72017-06-28 14:31:45 -0400234 Function. The timestamp is expressed as
velandy88a64f12017-06-07 23:32:49 -0400235 seconds since unix epoch - 1970-01-01T00:00:00Z";
236
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400237 type uint32;
238 }
velandy88a64f12017-06-07 23:32:49 -0400239
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400240 leaf uptime {
241 description
242 "Active period of this Virtual Network Function.
velandy88a64f12017-06-07 23:32:49 -0400243 Uptime is expressed in seconds";
244
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400245 type uint32;
246 }
velandy88a64f12017-06-07 23:32:49 -0400247
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400248 container vnfd {
249 description "VNF descriptor used to instantiate this VNF";
250 uses vnfd-base:vnfd-descriptor;
251 }
velandy88a64f12017-06-07 23:32:49 -0400252
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400253 leaf vnfd-ref {
254 description "Reference to VNFD";
255 type leafref {
256 path "../../../project-vnfd:vnfd-catalog/project-vnfd:vnfd/project-vnfd:id";
257 }
258 }
259
260 // Use parameters provided here to configure this VNF
Adam Israelcc14dd72017-06-28 14:31:45 -0400261 container vnf-configuration {
262 uses manotypes:vca-configuration;
263 }
velandy88a64f12017-06-07 23:32:49 -0400264
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400265 // Mainly used by Mon-params & dashboard url
266 container mgmt-interface {
267 leaf ip-address {
268 type inet:ip-address;
269 }
velandy88a64f12017-06-07 23:32:49 -0400270
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400271 leaf port {
272 type inet:port-number;
273 }
velandy88a64f12017-06-07 23:32:49 -0400274
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400275 container ssh-key {
276 description "SSH key pair used for this VNF";
277 leaf public-key {
278 description "Public key configured on this VNF";
279 type string;
280 }
281
282 leaf private-key-file {
283 description "Path to the private key file";
284 type string;
285 }
velandy88a64f12017-06-07 23:32:49 -0400286 }
287 }
288
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400289 list internal-vlr {
290 key "vlr-ref";
291
292 leaf vlr-ref {
293 description "Reference to a VLR record in the VLR catalog";
294 type leafref {
295 path "../../../../vlr:vlr-catalog/vlr:vlr/vlr:id";
296 }
297 }
298
299 leaf-list internal-connection-point-ref {
300 type leafref {
301 path "../../vdur/internal-connection-point/id";
302 }
velandy88a64f12017-06-07 23:32:49 -0400303 }
304 }
velandy88a64f12017-06-07 23:32:49 -0400305
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400306 list connection-point {
307 key "name";
308 description
velandy88a64f12017-06-07 23:32:49 -0400309 "List for external connection points. Each VNF has one
310 or more external connection points. As the name
311 implies that external connection points are used for
312 connecting the VNF to other VNFs or to external networks.
313 Each VNF exposes these connection points to the
314 orchestrator. The orchestrator can construct network
315 services by connecting the connection points between
316 different VNFs. The NFVO will use VLDs and VNFFGs at
317 the network service level to construct network services.";
318
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400319 uses vnfd-base:common-connection-point;
velandy88a64f12017-06-07 23:32:49 -0400320
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400321 leaf vlr-ref {
322 description
velandy88a64f12017-06-07 23:32:49 -0400323 "Reference to the VLR associated with this connection point";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400324 type leafref {
325 path "../../../../vlr:vlr-catalog/vlr:vlr/vlr:id";
326 }
velandy88a64f12017-06-07 23:32:49 -0400327 }
velandy88a64f12017-06-07 23:32:49 -0400328
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400329 leaf ip-address {
330 description
velandy88a64f12017-06-07 23:32:49 -0400331 "IP address assigned to the external connection point";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400332 type inet:ip-address;
velandy88a64f12017-06-07 23:32:49 -0400333 }
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400334 leaf mac-address {
335 description
336 "MAC address assigned to the external connection point";
337 // type inet:mac-address;
338 type string;
339 }
340
341 leaf connection-point-id {
342 type string;
343 }
344
345 uses associated-virtual-cps;
velandy88a64f12017-06-07 23:32:49 -0400346 }
347
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400348 list vdur {
349 description "List of Virtual Deployment Units";
350 key "id";
351 unique "name";
velandy88a64f12017-06-07 23:32:49 -0400352
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400353 leaf id {
354 description "Unique id for the VDU";
355 type yang:uuid;
356 }
velandy88a64f12017-06-07 23:32:49 -0400357
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400358 leaf name {
359 description "name of the instantiated VDUR";
360 type string;
361 }
velandy88a64f12017-06-07 23:32:49 -0400362
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400363 leaf unique-short-name {
364 description "Short Unique name of the VDU
365 This will be of the format NSR name-ShortnedString-VDUname
366 NSR name and VDU name shall be constrained to 10 characters";
367 rwpb:field-inline "true";
368 rwpb:field-string-max 64;
369 type string;
370 }
velandy88a64f12017-06-07 23:32:49 -0400371
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400372 leaf vdu-id-ref {
373 type leafref {
374 path "../../vnfd/vdu/id";
375 }
376 }
velandy88a64f12017-06-07 23:32:49 -0400377
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400378 leaf vim-id {
379 description "Allocated VM resource id";
380 type string;
381 }
velandy88a64f12017-06-07 23:32:49 -0400382
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400383 leaf flavor-id {
384 description "VIM assigned flavor id";
385 type string;
386 }
velandy88a64f12017-06-07 23:32:49 -0400387
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400388 leaf image-id {
389 description "VIM assigned image id";
390 type string;
391 }
392
393 leaf management-ip {
394 description "Management IP address";
395 type inet:ip-address;
396 }
397
398 leaf vm-management-ip {
399 description "VM Private Management IP address";
400 type inet:ip-address;
401 }
402
403 leaf console-url {
404 description "Console URL for this VDU, if available";
405 type inet:uri;
406 }
407
408 uses manotypes:vm-flavor;
409 uses manotypes:guest-epa;
410 uses manotypes:vswitch-epa;
411 uses manotypes:hypervisor-epa;
412 uses manotypes:host-epa;
413
414 uses manotypes:supplemental-boot-data;
velandy88a64f12017-06-07 23:32:49 -0400415
Adam Israelcc14dd72017-06-28 14:31:45 -0400416 container vdu-configuration {
417 uses manotypes:vca-configuration;
418 }
419
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400420 list volumes {
421 key "name";
velandy88a64f12017-06-07 23:32:49 -0400422
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400423 leaf name {
424 description "Name of the disk-volumes, e.g. vda, vdb etc";
425 type string;
426 }
427
428 leaf volume-id {
429 description "VIM assigned volume id";
430 type string;
431 }
432
433 uses manotypes:volume-info;
velandy88a64f12017-06-07 23:32:49 -0400434 }
435
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400436 list internal-connection-point {
437 key "id";
438 description
velandy88a64f12017-06-07 23:32:49 -0400439 "List for internal connection points. Each VNFC
440 has zero or more internal connection points.
441 Internal connection points are used for connecting
442 the VNF components internal to the VNF. If a VNF
443 has only one VNFC, it may not have any internal
444 connection points.";
445
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400446 uses vnfd-base:common-connection-point;
velandy88a64f12017-06-07 23:32:49 -0400447
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400448 leaf ip-address {
449 description
velandy88a64f12017-06-07 23:32:49 -0400450 "IP address assigned to the internal connection point";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400451 type inet:ip-address;
452 }
453 leaf mac-address {
454 description
velandy88a64f12017-06-07 23:32:49 -0400455 "MAC address assigned to the internal connection point";
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400456 // type inet:mac-address;
457 type string;
458 }
velandy88a64f12017-06-07 23:32:49 -0400459
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400460 leaf connection-point-id {
461 type string;
462 }
463
464 uses associated-virtual-cps;
465 }
466
467 list interface {
velandy88a64f12017-06-07 23:32:49 -0400468 description
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400469 "List of interfaces (internal and external) for the VNF";
velandy88a64f12017-06-07 23:32:49 -0400470 key name;
471
472 leaf name {
473 description
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400474 "Name of the interface. Note that this
475 name has only local significance to the VDU.";
velandy88a64f12017-06-07 23:32:49 -0400476 type string;
477 }
478
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400479 leaf position {
480 description
481 "Explicit Position of the interface within the list";
482 type uint32;
483 }
484
485 leaf type {
486 description
487 "Type of the Interface";
488
489 type vnfd-base:interface-type;
490
491 default "EXTERNAL";
492 }
493 choice connection-point-type {
494 case internal {
495 leaf internal-connection-point-ref {
496 description
497 "Leaf Ref to the particular internal connection point";
498 type leafref {
499 path "../../internal-connection-point/id";
500 }
501 }
502 }
503 case external {
504 leaf external-connection-point-ref {
505 description
506 "Leaf Ref to the particular external connection point";
507 type leafref {
508 path "../../../connection-point/name";
509 }
510 }
velandy88a64f12017-06-07 23:32:49 -0400511 }
512 }
513 uses virtual-interface;
514 }
515
velandy88a64f12017-06-07 23:32:49 -0400516 leaf operational-status {
517 description
Adam Israelcc14dd72017-06-28 14:31:45 -0400518 "The operational status of the VDU
velandy88a64f12017-06-07 23:32:49 -0400519 init : The VDU has just started.
520 vm-init-phase : The VDUs in the VNF is being created in VIM.
521 vm-alloc-pending : The VM alloc is pending in VIM
522 running : The VDU is active in VM
523 terminate : The VDU is being terminated
524 vm-terminate-phase : The VDU in the VNF is being terminated in VIM.
525 terminated : The VDU is in the terminated state.
526 failed : The VDU instantiation failed.
527 ";
528
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400529 type enumeration {
530 rwpb:enum-type "VduOperationalStatus";
531 enum init;
532 enum vm-init-phase;
533 enum vm-alloc-pending;
534 enum running;
535 enum terminate;
536 enum vl-terminate-phase;
537 enum terminated;
538 enum failed;
539 }
540 }
541
542 uses placement-group-info;
543 }
544
545 uses manotypes:monitoring-param;
546
547 leaf operational-status {
548 description
549 "The operational status of the VNFR instance
550 pre-init : The VNF before Input Param Substitution.
551 init : The VNF has just started.
552 vl-init-phase : The internal VLs in the VNF are being instantiated.
553 vm-init-phase : The VMs for VDUs in the VNF are being instantiated.
554 running : The VNF is in running state.
555 terminate : The VNF is being terminated.
556 vm-terminate-phase : The VMs in the VNF are being terminated.
557 vl-terminate-phase : The internal VLs in the VNF are being terminated.
558 terminated : The VNF is in the terminated state.
559 failed : The VNF instantiation failed
560 ";
561
velandy88a64f12017-06-07 23:32:49 -0400562 type enumeration {
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400563 rwpb:enum-type "VnfrOperationalStatus";
564 enum pre-init;
velandy88a64f12017-06-07 23:32:49 -0400565 enum init;
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400566 enum vl-init-phase;
velandy88a64f12017-06-07 23:32:49 -0400567 enum vm-init-phase;
velandy88a64f12017-06-07 23:32:49 -0400568 enum running;
569 enum terminate;
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400570 enum vm-terminate-phase;
velandy88a64f12017-06-07 23:32:49 -0400571 enum vl-terminate-phase;
572 enum terminated;
573 enum failed;
574 }
575 }
velandy88a64f12017-06-07 23:32:49 -0400576
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400577 leaf config-status {
578 description
579 "The configuration status of the NS instance
velandy88a64f12017-06-07 23:32:49 -0400580 configuring: At least one of the VNFs in this instance is in configuring state
581 configured: All the VNFs in this NS instance are configured or config-not-needed state
582 ";
583
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400584 type enumeration {
585 enum configuring {
586 value 1;
587 }
588 enum configured {
589 value 2;
590 }
591 enum failed {
592 value 3;
593 }
594 enum config-not-needed {
595 value 4;
596 }
velandy88a64f12017-06-07 23:32:49 -0400597 }
598 }
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400599 uses placement-group-info;
velandy88a64f12017-06-07 23:32:49 -0400600
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400601 container cloud-config {
602 rwpb:msg-new VnfrCloudConfig;
603 uses manotypes:cloud-config;
604 }
velandy88a64f12017-06-07 23:32:49 -0400605 }
606 }
607 }
608}