summaryrefslogtreecommitdiffstats
path: root/nova/manager.py
diff options
context:
space:
mode:
authorMikyung Kang <mkkang@isi.edu>2012-11-10 10:20:45 +0900
committerArata Notsu <notsu@virtualtech.jp>2012-11-10 10:20:45 +0900
commit885cf0949ab2e116da39143c2f6469362367ec7d (patch)
tree3eb769baee1d77955b6ae357466e66bccf993690 /nova/manager.py
parent910a5487352dc0d36a4520f5b2787ec2290d965f (diff)
downloadnova-885cf0949ab2e116da39143c2f6469362367ec7d.tar.gz
nova-885cf0949ab2e116da39143c2f6469362367ec7d.tar.xz
nova-885cf0949ab2e116da39143c2f6469362367ec7d.zip
Updated scheduler and compute for multiple capabilities.
Part 1 of 6: blueprint general-bare-metal-provisioning-framework. This patch includes updates on scheduler and compute codes for multiple capabilities. This feature is needed in bare-metal provisioning which is implemented in later patches --- a bare-metal nova-compute manages multiple bare-metal nodes where instances are provisioned. Nova DB's compute_nodes entry needs to be created for each bare-metal node, and a scheduler can choose an appropriate bare-metal node to provision an instance. With this patch, one service entry with multiple compute_node entries can be registered by nova-compute. Distinct 'node name' is given for each node and is stored at compute_node['hypervisor_hostname']. And we added a new column "node" to "instances" table in Nova DB to associate instances with compute_node. FilterScheduler puts <nodename> to the column when it provisions the instance. And nova-computes respect <nodename> when run/stop instances and when calculate resources. Also, 'capability’ is extended from a dictionary to a list of dictionaries to describe the multiple capabilities of the multiple nodes. Change-Id: I527febe4dbd887b2e6596ce7226c1ae3386e2ae6 Co-authored-by: Mikyung Kang <mkkang@isi.edu> Co-authored-by: David Kang <dkang@isi.edu> Co-authored-by: Ken Igarashi <igarashik@nttdocomo.co.jp> Co-authored-by: Arata Notsu <notsu@virtualtech.jp>
Diffstat (limited to 'nova/manager.py')
-rw-r--r--nova/manager.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/nova/manager.py b/nova/manager.py
index 22a42d2d3..2aff3d04e 100644
--- a/nova/manager.py
+++ b/nova/manager.py
@@ -240,6 +240,8 @@ class SchedulerDependentManager(Manager):
def update_service_capabilities(self, capabilities):
"""Remember these capabilities to send on next periodic update."""
+ if not isinstance(capabilities, list):
+ capabilities = [capabilities]
self.last_capabilities = capabilities
@periodic_task
@@ -251,5 +253,8 @@ class SchedulerDependentManager(Manager):
"""
if self.last_capabilities:
LOG.debug(_('Notifying Schedulers of capabilities ...'))
- self.scheduler_rpcapi.update_service_capabilities(context,
- self.service_name, self.host, self.last_capabilities)
+ for capability_item in self.last_capabilities:
+ self.scheduler_rpcapi.update_service_capabilities(context,
+ self.service_name, self.host, capability_item)
+ # TODO(NTTdocomo): Make update_service_capabilities() accept a list
+ # of capabilities