From 31336b35b4604f70150d0073d77dbf63b9bf7598 Mon Sep 17 00:00:00 2001 From: Chuck Short Date: Wed, 6 Jun 2012 22:45:25 -0400 Subject: 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 --- nova/virt/libvirt/connection.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nova/virt') diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py index 0dfc91928..7c09acc5a 100644 --- a/nova/virt/libvirt/connection.py +++ b/nova/virt/libvirt/connection.py @@ -1996,8 +1996,12 @@ class LibvirtDriver(driver.ComputeDriver): for nodes in feature_nodes: features.append(nodes.get('name')) + arch_nodes = xml.findall('.//guest/arch') + guest_cpu_arches = list(node.get('name') for node in arch_nodes) + cpu_info['topology'] = topology cpu_info['features'] = features + cpu_info['permitted_instance_types'] = guest_cpu_arches return jsonutils.dumps(cpu_info) def block_stats(self, instance_name, disk): -- cgit