| garciaale | 76f6a62 | 2020-11-19 17:57:42 -0300 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2020 Whitestack LLC |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 13 | implied. |
| 14 | See the License for the specific language governing permissions and |
| 15 | limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | module epa { |
| 19 | yang-version 1.1; |
| 20 | namespace "urn:etsi:osm:yang:augments:epa"; |
| 21 | prefix "epa"; |
| 22 | |
| 23 | import etsi-nfv-vnfd { |
| 24 | prefix vnfd; |
| 25 | } |
| 26 | |
| 27 | grouping allocation-properties { |
| 28 | leaf limit { |
| 29 | description |
| 30 | "Defines the maximum allocation. The value 0 indicates that usage is not limited. |
| 31 | This parameter ensures that the instance never uses more than the defined amount of resource."; |
| 32 | type uint64; |
| 33 | } |
| 34 | |
| 35 | leaf reserve { |
| 36 | description |
| 37 | "Defines the guaranteed minimum reservation. |
| 38 | If needed, the machine will definitely get allocated the reserved amount of resources."; |
| 39 | type uint64; |
| 40 | } |
| 41 | |
| 42 | leaf shares { |
| 43 | description |
| 44 | "Number of shares allocated. |
| 45 | Specifies the proportional weighted share for the domain. |
| 46 | If this element is omitted, the service defaults to the OS provided defaults"; |
| 47 | type uint64; |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | grouping extended-mem-quota { |
| 52 | container mem-quota { |
| 53 | description |
| 54 | "Memory quota describes the memory resource allocation policy. |
| 55 | Limit and Reserve values are defined in MB"; |
| 56 | uses allocation-properties; |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | grouping extended-vif-quota { |
| 61 | container vif-quota { |
| 62 | description |
| 63 | "Virtual interfaces quota describes the virtual interface bandwidth resource allocation policy. |
| 64 | Limit and Reserve values are defined in Mbps"; |
| 65 | uses allocation-properties; |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | grouping extended-disk-io-quota { |
| 70 | container disk-io-quota { |
| 71 | description |
| 72 | "Disk IO quota describes the disk IO operations resource allocation policy. |
| 73 | Limit and Reserve values are defined in IOPS"; |
| 74 | uses allocation-properties; |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | grouping extended-cpu-quota { |
| 79 | container cpu-quota { |
| 80 | description |
| 81 | "CPU quota describes the CPU resource allocation policy. |
| 82 | Limit and Reserve values are defined in MHz"; |
| 83 | uses allocation-properties; |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | grouping extended-cpu-policy { |
| 88 | leaf thread-policy { |
| 89 | description |
| 90 | "CPU thread pinning policy describes how to |
| 91 | place the guest CPUs when the host supports |
| 92 | hyper threads: |
| 93 | AVOID : Avoids placing a guest on a host |
| 94 | with threads. |
| 95 | SEPARATE: Places vCPUs on separate cores, |
| 96 | and avoids placing two vCPUs on |
| 97 | two threads of same core. |
| 98 | ISOLATE : Places each vCPU on a different core, |
| 99 | and places no vCPUs from a different |
| 100 | guest on the same core. |
| 101 | PREFER : Attempts to place vCPUs on threads |
| 102 | of the same core."; |
| 103 | type enumeration { |
| 104 | enum AVOID; |
| 105 | enum SEPARATE; |
| 106 | enum ISOLATE; |
| 107 | enum PREFER; |
| 108 | } |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | grouping extended-mempage-size { |
| 113 | leaf mempage-size { |
| 114 | description |
| 115 | "Memory page allocation size. If a VM requires |
| 116 | hugepages, it should choose LARGE or SIZE_2MB |
| 117 | or SIZE_1GB. If the VM prefers hugepages it |
| 118 | should choose PREFER_LARGE. |
| 119 | LARGE : Require hugepages (either 2MB or 1GB) |
| 120 | SMALL : Doesn't require hugepages |
| 121 | SIZE_2MB : Requires 2MB hugepages |
| 122 | SIZE_1GB : Requires 1GB hugepages |
| 123 | PREFER_LARGE : Application prefers hugepages"; |
| 124 | type enumeration { |
| 125 | enum LARGE; |
| 126 | enum SMALL; |
| 127 | enum SIZE_2MB; |
| 128 | enum SIZE_1GB; |
| 129 | enum PREFER_LARGE; |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | grouping extended-numa { |
| 134 | container numa-node-policy { |
| 135 | description |
| 136 | "This policy defines NUMA topology of the |
| 137 | guest. Specifically identifies if the guest |
| 138 | should be run on a host with one NUMA |
| 139 | node or multiple NUMA nodes. As an example |
| 140 | a guest might need 8 VCPUs and 4 GB of |
| 141 | memory. However, it might need the VCPUs |
| 142 | and memory distributed across multiple |
| 143 | NUMA nodes. In this scenario, NUMA node |
| 144 | 1 could run with 6 VCPUs and 3GB, and |
| 145 | NUMA node 2 could run with 2 VCPUs and |
| 146 | 1GB."; |
| 147 | |
| 148 | leaf node-cnt { |
| 149 | description |
| 150 | "The number of NUMA nodes to expose to the VM."; |
| 151 | type uint16; |
| 152 | } |
| 153 | |
| 154 | leaf mem-policy { |
| 155 | description |
| 156 | "This policy specifies how the memory should |
| 157 | be allocated in a multi-node scenario. |
| 158 | STRICT : The memory must be allocated |
| 159 | strictly from the memory attached |
| 160 | to the NUMA node. |
| 161 | PREFERRED : The memory should be allocated |
| 162 | preferentially from the memory |
| 163 | attached to the NUMA node"; |
| 164 | type enumeration { |
| 165 | enum STRICT; |
| 166 | enum PREFERRED; |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | list node { |
| 171 | key id; |
| 172 | leaf id { |
| 173 | description |
| 174 | "NUMA node identification. Typically |
| 175 | it's 0 or 1"; |
| 176 | type uint64; |
| 177 | } |
| 178 | |
| 179 | list vcpu { |
| 180 | key "id"; |
| 181 | description |
| 182 | "List of VCPUs to allocate on |
| 183 | this NUMA node."; |
| 184 | leaf id { |
| 185 | type uint64; |
| 186 | description |
| 187 | "List of VCPUs ids to allocate on |
| 188 | this NUMA node"; |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | leaf memory-mb { |
| 193 | description |
| 194 | "Memory size expressed in MB |
| 195 | for this NUMA node."; |
| 196 | type uint64; |
| 197 | } |
| 198 | |
| 199 | choice om-numa-type { |
| 200 | description |
| 201 | "OpenMANO Numa type selection"; |
| 202 | |
| 203 | case cores { |
| 204 | leaf num-cores { |
| 205 | type uint8; |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | case paired-threads { |
| 210 | container paired-threads { |
| 211 | leaf num-paired-threads { |
| 212 | type uint8; |
| 213 | } |
| 214 | |
| 215 | list paired-thread-ids { |
| 216 | description |
| 217 | "List of thread pairs to use in case of paired-thread NUMA"; |
| 218 | max-elements 16; |
| 219 | key thread-a; |
| 220 | |
| 221 | leaf thread-a { |
| 222 | type uint8; |
| 223 | } |
| 224 | |
| 225 | leaf thread-b { |
| 226 | type uint8; |
| 227 | } |
| 228 | } |
| 229 | } |
| 230 | } |
| 231 | case threads { |
| 232 | leaf num-threads { |
| 233 | type uint8; |
| 234 | } |
| 235 | } |
| 236 | } |
| 237 | } |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | augment "/vnfd:vnfd/vnfd:virtual-compute-desc/vnfd:virtual-memory" { |
| 242 | uses extended-numa; |
| 243 | uses extended-mempage-size; |
| 244 | uses extended-mem-quota; |
| 245 | } |
| 246 | |
| 247 | augment "/vnfd:vnfd/vnfd:virtual-compute-desc/vnfd:virtual-cpu/vnfd:pinning" { |
| 248 | uses extended-cpu-policy; |
| 249 | } |
| 250 | |
| 251 | augment "/vnfd:vnfd/vnfd:virtual-compute-desc/vnfd:virtual-cpu" { |
| 252 | uses extended-cpu-quota; |
| 253 | } |
| 254 | |
| 255 | augment "/vnfd:vnfd/vnfd:virtual-storage-desc" { |
| 256 | uses extended-disk-io-quota; |
| 257 | } |
| 258 | |
| 259 | augment "/vnfd:vnfd/vnfd:vdu/vnfd:int-cpd/vnfd:virtual-network-interface-requirement" { |
| 260 | uses extended-vif-quota; |
| 261 | } |
| 262 | } |