diff options
Diffstat (limited to 'nova/scheduler/host_manager.py')
-rw-r--r-- | nova/scheduler/host_manager.py | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/nova/scheduler/host_manager.py b/nova/scheduler/host_manager.py index 80511ffad6..8cb775a923 100644 --- a/nova/scheduler/host_manager.py +++ b/nova/scheduler/host_manager.py @@ -153,6 +153,8 @@ class HostState(object): self.updated = None + self.allocation_candidates = [] + def update(self, compute=None, service=None, aggregates=None, inst_dict=None): """Update all information about a host.""" @@ -296,7 +298,9 @@ class HostState(object): spec_obj.numa_topology = hardware.numa_fit_instance_to_host( self.numa_topology, spec_obj.numa_topology, limits=self.limits.get('numa_topology'), - pci_requests=pci_requests, pci_stats=self.pci_stats) + pci_requests=pci_requests, + pci_stats=self.pci_stats, + provider_mapping=spec_obj.get_request_group_mapping()) self.numa_topology = hardware.numa_usage_from_instance_numa( self.numa_topology, spec_obj.numa_topology) @@ -306,7 +310,11 @@ class HostState(object): instance_cells = None if spec_obj.numa_topology: instance_cells = spec_obj.numa_topology.cells - self.pci_stats.apply_requests(pci_requests, instance_cells) + self.pci_stats.apply_requests( + pci_requests, + spec_obj.get_request_group_mapping(), + instance_cells + ) # NOTE(sbauza): By considering all cases when the scheduler is called # and when consume_from_request() is run, we can safely say that there @@ -314,13 +322,21 @@ class HostState(object): self.num_io_ops += 1 def __repr__(self): - return ("(%(host)s, %(node)s) ram: %(free_ram)sMB " - "disk: %(free_disk)sMB io_ops: %(num_io_ops)s " - "instances: %(num_instances)s" % - {'host': self.host, 'node': self.nodename, - 'free_ram': self.free_ram_mb, 'free_disk': self.free_disk_mb, - 'num_io_ops': self.num_io_ops, - 'num_instances': self.num_instances}) + return ( + "(%(host)s, %(node)s) ram: %(free_ram)sMB " + "disk: %(free_disk)sMB io_ops: %(num_io_ops)s " + "instances: %(num_instances)s, " + "allocation_candidates: %(num_a_c)s" + % { + "host": self.host, + "node": self.nodename, + "free_ram": self.free_ram_mb, + "free_disk": self.free_disk_mb, + "num_io_ops": self.num_io_ops, + "num_instances": self.num_instances, + "num_a_c": len(self.allocation_candidates), + } + ) class HostManager(object): |