diff options
author | Mikyung Kang <mkkang@isi.edu> | 2012-11-10 10:20:45 +0900 |
---|---|---|
committer | Arata Notsu <notsu@virtualtech.jp> | 2012-11-10 10:20:45 +0900 |
commit | 885cf0949ab2e116da39143c2f6469362367ec7d (patch) | |
tree | 3eb769baee1d77955b6ae357466e66bccf993690 /nova/scheduler/driver.py | |
parent | 910a5487352dc0d36a4520f5b2787ec2290d965f (diff) | |
download | nova-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/scheduler/driver.py')
-rw-r--r-- | nova/scheduler/driver.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nova/scheduler/driver.py b/nova/scheduler/driver.py index f93268906..e9cbd509b 100644 --- a/nova/scheduler/driver.py +++ b/nova/scheduler/driver.py @@ -99,6 +99,15 @@ def instance_update_db(context, instance_uuid): return db.instance_update(context, instance_uuid, values) +def db_instance_node_set(context, instance_uuid, node): + '''Set the node field of an Instance. + + :returns: An Instance with the updated fields set properly. + ''' + values = {'node': node} + return db.instance_update(context, instance_uuid, values) + + def cast_to_compute_host(context, host, method, **kwargs): """Cast request to a compute host queue""" |