Stop casting run_instance in the scheduler, query the scheduler instead

Registered by Andrew Laski

In Havana it became possible to query the scheduler for a list of hosts to provision an instance on. Now we should switch the booting of a new instance to use that new query rather than proxy through the scheduler as is currently done.

This is in preparation for moving towards something like TaskFlow which would allow Nova to stop and resume multi step operations. By moving away from run_instance we are consolidating the provisioning logic between the conductor and compute manager. This clears up the responsibilities of the scheduler so that work there can focus on scheduling improvements.

Blueprint information

John Garbutt
Andrew Laski
Series goal:
Accepted for juno
Milestone target:
milestone icon 2014.2
Started by
Andrew Laski
Completed by
Andrew Laski

Related branches



Due to Gantt work, I think this one is really important. It helps separate out the scheduler, making it high priority for the next milestone --johnthetubaguy

This blueprint has been deferred from the icehouse-3 milestone to Juno because it missed the "feature proposal freeze" deadline. --johngarbutt

Already merged (or abandoned)

Gerrit topic:,topic:bp/remove-cast-to-schedule-run-instance,n,z

Addressed by:
    Add block device handling to build_and_run_instance

Addressed by:
    Add network handling to build_and_run_instance

Addressed by:
    Add updates and notifications to build_and_run_instance

Addressed by:
    Use elevated context in resource_tracker.instance_claim

Addressed by:
    Change conductor to cast to build_and_run_instance

Gerrit topic:,topic:bug/1195947,n,z

Addressed by:
    Don't set to ERROR if deleted during build

Gerrit topic:,topic:network_alloc_6,n,z

Addressed by:
    Remove duplicate BuildAbortException block

Addressed by:
    Ensure proper notifications are sent when build finishes

Addressed by:
    Object-ify build_and_run_instance

Addressed by:
    Don't deallocate/reallocate networks on reschedules

Addressed by:
    Serialize instance object while building request_spec

    This blueprint has been deferred from the icehouse-3 milestone to Juno because it missed the "feature proposal freeze" deadline. --russellb

Gerrit topic:,topic:bp/proposes,n,z

Addressed by:
    Finish work to remove cast to schedule_run_instance

Set the URL, restate some fields, so it can be accepted into Juno --johnthetubaguy 28th April 2014

Please upload some code, and target a milestone, before this can be approved --johnthetubaguy 28th April 2014

Now we have code, updated milestone and approved this --johnthetubaguy 21st May 2014

Current Patches


Addressed by:
    Convert address to str in fixed_ip_obj.associate

Addressed by:
    Cells: Pass instance objects to build_instances

Addressed by:
    Add refresh=True to get_available_nodes call in build_and_run_instance

Addressed by:
    Call _validate_instance_group_policy in _build_and_run_instance

Addressed by:
    Use objects through the run_instance() path

Addressed by:
    Deprecate run_instance and remove unnecessary code

Gerrit topic:,topic:instance-exists,n,z


Work Items