Gary,

I hope you are doing well. I was trying to understand the logic in this code when using datastore_regex. It seems even if  you set that parameter and it matches some N datastores, the "free capacity " being returned by nova-compute is only from a single/best datastore.

def get_available_datastores(session, cluster=None, datastore_regex=None):
    """Get the datastore list and choose the first local storage."""
    ds = session._call_method(vutil,
                              "get_object_property",
                              cluster,
                              "datastore")

...
...

        if _is_datastore_valid(propdict, datastore_regex, allowed_ds_types):
            new_ds = ds_obj.Datastore(
                    ref=obj_content.obj,
                    name=propdict['summary.name'],
                    capacity=propdict['summary.capacity'],
                    freespace=propdict['summary.freeSpace'])
            # favor datastores with more free space
            if (best_match is None or
                new_ds.freespace > best_match.freespace):
                best_match = new_ds

    return best_match

The issue we are seeing is a customer has for example 5 x 10 GB data stores (DS1,..DS5.)  For whatever reason , DS1 was filled more fully and once it hit close to 100% no new instances could launch as the were blocked by the Nova DiskFilter. I know we can use the disk_allocation to "fool" this but why is not using to total cumulative storage as opposed to the one with most free or first one. I am wondering if there is some configuration issue. If it is supposed to use best_match, should that dynamically change among the matched regex Datastore to the one with most free space? Could it be it is somehow skipping the "best_match" and always using " first local storage"

I appreciate any suggestions or comments you have.

Keith

--

Keith Berger

Master Software Engineer
SUSE

(P)+1 470.237.2012
(M)+1 404.664.9610
keith.berger@suse.com