Junos virtual-network-functions configuration module
Version: 2019-01-01
module junos-nfx-conf-virtual-network-functions { yang-version 1; namespace "http://yang.juniper.net/junos-nfx/conf/virtual-network-functions"; prefix jc-virtual-network-functions; import junos-common-ddl-extensions { prefix junos; revision-date "2019-01-01"; } import junos-common-types { prefix jt; revision-date "2019-01-01"; } import junos-nfx-conf-root { prefix jc; revision-date "2019-01-01"; } organization "Juniper Networks, Inc."; contact "yang-support@juniper.net"; description "Junos virtual-network-functions configuration module"; revision "2019-01-01" { description "Junos: 21.3R1.9"; } augment /jc:configuration { uses virtual-network-functions-group; } augment /jc:configuration/jc:groups { uses virtual-network-functions-group; } grouping virtual-network-functions-group { list virtual-network-functions { key "name"; ordered-by user; description "Virtual network functions configuration"; leaf name { type string; description "VNF name"; } uses apply-advanced; container type { description "VNF type"; uses apply-advanced; leaf vnf_type { type enumeration { enum "virtual-machine" { value 0; description "Virtual Machine"; } } description "VNF type"; } } // container type container image { junos:must "(!(".. init-descriptor"))"; junos:must-message "Image and init-descriptor are mutually exclusive. Both configuration at a time is not allowed"; description "Image file path"; uses apply-advanced; leaf file-path { type string { junos:posix-pattern "^[a-zA-Z0-9./_-]+$"; junos:pattern-message "Image file path must be a string of alphanumericals, dashes, underscores, colons, dots or slashes"; length "1 .. 256"; } description "File path"; } leaf image-type { type enumeration { enum "qcow2" { value 0; description "Qcow2 image format"; } enum "raw" { value 1; description "Raw image format"; } } default "qcow2"; description "Image type"; } leaf bus-type { type enumeration { enum "virtio" { value 0; description "Virtio"; } enum "ide" { value 1; description "Ide"; } } default "virtio"; description "Bus type"; } leaf driver-cache { type enumeration { enum "none" { value 0; description "Cache type none"; } enum "writethrough" { value 1; description "Cache type writethrough"; } enum "writeback" { value 2; description "Cache type writeback"; } enum "directsync" { value 3; description "Cache type directsync"; } enum "unsafe" { value 4; description "Cache type unsafe"; } enum "default-cache" { value 5; description "Cache type default"; } } description "Driver cache mode"; } } // container image container init-descriptor { junos:must "(!(".. image"))"; junos:must-message "Image and init-descriptor are mutually exclusive. Both configuration at a time is not allowed"; description "Initialization Descriptor file path"; uses apply-advanced; leaf file-path { type string { length "1 .. 256"; } description "File path"; } } // container init-descriptor container uuid { description "VNF UUID"; uses apply-advanced; leaf vnf_uuid { type string { junos:posix-pattern "^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$"; junos:pattern-message "Must be a valid UUID string"; } description "UUID string"; } } // container uuid container virtual-cpu { description "Virtual cpu configuration"; uses apply-advanced; list vcpu-number { key "name"; uses vcpu_set; } // list vcpu-number leaf count { type union { type uint32; type string { pattern "<.*>|$.*"; } } description "Number of virtual CPUs"; } container features { description "Features"; uses apply-advanced; leaf hardware-virtualization { type empty; description "Hardware Virtualization"; } } // container features } // container virtual-cpu leaf no-default-interfaces { type empty; description "Do not autoprovision any interfaces to VNF"; } list interfaces { key "name"; ordered-by user; description "Interfaces configuration"; leaf name { type string; description "Interface name"; } uses apply-advanced; container link { description "Vnf interface link disable"; uses apply-advanced; choice enable-disable { leaf disable { type empty; description "Disable the VNF interface"; } } // choice enable-disable } // container link leaf description { type string; description "Text description of interface"; } leaf mac-address { type jt:mac-addr; description "Mac-address for the VNF interface"; } leaf mtu { junos:must "(!(".. analyzer"))"; junos:must-message "MTU is not configurable on analyzer interface"; type enumeration { enum "1500" { value 0; description "Set 1500 as mtu"; } enum "2048" { value 1; description "Set 2048 as mtu"; } enum "9216" { value 2; description "Set 9216 as mtu"; } } default "1500"; description "The Maximum Transfer Unit size in bytes"; } leaf pci-address { junos:must "(unique ".. .. interfaces <*> pci-address $$")"; junos:must-message "Target pci-address should be unique for each VNF interface"; type string { junos:posix-pattern "^0000:00:[0-9a-f]{2}[.:][0-7]$"; junos:pattern-message "Must be a valid target pci-address string in 0000:00:<slot>.[0-7] format"; } description "Target PCI address for the VNF interface"; } leaf management { junos:must "(".. .. no-default-interfaces")"; junos:must-message "Management can be configured only if no-default-interfaces is configured"; type enumeration { enum "internal" { junos:must "(!(".. analyzer"))"; junos:must-message "Analyzer can not be used if interface is configured management internal"; junos:must "(!(".. mapping"))"; junos:must-message "Mapping can not be used if interface is configured management internal "; junos:must "(!(".. offloads disable"))"; junos:must-message "offloads not supported on Internal Management interface"; value 0; description "Internal Management"; } enum "out-of-band" { junos:must "(!(".. analyzer"))"; junos:must-message "Analyzer can not be used if interface is configured management out-of-band"; junos:must "(!(".. mapping"))"; junos:must-message "Mapping can not be used if interface is configured management out-of-band"; junos:must "(!(".. offloads disable"))"; junos:must-message "offloads not supported on out-of-band interface"; value 1; description "Out Of Band Management"; } } description "VNF interface management configuration"; } leaf analyzer { junos:must "(!(".. mapping"))"; junos:must-message "Mapping and analyzer are mutually exclusive"; type empty; description "Analyzer interface"; } container mapping { junos:must "(!(".. forwarding-options"))"; junos:must-message "Mapping cannot be configured with forwarding-options"; junos:must "(!(".. analyzer"))"; junos:must-message "Mapping and analyzer are mutually exclusive"; description "Attach to a physical interface or VLAN"; uses apply-advanced; container interface { junos:must "(!(".. .. offloads disable"))"; junos:must-message "offloads not supported on vf interface"; junos:must "(!(".. vlan"))"; junos:must-message "Attaching interface to both physical interface and vlan is not allowed"; description "Attach to a physical interface"; uses apply-advanced; leaf interface-name { type string { junos:posix-pattern "^(heth-[0-1]-([0-9]))$|hsxe[0-9]"; junos:pattern-message "Invalid heth-x-y/hsxe interface name"; } description "Set heth-x-y or hsxe interface"; } container virtual-function { presence "enable virtual-function"; description "Attach using SR-IOV"; uses apply-advanced; leaf vlan-id { type union { type string { pattern "<.*>|$.*"; } type uint32 { range "1 .. 4094"; } } description "VLAN Id"; } leaf trust { type empty; description "Enable trust mode"; } } // container virtual-function } // container interface container vlan { junos:must "(!(".. interface"))"; junos:must-message "Attaching interface to both physical interface and vlan is not allowed"; description "Attach VNF interface to VLAN"; uses apply-advanced; leaf mode { type enumeration { enum "access" { value 0; description "Interface mode is access"; } enum "trunk" { value 1; description "Interface mode is trunk"; } } default "access"; description "Type of interface mode"; } leaf-list members { type string; ordered-by user; description "Membership for this interface"; } leaf native-vlan-id { junos:must "(!(".. mode access"))"; junos:must-message "native-vlan-id cannot be specified with access interface"; type union { type string { pattern "<.*>|$.*"; } type uint32 { range "1 .. 4094"; } } description "Virtual LAN identifier for untagged frames"; } } // container vlan leaf-list peer-interfaces { type string; ordered-by user; description "Virtual peer interface(s) for this interface"; } } // container mapping container forwarding-options { junos:must "(!(".. mapping"))"; junos:must-message "Drop flow not supported with mapping"; description "Forwarding-options on this interface"; uses apply-advanced; leaf deny-forwarding { type empty; description "Deny forwarding traffic on this interface"; } } // container forwarding-options container offloads { junos:must "(!(".. analyzer"))"; junos:must-message "offloads not supported on analyzer interface"; description "Offloads configuration for the VNF interface"; uses apply-advanced; choice enable-disable { leaf disable { type empty; description "Disable offloads for the VNF interface"; } } // choice enable-disable } // container offloads } // list interfaces container memory { description "Memory configuration"; uses apply-advanced; leaf size { type union { type uint32; type string { pattern "<.*>|$.*"; } } description "Size in kilobytes"; } container features { description "Features"; uses apply-advanced; container hugepages { junos:must "("system memory hugepages")"; junos:must-message "system memory hugepages must be configured"; presence "enable hugepages"; description "Hugepages"; uses apply-advanced; leaf page-size { type enumeration { enum "1024" { value 0; description "Pagesize of 1GB"; } enum "2" { value 1; description "Pagesize of 2MB"; } } default "1024"; description "Page size"; } } // container hugepages } // container features list virtual-numa-node { key "name"; ordered-by user; description "Specify virtual numa node"; leaf name { type union { type string { pattern "<.*>|$.*"; } type uint32 { range "0 .. 1"; } } } uses apply-advanced; leaf size { type union { type uint32; type string { pattern "<.*>|$.*"; } } description "Size in kilobytes"; } } // list virtual-numa-node } // container memory list storage { key "name"; ordered-by user; description "Storage configuration"; leaf name { type string { junos:posix-pattern "^(hd[a-z]|sd[a-z]|vd[a-z])$"; junos:pattern-message "Must be a valid device name in the format hdX or sdX or vdX. Example: hdb, sdc, vdb, etc."; } description "Target device name"; } uses apply-advanced; container type { description "Disk type"; uses apply-advanced; choice types { container cdrom { description "CDROM"; uses storage_attrib; } // container cdrom container disk { description "Harddisk"; uses storage_attrib_disk; } // container disk container usb { description "USB"; uses storage_attrib; } // container usb } // choice types } // container type } // list storage leaf no-autostart { type empty; description "Do not autostart VNF on commit"; } container config-data { description "Pass config while spawning vnf"; uses apply-advanced; container source { presence "enable source"; uses apply-advanced; list file { key "name"; ordered-by user; description "Files to pass config data"; leaf name { type jt:filename; description "Path to the file"; } uses apply-advanced; } // list file container directory { presence "enable directory"; description "Directory to pass config data"; uses apply-advanced; leaf directory-name { type jt:filename; description "Enter the directory name"; } } // container directory container template { description "Template to pass config data"; uses apply-advanced; list template_files { key "name"; uses templates; } // list template_files } // container template } // container source container target { presence "enable target"; uses apply-advanced; container device-name { presence "enable device-name"; description "Target device name"; uses apply-advanced; leaf target-device-name { type string { junos:posix-pattern "^(hd[a-z]|sd[a-z]|vd[a-z])$"; junos:pattern-message "Must be a valid device name in the format hdX or sdX or vdX. Example: hdb, sdc, vdb, etc."; } description "Target device name"; } } // container device-name leaf device-type { type enumeration { enum "cdrom" { value 0; description "Attach as cdrom"; } enum "usb" { value 1; description "Attach as disk"; } enum "disk" { value 2; description "Attach as disk"; } } description "Device type to be attached to vnf"; } leaf device-label { type string; description "Label to be attached to iso"; } } // container target } // container config-data } // list virtual-network-functions } // grouping virtual-network-functions-group grouping apply-advanced { description "Apply advanced configuration logic"; leaf-list apply-groups { type string; ordered-by user; description "Groups from which to inherit configuration data"; } leaf-list apply-groups-except { type string; ordered-by user; description "Don't inherit configuration data from these groups"; } list apply-macro { key "name"; ordered-by user; description "Macro and parameters for commit script expansion"; uses apply-macro-type; } // list apply-macro } // grouping apply-advanced grouping apply-macro-type { description "Macro data for commit-script expansion"; leaf name { type string; description "Name of the macro to be expanded"; } list data { key "name"; uses macro-data-type; } // list data } // grouping apply-macro-type grouping macro-data-type { leaf name { type string; description "Keyword part of the keyword-value pair"; } leaf value { type string; description "Value part of the keyword-value pair"; } } // grouping macro-data-type grouping storage_attrib { description "Storage attributes"; uses apply-advanced; container source { description "Source for disk"; uses apply-advanced; leaf file { type string { length "1 .. 256"; } description "File name"; } } // container source } // grouping storage_attrib grouping storage_attrib_disk { description "Storage attributes"; uses apply-advanced; container source { description "Source for disk"; uses apply-advanced; leaf file { type string { length "1 .. 256"; } description "File name"; } } // container source leaf bus-type { type enumeration { enum "virtio" { value 0; description "Virtio"; } enum "ide" { value 1; description "Ide"; } } default "virtio"; description "Bus type"; } leaf file-type { type enumeration { enum "qcow2" { value 0; description "Qcow2"; } enum "raw" { value 1; description "Raw"; } } default "qcow2"; description "File type"; } leaf driver-cache { type enumeration { enum "none" { value 0; description "Cache type none"; } enum "writethrough" { value 1; description "Cache type writethrough"; } enum "writeback" { value 2; description "Cache type writeback"; } enum "directsync" { value 3; description "Cache type directsync"; } enum "unsafe" { value 4; description "Cache type unsafe"; } enum "default-cache" { value 5; description "Cache type default"; } } default "default-cache"; description "Driver cache types"; } } // grouping storage_attrib_disk grouping templates { description "Templates"; leaf name { type string; description "Template name"; } uses apply-advanced; container file { presence "enable file"; description "Path to template file"; uses apply-advanced; leaf file-path { type jt:filename; description "Path to template file"; } } // container file list parameters { key "name"; ordered-by user; description "Pass parameters for the template"; leaf name { type string; description "Key of the parameter"; } uses apply-advanced; leaf data { type string; description "Value of key"; } } // list parameters container target { presence "enable target"; description "Template name to be generated"; uses apply-advanced; leaf target-filename { type jt:filename; description "Target filename"; } } // container target } // grouping templates grouping vcpu_set { description "VCPU number"; leaf name { type union { type uint32; type string { pattern "<.*>|$.*"; } } description "VCPU number"; } uses apply-advanced; container virtual-numa-node { description "Specify virtual numa node"; uses apply-advanced; leaf virtual-numa-node-name { type union { type string { pattern "<.*>|$.*"; } type uint32 { range "0 .. 1"; } } description "Specify virtual numa node"; } leaf virtual-core { type union { type string { pattern "<.*>|$.*"; } type uint32 { range "0 .. 9"; } } description "Specify the virtual core"; } } // container virtual-numa-node leaf-list physical-cpu { type string; description "Physical CPUs"; } } // grouping vcpu_set } // module junos-nfx-conf-virtual-network-functions
© 2023 YumaWorks, Inc. All rights reserved.