2 Copyright 2020 Whitestack LLC
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
8 http://www.apache.org/licenses/LICENSE-2.0
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
14 See the License for the specific language governing permissions and
15 limitations under the License.
20 namespace "urn:etsi:osm:yang:augments:epa";
23 import etsi-nfv-vnfd {
27 grouping allocation-properties {
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.";
37 "Defines the guaranteed minimum reservation.
38 If needed, the machine will definitely get allocated the reserved amount of resources.";
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";
51 grouping extended-mem-quota {
54 "Memory quota describes the memory resource allocation policy.
55 Limit and Reserve values are defined in MB";
56 uses allocation-properties;
60 grouping extended-vif-quota {
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;
69 grouping extended-disk-io-quota {
70 container disk-io-quota {
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;
78 grouping extended-cpu-quota {
81 "CPU quota describes the CPU resource allocation policy.
82 Limit and Reserve values are defined in MHz";
83 uses allocation-properties;
87 grouping extended-cpu-policy {
90 "CPU thread pinning policy describes how to
91 place the guest CPUs when the host supports
93 REQUIRE : Each vCPU is allocated on thread siblings
95 ISOLATE : Places each vCPU on a different core,
96 and places no vCPUs from a different
97 guest on the same core.
98 PREFER : Attempts to place vCPUs on threads
108 grouping extended-mempage-size {
111 "Memory page allocation size. If a VM requires
112 hugepages, it should choose LARGE or SIZE_2MB
113 or SIZE_1GB. If the VM prefers hugepages it
114 should choose PREFER_LARGE.
115 LARGE : Require hugepages (either 2MB or 1GB)
116 SMALL : Doesn't require hugepages
117 SIZE_2MB : Requires 2MB hugepages
118 SIZE_1GB : Requires 1GB hugepages
119 PREFER_LARGE : Application prefers hugepages";
129 grouping extended-numa {
130 container numa-node-policy {
132 "This policy defines NUMA topology of the
133 guest. Specifically identifies if the guest
134 should be run on a host with one NUMA
135 node or multiple NUMA nodes. As an example
136 a guest might need 8 VCPUs and 4 GB of
137 memory. However, it might need the VCPUs
138 and memory distributed across multiple
139 NUMA nodes. In this scenario, NUMA node
140 1 could run with 6 VCPUs and 3GB, and
141 NUMA node 2 could run with 2 VCPUs and
146 "The number of NUMA nodes to expose to the VM.";
152 "This policy specifies how the memory should
153 be allocated in a multi-node scenario.
154 STRICT : The memory must be allocated
155 strictly from the memory attached
157 PREFERRED : The memory should be allocated
158 preferentially from the memory
159 attached to the NUMA node";
170 "NUMA node identification. Typically
178 "List of VCPUs to allocate on
183 "List of VCPUs ids to allocate on
190 "Memory size expressed in MB
191 for this NUMA node.";
195 choice om-numa-type {
197 "OpenMANO Numa type selection";
205 case paired-threads {
206 container paired-threads {
207 leaf num-paired-threads {
211 list paired-thread-ids {
213 "List of thread pairs to use in case of paired-thread NUMA";
237 augment "/vnfd:vnfd/vnfd:virtual-compute-desc/vnfd:virtual-memory" {
239 uses extended-mempage-size;
240 uses extended-mem-quota;
243 augment "/vnfd:vnfd/vnfd:virtual-compute-desc/vnfd:virtual-cpu/vnfd:pinning" {
244 uses extended-cpu-policy;
247 augment "/vnfd:vnfd/vnfd:virtual-compute-desc/vnfd:virtual-cpu" {
248 uses extended-cpu-quota;
251 augment "/vnfd:vnfd/vnfd:virtual-storage-desc" {
252 uses extended-disk-io-quota;
255 augment "/vnfd:vnfd/vnfd:vdu/vnfd:int-cpd/vnfd:virtual-network-interface-requirement" {
256 uses extended-vif-quota;