summaryrefslogtreecommitdiff
path: root/nova/conf
diff options
context:
space:
mode:
authorMohammed Naser <mnaser@vexxhost.com>2018-05-04 21:06:46 -0400
committerMohammed Naser <mnaser@vexxhost.com>2018-05-15 12:28:43 +0000
commitad332f3c635d887b163a8abe640d2a1b0da547fc (patch)
treef578d9b12558d882cd943b605bc6ae6ab7385ef5 /nova/conf
parentd5c686f8568793641824e4d6766f43d9f4e5034d (diff)
downloadnova-ad332f3c635d887b163a8abe640d2a1b0da547fc.tar.gz
Added ability to configure default architecture for ImagePropertiesFilter
When using ImagePropertiesFilter with multiple architectures inside the same deployment, it is possible that images can be uploaded without the hw_architecture property defined. This results in behaviour where the instance could be scheduled on any type of hypervisor, resulting in an instance that will successfully transition to ACTIVE but never properly run because of the difference in architecture. This makes the ImagePropertiesFilter problematic as most images are generally uploaded without the architecture property set because most documentation does not encourage doing that. The addition of this flag allows to make using the filter possible because it allows the deployer to assume a default architecture if the user did not supply one (assuming it would be the most common architecture in their deployment, such as x86_64) yet if the user wants a more specific architecture, they can do it in their image properties. In order to avoid a circular import loop, the references to the architecture field have been moved to a seperate module so that they can be properly and cleaned imported inside configuration. Change-Id: Ib52deb095028e93619b93ef9e5f70775df2a403a Closes-Bug: #1769283 (cherry picked from commit aa5b1326c86c408ce9cc4546e1c7a310fbce3136)
Diffstat (limited to 'nova/conf')
-rw-r--r--nova/conf/scheduler.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/nova/conf/scheduler.py b/nova/conf/scheduler.py
index 2cb66e1aa3..84eb790566 100644
--- a/nova/conf/scheduler.py
+++ b/nova/conf/scheduler.py
@@ -15,6 +15,8 @@
from oslo_config import cfg
+from nova.virt import arch
+
scheduler_group = cfg.OptGroup(name="scheduler",
title="Scheduler configuration")
@@ -516,6 +518,21 @@ rescheduling events.
At the same time it will make the instance packing (even in unweighed case)
less dense.
"""),
+ cfg.StrOpt(
+ "image_properties_default_architecture",
+ choices=arch.ALL,
+ help="""
+The default architecture to be used when using the image properties filter.
+
+When using the ImagePropertiesFilter, it is possible that you want to define
+a default architecture to make the user experience easier and avoid having
+something like x86_64 images landing on aarch64 compute nodes because the
+user did not specify the 'hw_architecture' property in Glance.
+
+Possible values:
+
+* CPU Architectures such as x86_64, aarch64, s390x.
+"""),
# TODO(mikal): replace this option with something involving host aggregates
cfg.ListOpt("isolated_images",
default=[],