| Rajesh Velandy | e27e0b2 | 2017-09-18 17:21:48 -0400 | [diff] [blame] | 1 | |
| 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 | |
| 21 | module 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 { |
| 65 | description "Enables the port security for the port"; |
| 66 | type boolean; |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | typedef interface-type { |
| 71 | type enumeration { |
| 72 | enum INTERNAL; |
| 73 | enum EXTERNAL; |
| 74 | } |
| 75 | } |
| 76 | |
| Adam Israel | fcfb1cb | 2017-10-10 12:12:30 -0400 | [diff] [blame] | 77 | typedef vnf-operational-status { |
| 78 | type enumeration { |
| 79 | enum init; |
| 80 | enum running; |
| 81 | enum upgrading; |
| 82 | enum terminate; |
| 83 | enum terminated; |
| 84 | enum failed; |
| 85 | } |
| 86 | } |
| 87 | |
| Rajesh Velandy | e27e0b2 | 2017-09-18 17:21:48 -0400 | [diff] [blame] | 88 | grouping virtual-interface { |
| 89 | container virtual-interface { |
| 90 | description |
| 91 | "Container for the virtual interface properties"; |
| 92 | |
| 93 | leaf type { |
| 94 | description |
| 95 | "Specifies the type of virtual interface |
| 96 | between VM and host. |
| 97 | VIRTIO : Use the traditional VIRTIO interface. |
| 98 | PCI-PASSTHROUGH : Use PCI-PASSTHROUGH interface. |
| 99 | SR-IOV : Use SR-IOV interface. |
| 100 | E1000 : Emulate E1000 interface. |
| 101 | RTL8139 : Emulate RTL8139 interface. |
| 102 | PCNET : Emulate PCNET interface. |
| tierno | 19a20de | 2017-11-03 16:29:05 +0100 | [diff] [blame] | 103 | OM-MGMT : Deprecated! Use VIRTIO instead and set the VNF management interface at vnfd:mgmt-interface:cp"; |
| Rajesh Velandy | e27e0b2 | 2017-09-18 17:21:48 -0400 | [diff] [blame] | 104 | |
| 105 | type enumeration { |
| 106 | enum OM-MGMT; |
| 107 | enum PCI-PASSTHROUGH; |
| 108 | enum SR-IOV; |
| 109 | enum VIRTIO; |
| 110 | enum E1000; |
| 111 | enum RTL8139; |
| 112 | enum PCNET; |
| 113 | } |
| 114 | default "VIRTIO"; |
| 115 | } |
| 116 | |
| 117 | leaf vpci { |
| 118 | description |
| 119 | "Specifies the virtual PCI address. Expressed in |
| 120 | the following format dddd:dd:dd.d. For example |
| 121 | 0000:00:12.0. This information can be used to |
| 122 | pass as metadata during the VM creation."; |
| 123 | type string; |
| 124 | } |
| 125 | |
| 126 | leaf bandwidth { |
| 127 | description |
| 128 | "Aggregate bandwidth of the NIC."; |
| 129 | type uint64; |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | grouping vnfd-descriptor { |
| 135 | leaf id { |
| 136 | description "Identifier for the VNFD."; |
| 137 | type string { |
| 138 | length "1..63"; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | leaf name { |
| 143 | description "VNFD name."; |
| 144 | mandatory true; |
| 145 | type string; |
| 146 | } |
| 147 | |
| 148 | leaf short-name { |
| 149 | description "Short name to appear as label in the UI"; |
| 150 | type string; |
| 151 | } |
| 152 | |
| 153 | leaf vendor { |
| 154 | description "Vendor of the VNFD."; |
| 155 | type string; |
| 156 | } |
| 157 | |
| 158 | leaf logo { |
| 159 | description |
| 160 | "Vendor logo for the Virtual Network Function"; |
| 161 | type string; |
| 162 | } |
| 163 | |
| 164 | leaf description { |
| 165 | description "Description of the VNFD."; |
| 166 | type string; |
| 167 | } |
| 168 | |
| 169 | leaf version { |
| 170 | description "Version of the VNFD"; |
| 171 | type string; |
| 172 | } |
| 173 | |
| Rajesh Velandy | ce30ffe | 2017-09-25 15:15:25 +0000 | [diff] [blame] | 174 | container vnf-configuration { |
| 175 | uses manotypes:vca-configuration; |
| 176 | } |
| Rajesh Velandy | e27e0b2 | 2017-09-18 17:21:48 -0400 | [diff] [blame] | 177 | |
| Adam Israel | fcfb1cb | 2017-10-10 12:12:30 -0400 | [diff] [blame] | 178 | leaf operational-status { |
| 179 | description |
| 180 | "The operational status of the VNF |
| 181 | init : The VNF has just started. |
| 182 | running : The VNF is active in VM |
| 183 | upgrading : The VNF is being upgraded (EXPERIMENTAL) |
| 184 | terminate : The VNF is being terminated |
| 185 | terminated : The VNF is in the terminated state. |
| 186 | failed : The VNF instantiation failed. |
| 187 | "; |
| 188 | type vnf-operational-status; |
| 189 | } |
| 190 | |
| Rajesh Velandy | e27e0b2 | 2017-09-18 17:21:48 -0400 | [diff] [blame] | 191 | container mgmt-interface { |
| 192 | description |
| 193 | "Interface over which the VNF is managed."; |
| 194 | |
| 195 | choice endpoint-type { |
| 196 | description |
| 197 | "Indicates the type of management endpoint."; |
| 198 | |
| 199 | case ip { |
| 200 | description |
| 201 | "Specifies the static IP address for managing the VNF."; |
| 202 | leaf ip-address { |
| 203 | type inet:ip-address; |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | case vdu-id { |
| 208 | description |
| 209 | "Use the default management interface on this VDU."; |
| 210 | leaf vdu-id { |
| 211 | type leafref { |
| 212 | path "../../vdu/id"; |
| 213 | } |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | case cp { |
| 218 | description |
| tierno | 19a20de | 2017-11-03 16:29:05 +0100 | [diff] [blame] | 219 | "Use the ip address associated with this connection point. This cp is then considered as management."; |
| Rajesh Velandy | e27e0b2 | 2017-09-18 17:21:48 -0400 | [diff] [blame] | 220 | leaf cp { |
| 221 | type leafref { |
| 222 | path "../../connection-point/name"; |
| 223 | } |
| 224 | } |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | leaf port { |
| 229 | description |
| 230 | "Port for the management interface."; |
| 231 | type inet:port-number; |
| 232 | } |
| 233 | |
| 234 | container dashboard-params { |
| 235 | description "Parameters for the VNF dashboard"; |
| 236 | |
| 237 | leaf path { |
| 238 | description "The HTTP path for the dashboard"; |
| 239 | type string; |
| 240 | } |
| 241 | |
| 242 | leaf https { |
| 243 | description "Pick HTTPS instead of HTTP , Default is false"; |
| 244 | type boolean; |
| 245 | } |
| 246 | |
| 247 | leaf port { |
| 248 | description "The HTTP port for the dashboard"; |
| 249 | type inet:port-number; |
| 250 | } |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | list internal-vld { |
| 255 | key "id"; |
| 256 | description |
| 257 | "List of Internal Virtual Link Descriptors (VLD). |
| 258 | The internal VLD describes the basic topology of |
| 259 | the connectivity such as E-LAN, E-Line, E-Tree. |
| 260 | between internal VNF components of the system."; |
| 261 | |
| 262 | leaf id { |
| 263 | description "Identifier for the VLD"; |
| 264 | type string; |
| 265 | } |
| 266 | |
| 267 | leaf name { |
| 268 | description "Name of the internal VLD"; |
| 269 | type string; |
| 270 | } |
| 271 | |
| 272 | leaf short-name { |
| 273 | description "Short name to appear as label in the UI"; |
| 274 | type string; |
| 275 | } |
| 276 | |
| 277 | leaf description { |
| 278 | type string; |
| 279 | } |
| 280 | |
| 281 | leaf type { |
| 282 | type manotypes:virtual-link-type; |
| 283 | } |
| 284 | |
| 285 | leaf root-bandwidth { |
| 286 | description |
| 287 | "For ELAN this is the aggregate bandwidth."; |
| 288 | type uint64; |
| 289 | } |
| 290 | |
| 291 | leaf leaf-bandwidth { |
| 292 | description |
| 293 | "For ELAN this is the bandwidth of branches."; |
| 294 | type uint64; |
| 295 | } |
| 296 | |
| 297 | list internal-connection-point { |
| 298 | key "id-ref"; |
| 299 | description "List of internal connection points in this VLD"; |
| 300 | leaf id-ref { |
| 301 | description "reference to the internal connection point id"; |
| 302 | type leafref { |
| 303 | path "../../../vdu/internal-connection-point/id"; |
| 304 | } |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | uses manotypes:provider-network; |
| 309 | choice init-params { |
| 310 | description "Extra parameters for VLD instantiation"; |
| 311 | |
| 312 | case vim-network-ref { |
| 313 | leaf vim-network-name { |
| 314 | description |
| 315 | "Name of network in VIM account. This is used to indicate |
| 316 | pre-provisioned network name in cloud account."; |
| 317 | type string; |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | case vim-network-profile { |
| 322 | leaf ip-profile-ref { |
| 323 | description "Named reference to IP-profile object"; |
| 324 | type string; |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | uses manotypes:ip-profile-list; |
| 332 | |
| 333 | list connection-point { |
| 334 | key "name"; |
| 335 | description |
| 336 | "List for external connection points. Each VNF has one |
| 337 | or more external connection points that connect the VNF |
| 338 | to other VNFs or to external networks. Each VNF exposes |
| 339 | connection points to the orchestrator, which can construct |
| 340 | network services by connecting the connection points |
| 341 | between different VNFs. The NFVO will use VLDs and VNFFGs |
| 342 | at the network service level to construct network services."; |
| 343 | |
| 344 | uses common-connection-point; |
| 345 | } |
| 346 | |
| 347 | list vdu { |
| 348 | description "List of Virtual Deployment Units"; |
| 349 | key "id"; |
| 350 | |
| 351 | leaf id { |
| 352 | description "Unique id for the VDU"; |
| 353 | type string; |
| 354 | } |
| 355 | |
| 356 | leaf name { |
| 357 | description "Unique name for the VDU"; |
| 358 | type string; |
| 359 | } |
| 360 | |
| 361 | leaf description { |
| 362 | description "Description of the VDU."; |
| 363 | type string; |
| 364 | } |
| 365 | |
| 366 | leaf count { |
| 367 | description "Number of instances of VDU"; |
| 368 | type uint64; |
| 369 | } |
| 370 | |
| 371 | leaf mgmt-vpci { |
| 372 | description |
| 373 | "Specifies the virtual PCI address. Expressed in |
| 374 | the following format dddd:dd:dd.d. For example |
| 375 | 0000:00:12.0. This information can be used to |
| 376 | pass as metadata during the VM creation."; |
| 377 | type string; |
| 378 | } |
| 379 | |
| 380 | uses manotypes:vm-flavor; |
| 381 | uses manotypes:guest-epa; |
| 382 | uses manotypes:vswitch-epa; |
| 383 | uses manotypes:hypervisor-epa; |
| 384 | uses manotypes:host-epa; |
| 385 | |
| 386 | list alarm { |
| 387 | key "alarm-id"; |
| 388 | |
| 389 | uses manotypes:alarm; |
| 390 | } |
| 391 | |
| 392 | uses manotypes:image-properties; |
| 393 | |
| Rajesh Velandy | ce30ffe | 2017-09-25 15:15:25 +0000 | [diff] [blame] | 394 | container vdu-configuration { |
| 395 | uses manotypes:vca-configuration; |
| 396 | } |
| 397 | |
| Rajesh Velandy | e27e0b2 | 2017-09-18 17:21:48 -0400 | [diff] [blame] | 398 | choice cloud-init-input { |
| 399 | description |
| 400 | "Indicates how the contents of cloud-init script are provided. |
| 401 | There are 2 choices - inline or in a file"; |
| 402 | |
| 403 | case inline { |
| 404 | leaf cloud-init { |
| 405 | description |
| 406 | "Contents of cloud-init script, provided inline, in cloud-config format"; |
| 407 | type string; |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | case filename { |
| 412 | leaf cloud-init-file { |
| 413 | description |
| 414 | "Name of file with contents of cloud-init script in cloud-config format"; |
| 415 | type string; |
| 416 | } |
| 417 | } |
| 418 | } |
| 419 | |
| 420 | uses manotypes:supplemental-boot-data; |
| 421 | |
| 422 | list internal-connection-point { |
| 423 | key "id"; |
| 424 | description |
| 425 | "List for internal connection points. Each VNFC |
| 426 | has zero or more internal connection points. |
| 427 | Internal connection points are used for connecting |
| 428 | the VNF with components internal to the VNF. If a VNF |
| 429 | has only one VNFC, it may not have any internal |
| 430 | connection points."; |
| 431 | |
| 432 | uses common-connection-point; |
| 433 | |
| 434 | leaf internal-vld-ref { |
| 435 | type leafref { |
| 436 | path "../../../internal-vld/id"; |
| 437 | } |
| 438 | } |
| 439 | } |
| 440 | |
| 441 | list interface { |
| 442 | description |
| 443 | "List of Interfaces (external and internal) for the VNF"; |
| 444 | key name; |
| 445 | |
| 446 | leaf name { |
| 447 | description |
| 448 | "Name of the interface. Note that this |
| 449 | name has only local significance to the VDU."; |
| 450 | type string; |
| 451 | } |
| 452 | |
| 453 | leaf position { |
| 454 | description |
| 455 | "Explicit Position of the interface within the list"; |
| 456 | type uint32; |
| 457 | } |
| 458 | |
| 459 | leaf type { |
| 460 | description |
| 461 | "Type of the Interface"; |
| 462 | type interface-type; |
| 463 | |
| 464 | default "EXTERNAL"; |
| 465 | } |
| 466 | |
| 467 | choice connection-point-type { |
| 468 | case internal { |
| 469 | leaf internal-connection-point-ref { |
| 470 | description |
| 471 | "Leaf Ref to the particular internal connection point"; |
| 472 | type leafref { |
| 473 | path "../../internal-connection-point/id"; |
| 474 | } |
| 475 | } |
| 476 | } |
| 477 | case external { |
| 478 | leaf external-connection-point-ref { |
| 479 | description |
| 480 | "Leaf Ref to the particular external connection point"; |
| 481 | type leafref { |
| 482 | path "../../../connection-point/name"; |
| 483 | } |
| 484 | } |
| 485 | } |
| 486 | } |
| 487 | |
| 488 | uses virtual-interface; |
| 489 | } |
| 490 | |
| 491 | |
| 492 | list volumes { |
| 493 | key "name"; |
| 494 | |
| 495 | leaf name { |
| 496 | description "Name of the disk-volumes, e.g. vda, vdb etc"; |
| 497 | type string; |
| 498 | } |
| 499 | |
| 500 | uses manotypes:volume-info; |
| 501 | } |
| 502 | } |
| 503 | |
| 504 | list vdu-dependency { |
| 505 | description |
| 506 | "List of VDU dependencies."; |
| 507 | |
| 508 | key vdu-source-ref; |
| 509 | leaf vdu-source-ref { |
| 510 | type leafref { |
| 511 | path "../../vdu/id"; |
| 512 | } |
| 513 | } |
| 514 | |
| 515 | leaf vdu-depends-on-ref { |
| 516 | description |
| 517 | "Reference to the VDU on which |
| 518 | the source VDU depends."; |
| 519 | type leafref { |
| 520 | path "../../vdu/id"; |
| 521 | } |
| 522 | } |
| 523 | } |
| 524 | |
| 525 | leaf service-function-chain { |
| 526 | description "Type of node in Service Function Chaining Architecture"; |
| 527 | |
| 528 | type enumeration { |
| 529 | enum UNAWARE; |
| 530 | enum CLASSIFIER; |
| 531 | enum SF; |
| 532 | enum SFF; |
| 533 | } |
| 534 | default "UNAWARE"; |
| 535 | } |
| 536 | |
| 537 | leaf service-function-type { |
| 538 | description |
| 539 | "Type of Service Function. |
| 540 | NOTE: This needs to map with Service Function Type in ODL to |
| 541 | support VNFFG. Service Function Type is mandatory param in ODL |
| 542 | SFC. This is temporarily set to string for ease of use"; |
| 543 | type string; |
| 544 | } |
| 545 | |
| 546 | uses manotypes:monitoring-param; |
| 547 | |
| 548 | list placement-groups { |
| 549 | description "List of placement groups at VNF level"; |
| 550 | |
| 551 | key "name"; |
| 552 | uses manotypes:placement-group-info; |
| 553 | |
| 554 | list member-vdus { |
| 555 | |
| 556 | description |
| 557 | "List of VDUs that are part of this placement group"; |
| 558 | key "member-vdu-ref"; |
| 559 | |
| 560 | leaf member-vdu-ref { |
| 561 | type leafref { |
| 562 | path "../../../vdu/id"; |
| 563 | } |
| 564 | } |
| 565 | } |
| 566 | } |
| 567 | } |
| 568 | } |
| 569 | |
| 570 | // vim: sw=2 |