Host discovery should be faster

Registered by Dan Smith

Since some deployments will want to run host discovery periodically, we should make sure that the process is as lightweight as possible.

The "discover_hosts_in_cells_interval" config option was added in Ocata which is disabled by default but allows smaller deployments to run a periodic task from the nova-scheduler process which discovers new hosts and maps them to a cell. This is a way to automate the "nova-manage cell_v2 discover_hosts" command which needs to be run after new compute nodes are added to the deployment.

In the initial form in Ocata, the periodic is not as efficient as it could be. It queries all cells and then for each non-cell0 cell, it queries all compute_nodes records and for each compute node record, it checks for a related host_mappings record. If a host mapping is not found, one is created, else it just continues.

The point of this blueprint is to make this operation more efficient by flagging when a compute_nodes record is mapped to a host in the nova_api database, and then we can filter those compute nodes out of the initial query per-cell when running discover_hosts.

Blueprint information

Status:
Complete
Approver:
Matt Riedemann
Priority:
Medium
Drafter:
Dan Smith
Direction:
Approved
Assignee:
Dan Smith
Definition:
Approved
Series goal:
Accepted for pike
Implementation:
Implemented
Milestone target:
milestone icon pike-2
Started by
Matt Riedemann
Completed by
Matt Riedemann

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/discover-hosts-faster,n,z

Addressed by: https://review.openstack.org/427903
    Make discover_hosts only query for unmapped ComputeNode records

Addressed by: https://review.openstack.org/427902
    Add ability to query for ComputeNodes by their mapped value

Addressed by: https://review.openstack.org/427901
    Add ComputeNode.mapped field

This is pretty straight-forward and was discussed at the Pike PTG, so I'm going to approve this as a specless blueprint. -- mriedem 20170314

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.