extended.get("disk-io-quota"), "disk_io", extra_specs
)
+ # Set the mempage size as specified in the descriptor
+ if extended.get("mempage-size"):
+ if extended.get("mempage-size") == "LARGE":
+ extra_specs["hw:mem_page_size"] = "large"
+ elif extended.get("mempage-size") == "SMALL":
+ extra_specs["hw:mem_page_size"] = "small"
+ elif extended.get("mempage-size") == "SIZE_2MB":
+ extra_specs["hw:mem_page_size"] = "2MB"
+ elif extended.get("mempage-size") == "SIZE_1GB":
+ extra_specs["hw:mem_page_size"] = "1GB"
+ elif extended.get("mempage-size") == "PREFER_LARGE":
+ extra_specs["hw:mem_page_size"] = "any"
+ else:
+ # The validations in NBI should make reaching here not possible.
+ # If this message is shown, check validations
+ self.logger.debug(
+ "Invalid mempage-size %s. Will be ignored",
+ extended.get("mempage-size"),
+ )
+
# create flavor
new_flavor = self.nova.flavors.create(
name=name,
--- /dev/null
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+fixes:
+ - |
+ Fixing bug 2029 - mempage-size was ignored when creating the flavor