diff options
author | Chuck Short <chuck.short@canonical.com> | 2012-06-06 22:45:25 -0400 |
---|---|---|
committer | Chuck Short <chuck.short@canonical.com> | 2012-06-15 15:46:30 -0400 |
commit | 31336b35b4604f70150d0073d77dbf63b9bf7598 (patch) | |
tree | 3a111bc6aec56e594e50e48bef569e868b29a4d2 /nova/utils.py | |
parent | 5aea01e0f9ed5f79f9eda92bf4ac4340ceb33d95 (diff) | |
download | nova-31336b35b4604f70150d0073d77dbf63b9bf7598.tar.gz nova-31336b35b4604f70150d0073d77dbf63b9bf7598.tar.xz nova-31336b35b4604f70150d0073d77dbf63b9bf7598.zip |
Add CPU arch filter scheduler support
In a mixed environment of running different CPU architecutres,
one would not want to run an ARM instance on a X86_64 host and
vice versa.
This scheduler filter option will prevent instances running
on a host that it is not intended for.
The libvirt driver queries the guest capabilities of the
host and stores the guest arches in the permitted_instances_types
list in the cpu_info dict of the host.
The Xen equivalent will be done later in another commit.
The arch filter will compare the instance arch against
the permitted_instances_types of a host
and filter out invalid hosts.
Also adds ARM as a valid arch to the filter.
The ArchFilter is not turned on by default.
Change-Id: I17bd103f00c25d6006a421252c9c8dcfd2d2c49b
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Diffstat (limited to 'nova/utils.py')
-rw-r--r-- | nova/utils.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nova/utils.py b/nova/utils.py index ddc998524..8bd71359f 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -1321,6 +1321,15 @@ def strcmp_const_time(s1, s2): return result == 0 +def sys_platform_translate(arch): + """Translate cpu architecture into supported platforms.""" + if (arch[0] == 'i' and arch[1].isdigit() and arch[2:4] == '86'): + arch = 'i686' + elif arch.startswith('arm'): + arch = 'arm' + return arch + + class UndoManager(object): """Provides a mechanism to facilitate rolling back a series of actions when an exception is raised. |