Stop casting run_instance in the scheduler, query the scheduler instead

Registered by Andrew Laski on 2013-10-10

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

Status:
Complete
Approver:
John Garbutt
Priority:
High
Drafter:
None
Direction:
Approved
Assignee:
Andrew Laski
Definition:
Approved
Series goal:
Accepted for juno
Implementation:
Implemented
Milestone target:
milestone icon 2014.2
Started by
Andrew Laski on 2013-11-14
Completed by
Andrew Laski on 2014-06-05

Related branches

Sprints

Whiteboard

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. https://wiki.openstack.org/wiki/Icehouse_Release_Schedule --johngarbutt

Already merged (or abandoned)
==========================

Gerrit topic: https://review.openstack.org/#q,topic:bp/remove-cast-to-schedule-run-instance,n,z

Addressed by: https://review.openstack.org/42389
    Add block device handling to build_and_run_instance

Addressed by: https://review.openstack.org/42980
    Add network handling to build_and_run_instance

Addressed by: https://review.openstack.org/43190
    Add updates and notifications to build_and_run_instance

Addressed by: https://review.openstack.org/44479
    Use elevated context in resource_tracker.instance_claim

Addressed by: https://review.openstack.org/43194
    Change conductor to cast to build_and_run_instance

Gerrit topic: https://review.openstack.org/#q,topic:bug/1195947,n,z

Addressed by: https://review.openstack.org/57497
    Don't set to ERROR if deleted during build

Gerrit topic: https://review.openstack.org/#q,topic:network_alloc_6,n,z

Addressed by: https://review.openstack.org/58619
    Remove duplicate BuildAbortException block

Addressed by: https://review.openstack.org/58620
    Ensure proper notifications are sent when build finishes

Addressed by: https://review.openstack.org/59843
    Object-ify build_and_run_instance

Addressed by: https://review.openstack.org/57961
    Don't deallocate/reallocate networks on reschedules

Addressed by: https://review.openstack.org/62776
    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. https://wiki.openstack.org/wiki/Icehouse_Release_Schedule --russellb

Gerrit topic: https://review.openstack.org/#q,topic:bp/proposes,n,z

Addressed by: https://review.openstack.org/86988
    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
=============

(None)

Addressed by: https://review.openstack.org/92927
    Convert address to str in fixed_ip_obj.associate

Addressed by: https://review.openstack.org/94377
    Cells: Pass instance objects to build_instances

Addressed by: https://review.openstack.org/94452
    Add refresh=True to get_available_nodes call in build_and_run_instance

Addressed by: https://review.openstack.org/94453
    Call _validate_instance_group_policy in _build_and_run_instance

Addressed by: https://review.openstack.org/94663
    Use objects through the run_instance() path

Addressed by: https://review.openstack.org/94680
    Deprecate run_instance and remove unnecessary code

Gerrit topic: https://review.openstack.org/#q,topic:instance-exists,n,z

(?)

Work Items