nova/nova/virt/arch.py
Mohammed Naser aa5b1326c8 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
2018-05-14 16:55:13 -04:00

66 lines
1.5 KiB
Python

# Copyright 2018 VEXXHOST, Inc.
# All Rights Reserved.
#
# 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.
ALPHA = 'alpha'
ARMV6 = 'armv6'
ARMV7 = 'armv7l'
ARMV7B = 'armv7b'
AARCH64 = 'aarch64'
CRIS = 'cris'
I686 = 'i686'
IA64 = 'ia64'
LM32 = 'lm32'
M68K = 'm68k'
MICROBLAZE = 'microblaze'
MICROBLAZEEL = 'microblazeel'
MIPS = 'mips'
MIPSEL = 'mipsel'
MIPS64 = 'mips64'
MIPS64EL = 'mips64el'
OPENRISC = 'openrisc'
PARISC = 'parisc'
PARISC64 = 'parisc64'
PPC = 'ppc'
PPCLE = 'ppcle'
PPC64 = 'ppc64'
PPC64LE = 'ppc64le'
PPCEMB = 'ppcemb'
S390 = 's390'
S390X = 's390x'
SH4 = 'sh4'
SH4EB = 'sh4eb'
SPARC = 'sparc'
SPARC64 = 'sparc64'
UNICORE32 = 'unicore32'
X86_64 = 'x86_64'
XTENSA = 'xtensa'
XTENSAEB = 'xtensaeb'
ALL = (
ALPHA, ARMV6, ARMV7, ARMV7B,
AARCH64, CRIS, I686, IA64, LM32,
M68K, MICROBLAZE, MICROBLAZEEL, MIPS, MIPSEL,
MIPS64, MIPS64EL, OPENRISC, PARISC, PARISC64,
PPC, PPCLE, PPC64, PPC64LE, PPCEMB,
S390, S390X, SH4, SH4EB, SPARC,
SPARC64, UNICORE32, X86_64, XTENSA, XTENSAEB,
)