@ Zhenyu Zheng the following is my truble shoot
https://github.com/openstack/nova/blob/master/nova/virt/ironic/driver.py > def _refresh_hash_ring(self, ctxt): > service_list = objects.ServiceList.get_all_computes_by_hv_type(ctxt, self._get_hypervisor_type())
https://github.com/openstack/nova/blob/master/nova/objects/service.py >> def get_all_computes_by_hv_type(cls, context, hv_type): db_services = db.service_get_all_computes_by_hv_type(context, hv_type, include_disabled=False)
https://github.com/openstack/nova/blob/master/nova/db/api.py >>> def service_get_all_computes_by_hv_type(context, hv_type, include_disabled=False): return IMPL.service_get_all_computes_by_hv_type(context, hv_type, include_disabled=include_disabled)
https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py >>>> def service_get_all_computes_by_hv_type(context, hv_type, include_disabled=False): query = model_query(context, models.Service, read_deleted="no").\ filter_by(binary='nova-compute') if not include_disabled: query = query.filter_by(disabled=False) query = query.join(models.ComputeNode, models.Service.host == models.ComputeNode.host).\ filter(models.ComputeNode.hypervisor_type == hv_type).\ distinct('host') return query.all()
@ Zhenyu Zheng
the following is my truble shoot
https:/ /github. com/openstack/ nova/blob/ master/ nova/virt/ ironic/ driver. py hash_ring( self, ctxt): ServiceList. get_all_ computes_ by_hv_type( ctxt, self._get_ hypervisor_ type())
> def _refresh_
> service_list = objects.
https:/ /github. com/openstack/ nova/blob/ master/ nova/objects/ service. py computes_ by_hv_type( cls, context, hv_type): get_all_ computes_ by_hv_type( context, hv_type, include_ disabled= False)
>> def get_all_
db_services = db.service_
https:/ /github. com/openstack/ nova/blob/ master/ nova/db/ api.py get_all_ computes_ by_hv_type( context, hv_type, include_ disabled= False): get_all_ computes_ by_hv_type( context, hv_type, include_ disabled= include_ disabled)
>>> def service_
return IMPL.service_
https:/ /github. com/openstack/ nova/blob/ master/ nova/db/ sqlalchemy/ api.py get_all_ computes_ by_hv_type( context, hv_type,
include_ disabled= False): context, models.Service, read_deleted= "no").\
filter_ by(binary= 'nova-compute' ) by(disabled= False) models. ComputeNode,
models. Service. host == models. ComputeNode. host).\
filter( models. ComputeNode. hypervisor_ type == hv_type).\
distinct( 'host')
>>>> def service_
query = model_query(
if not include_disabled:
query = query.filter_
query = query.join(
return query.all()