nova-compute driver type has been changed from 'ironic' to 'libvirted', the nova-compute sevice is still can get by 'ironic' conpute_driver type

Bug #1815849 reported by lynn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
In Progress
Undecided
lynn

Bug Description

Description
===========
the cloud has 2 nova-compute service and both of their compute_driver is ironic. then changed one nova-compute service to libvirt.

when add more bm-nodes to the cloud,but some bm-nodes didn't show up in the hypervisor list

in the nova/virt/ironic/driver.py, the ironic driver has hash_ring of compute_services which are ironic type,
the hash_ring get the ironic type compute_services with the method of service_get_all_computes_by_hv_type(nova/db/sqlalchemy/api.py). The method get the services which have been deleted due to the nova compute services have been changed types of compute_driver with old host name can still be queried by old type

lynn (lynn901)
Changed in nova:
assignee: nobody → lynn (lynn901)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/637083

Changed in nova:
status: New → In Progress
Revision history for this message
Zhenyu Zheng (zhengzhenyu) wrote : Re: nova-compute driver type has been changed from 'ironic' to 'libvirted', the nova-compute sevice is still can get by 'ironic' hypervisor_type

I think your title and your content doesn't match, your title says, ``can still get`` seems to me
that you can get extra records that the old type is ``ironic``, but your content seems describes
the case that some of them is missing.

lynn (lynn901)
summary: nova-compute driver type has been changed from 'ironic' to 'libvirted',
- the nova-compute sevice is still can get by 'ironic' hypervisor_type
+ the nova-compute sevice is still can get by 'ironic' conpute_driver
+ type
description: updated
Revision history for this message
lynn (lynn901) wrote :

@ Zhenyu Zheng
thanks for your attention, i have update bug title and content.
hope to help you understand what i mention

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

lynn (lynn901)
description: updated
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Stephen Finucane (<email address hidden>) on branch: master
Review: https://review.opendev.org/637083

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.