Nova-scheduler-HostState

Nova Scheduler HostState Change Proposal
lianhao-lu (talk) 04:27, 8 June 2013 (UTC) Created.

lianhao-lu (talk) 06:17, 21 June 2013 (UTC) Updated according to Rerngvit's comment.

Here we list the current HostState fields in nova scheduler, and proposed the potential changes required for the following blueprints: [1] :https://blueprints.launchpad.net/nova/+spec/utilization-aware-scheduling [2] :https://blueprints.launchpad.net/nova/+spec/generic-host-state-for-scheduler

Proposed changes to the HostState fields
We plan to use the following fields to replace the current HostState fields, which is extensible to store more information for the scheduler. Every nova compute host will have a corresponding HostState instance respectively.

1. A new dictionary 'resources' will contain the resource usage information(e.g. free_ram_mb, vcpus_used, etc.) about the platform in the following format:

{    : { 'value': , 'timestamp': , 'source':, i.e. nova-compute, ceilometer, etc.                   } }

The resource_name can contain any printable ascii characters other than ':' or '='.

2. Those statistic related fields(i.e. num_instances, vm_states, etc.) might need to grouped into a new dictionary 'stats', which would look something like the followings:

{ 'num_instances': 1 'num_instances_by_project': { 'project-id1': 2 'project-id2': 1 } 'vm_states': { 'active': 1 } }

3. The existing 'capabilities' will only contains features information of the compute node platform, i.e. cpu features, etc.

4. Other fields will remain unchanged.

5. For compatibility, the new HostState should also support the current method to access its current fields, e.g. host_state.num_instances, host_state.free_ram_mb, etc.

How to get the data(initial data source)
The data where stored in the 'resources' dictionary in HostState could be reported from the compute node periodically to the scheduler by RPC, as mentioned in UtilizationAwareScheduling according to blueprint. The data could also be collected from other service, e.g. ceilometer. However, there are some discussions in the community to argue that the data should be saved in to DB first: http://lists.openstack.org/pipermail/openstack-dev/2013-June/010653.html

If the community decides to store the data into DB then loaded by the scheduler for use, like the 'resource_tracker', the following DB scheme which is extensible is needed: