Pass network requests to scheduler

Registered by Xinyuan Huang

Since network requests can be useful for scheduler to make network related placement decisions, it makes sense to pass this piece of information into scheduler, so that proper destination hosts can be selected before instances being built and networks being allocated.

Currently, the network request is passed to nova from the ‘create’ method of compute api on instance booting requests. It goes all the way through to the conductor, which takes this as a param called ‘requested_networks’ in the ‘build_instances’ method, where the following relevant calls are made:

nova.scheduler.utils.build_request_spec() (without ’requested_networks’)
nova.scheduler.client.select_destinations() (with ‘request_spec’, without ‘requested_networks’)
nova.compute.rpcapi.build_and_run_instance() (with ‘requested_networks’)

In this process, the ’requested_networks’ param is directly passed to compute_rpcapi, without getting into the scheduler, and this makes the scheduler blind about which networks are requested.

This blueprint addresses this issue and aims to pass ‘requested_networks’ to scheduler. Based on the situation above, passing an optional ‘requested_networks’ param when building the ‘request_spec’ dict in conductor seems to be a direct and obvious solution.

The changes involved in the scheduler utils and conductor manager would Not depend on, or affect the functionality of request_spec object currently being implemented, and no api changes will be required. However we do recommend that the future request_spec object take ‘requested_networks’ as an attribute so the network requests info can continue benefiting scheduler when we fully switch to use this spec object.

Blueprint information

Status:
Started
Approver:
None
Priority:
Undefined
Drafter:
Xinyuan Huang
Direction:
Needs approval
Assignee:
Xinyuan Huang
Definition:
New
Series goal:
None
Implementation:
Started
Milestone target:
None
Started by
Xinyuan Huang

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/pass-net-req-to-scheduler,n,z

Addressed by: https://review.openstack.org/195696
    Proposes passing network requests to scheduler

Gerrit topic: https://review.openstack.org/#/q/topic:bp/pass-net-req-to-scheduler,n,z

Addressed by: https://review.openstack.org/193635
    Pass requested_networks to scheduler

(?)

Work Items

Work items:
Modify nova.scheduler.utils.build_request_spec() by adding requested_networks as an optional param, and do pass it when calling build_request_spec() in nova.conductor.manager.build_instances(): DONE
Modify the future RequestSpec object by adding requested_networks as a field: TODO

This blueprint contains Public information 
Everyone can see this information.