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>
This commit is contained in:
Mikyung Kang
2012-11-10 10:20:45 +09:00
committed by Arata Notsu
parent 1ce7e23fa7
commit e12e31b10b
10 changed files with 203 additions and 126 deletions

View File

@@ -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