Updating instance_uuid while scheduling a bulk of VMs

Bug #1324030 reported by Michal Dulko
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Opinion
Wishlist
Unassigned

Bug Description

This problem concerns custom scheduler filters and weighers which can be added by user in order to specify his own scheduling algorithm.
During scheduling of a single VM, it's UUID can be retrieved from filter_properties:
"request_spec": {
    "block_device_mapping": [ {
            "instance_uuid": "f47fdf0e-c4fe-45fb-a827-ad3a0840ea85"
        }
    ]
}

However, when a bulk of VMs is scheduled, custom filters or weighers are not able to read UUID of currently scheduled VM. "instance_uuid" in filter_properties is always the same. Problem is still present on Icehouse and nova's master.

Passing instance_uuid of a VM that is currently filtered or weighed could be done inside _schedule() method:

class FilterScheduler(driver.Scheduler):
    ...
    def _schedule(self, context, request_spec, filter_properties, instance_uuids=None):
        ...
        for num in xrange(num_instances):
            # Set the "instance_uuid" in filter_properties.
            # It is accessible from instance_uuids[num].

Tags: scheduler
Changed in nova:
assignee: nobody → Mateusz Blaszkowski (mateusz-blaszkowski-8)
status: New → In Progress
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/103902

Revision history for this message
Andrew Laski (alaski) wrote :

The scheduler should not have access to the list of instance_uuids, and I have been working to remove that. The reason that they're there now is for logging and to use the length of the uuid list to know how many instances to schedule. The request_spec now has a num_instance field to pass information on how many instances to schedule, and logging can be handled elsewhere.

I don't see how having the instance uuid provides any value to the scheduler as it will not be allowed to look up information on that instance. If there's some functionality that depends on it that I'm not considering then we should have a discussion about how best to provide what it needs without linking it to an instance directly. There is a work in progress to split the scheduler out of Nova and part of that is decoupling the scheduler so that it can rely on properties to filter/weigh on that are not tied to a specific instance.

Changed in nova:
importance: Undecided → Wishlist
Revision history for this message
Mateusz Blaszkowski (mateusz-blaszkowski-8) wrote :

Andrew, are you able to provide more details on removing the list of instance_uuids? Is there a bug or blueprint for this change? Could you also send me any links to the discussion about splitting scheduler out of Nova project? Any help would be really appreciated.

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

Change abandoned by Sean Dague (<email address hidden>) on branch: master
Review: https://review.openstack.org/103902
Reason: honestly, this change doesn't pass pep8 and has so much negative feedback. Please restore if you are going to work on it again.

Changed in nova:
status: In Progress → Confirmed
Changed in nova:
assignee: Mateusz Blaszkowski (mateusz-blaszkowski-8) → nobody
Chris Dent (cdent)
Changed in nova:
status: Confirmed → Opinion
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.