Comment 4 for bug 1815849

Revision history for this message
lynn (lynn901) wrote :

@ 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()