When get evacuated instance of host through API filtering will cause the main nova process to block for an extended amount of time.

Bug #1486026 reported by ZhuChunzhan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Low
Unassigned

Bug Description

When destory the evacuated instances from a host,first it will get the host's instance which are found on the hypervisor.
If the driver doesn't support uuids listing, it will get all the instances on openstack.It will cause the main nova process to block for an extended amount of time.
like below.
https://github.com/openstack/nova/blob/master/nova/compute/manager.py
 def _destroy_evacuated_instances(self, context):
  ...
        filters = {'deleted': False}
        local_instances = self._get_instances_on_driver(context, filters)
  ...

 def _get_instances_on_driver(self, context, filters=None):
   ...
        # The driver doesn't support uuids listing, so we'll have
        # to brute force.
        driver_instances = self.driver.list_instances()
        instances = objects.InstanceList.get_by_filters(context, filters,
                                                        use_slave=True)

So when get instances on the host which should be destoryed,it should filtering by uuids which were evacuated from current host.
 def _destroy_evacuated_instances(self, context):
   ...
        filters = {'deleted': False,
                     'uuid':[mig.instance_uuid for mig in evacuations]
                    }
        local_instances = self._get_instances_on_driver(context, filters)
        evacuations = {mig.instance_uuid: mig for mig in evacuations}
        evacuated = [inst for inst in local_instances
                            if inst.uuid in evacuations]
        for instance in evacuated:
   ...

ZhuChunzhan (zhucz)
information type: Private Security → Public
Changed in nova:
assignee: nobody → ZhuChunzhan (zhucz)
Revision history for this message
Tristan Cacqueray (tristan-cacqueray) wrote :

Is there a reason why this was reported as a security bug ?

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/214464

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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

Change abandoned by ZhuChunzhan (<email address hidden>) on branch: master
Review: https://review.openstack.org/214540
Reason: Mistkae the chage id,so abandon this chang.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by ZhuChunzhan (<email address hidden>) on branch: master
Review: https://review.openstack.org/214464
Reason: There has a mistake when I fix the bug.

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/214555

Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Michael Still (<email address hidden>) on branch: master
Review: https://review.openstack.org/214555
Reason: This patch has been idle for a long time, so I am abandoning it to keep the review clean sane. If you're interested in still working on this patch, then please unabandon it and upload a new patchset.

Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

Cleanup
=======

There are no open reviews for this bug report since more than 2 weeks.
To signal that to other contributors which might provide patches for
this bug, I switch the status from "In Progress" to "Confirmed" and
remove the assignee.
Feel free to add yourself as assignee and to push a review for it.

Changed in nova:
status: In Progress → Confirmed
assignee: ZhuChunzhan (zhucz) → nobody
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.