Public bug reported:

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.

** Affects: nova
     Importance: Undecided
         Status: New

** Description changed:

- I create more than one instances on the dashboard. The nova-scheduler
- will revice a argument named spec_obj.
+ 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.
-     """
+     """Schedule the instance on a different host from a set of group
+     hosts.
+     """
  
-     RUN_ON_REBUILD = False
+     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
+     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
+         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
+         # No groups configured
+         return True
  
  When I create more than one instances, spec_obj.instance_uuid is always
  the same.

-- 
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):
  New

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

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to