this is not a bug

the meaning of host_subset_size = 4 is that after the weighers prepare
the sorted set we should take a random selection from the first 4 in the list.

by setting host_subset_size = 4 you have opted into randomising the top
4 results.

this  config option is intended for use in large clouds with a lot of 
concurrent VM creatatiosn to provide
additional entropy to account for the fact that parallel requests can race for 
the same resources on the same host.

this is documented in the help text for the config option
https://docs.openstack.org/nova/latest/configuration/config.html#filter_scheduler.host_subset_size
"""
Size of subset of best hosts selected by scheduler.

New instances will be scheduled on a host chosen randomly from a subset
of the N best hosts, where N is the value set by this option.

Setting this to a value greater than 1 will reduce the chance that multiple 
scheduler processes handling similar requests will select the same host, 
creating a potential race condition. By selecting a host randomly from the N 
hosts that best fit the request, the chance of a conflict is reduced. However, 
the higher you set this value, the less optimal the chosen host may be for a 
given request.
 """

if you want the schudler to be deterministic with regards to the weigher
you should set this to 1

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

** Tags removed: wallaby-rc-potential

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

Title:
  Scheduler is not choosing host based on higher weight value

Status in OpenStack Compute (nova):
  Invalid

Bug description:
  Description:
  ===========

  
  As part of the openstack scheduling behaviour, able to observe this pattern 
where scheduling is not happening based on weight values, instead it is picking 
a random host from the list, thus violates the weighting behaviour

  Configuration Nova:
  ===========

  ram_weight_multiplier = 5.0
  host_subset_size = 4

  Steps To reproduce:
  ===========

  I am testing this is in nova-23.2.0 ( Wallaby ) version based on
  openstack-ansible

  1) Create aggregate & make sure it has 5 hosts in it
  2) Please make sure we are using instance extra spec for scheduling, to make 
sure vm's to use these 5 hosts from the aggregate
  3) create 3 vm's in parallel
  4) weighed_hosts obj list's all available weight hosts ( already sorted based 
on descending order ]
  5) We are setting host_subset_size as 4 currently
  6) 
           
          chosen_host = random.choice(weighed_subset)-----> [Since this is 
already sorted , why are we randomizing the behaviour rather than picking the 
first host ,weighed_subset[0] having higher weights]
          

  Expected Results:
  ===========
  1) Host with higher weights need's to be picked

  
  Actual result
  =============

  1) It is picking based on random order from the sorted weighted list

  
  Not sure the purpose of picking random host on the below one

  
https://github.com/openstack/nova/blob/stable/yoga/nova/scheduler/manager.py#L645

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


-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to