← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1755683] Re: RequestSpec object has only one instance_uuid

 

Clearly we support creating multiple instances in the same request using
the anti-affinity server group policy and in fact that's the only
reliable way to make sure the scheduler puts them on separate hosts.

So it works, but maybe not how you'd expect. This is the code I'm aware
of that consumers the server group member on the given host after the
filter runs:

https://github.com/openstack/nova/blob/2ec8c49f6cb4a0e7dba217e824c20d9c703d2105/nova/scheduler/filter_scheduler.py#L326

Are you actually hitting some kind of error? If so, please re-phrase
this bug using the end-user workflow of what you're trying to do via the
API and what doesn't work.

If you're trying to hack the GroupAntiAffinityFilter to add your own
code, then this isn't a bug.

** Tags added: scheduler

** Changed in: nova
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1755683

Title:
  RequestSpec object has only one instance_uuid

Status in OpenStack Compute (nova):
  Invalid

Bug description:
  OpenStack Pike.
  I create more than one instances on the dashboard. The nova-scheduler will revice a argument named spec_obj.

  select_destinations(self, ctxt,request_spec=None,
  filter_properties=None,spec_obj=_sentinel, instance_uuids=None)

  spec_obj has a attribute named instance_uuid, the attribute will be
  used in GroupAntiAffinityFilter class.

  class _GroupAntiAffinityFilter(filters.BaseHostFilter):
      """Schedule the instance on a different host from a set of group
      hosts.
      """

      RUN_ON_REBUILD = False

      def host_passes(self, host_state, spec_obj):
          # Only invoke the filter if 'anti-affinity' is configured
          policies = (spec_obj.instance_group.policies
                      if spec_obj.instance_group else [])
          if self.policy_name not in policies:
              return True
          # NOTE(hanrong): Move operations like resize can check the same source
          # compute node where the instance is. That case, AntiAffinityFilter
          # must not return the source as a non-possible destination.
          if spec_obj.instance_uuid in host_state.instances.keys():
              return True

          group_hosts = (spec_obj.instance_group.hosts
                         if spec_obj.instance_group else [])
          LOG.debug("Group anti affinity: check if %(host)s not "
                    "in %(configured)s", {'host': host_state.host,
                                          'configured': group_hosts})
          if group_hosts:
              return host_state.host not in group_hosts

          # No groups configured
          return True

  When I create more than one instances, spec_obj.instance_uuid is
  always the same.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1755683/+subscriptions


References