openstack same_host & different_host does not take effect if specify only one uuid for the hint
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I was using same_host and different_host as schedule hint when create new instance, but found that same_host and different_host does not take effect if only specify only one uuid for hint.
The case is as following:
1) Create a new instance and the instance uuid is ff81ed99-
2) Create another instance and I want the new instance running on the same host with the first instance.
nova boot --image 796503bf-
The result is that the new instance will failed because nova cannot find a valid host, checking code for the filter.
class SameHostFilter(
'''Schedule the instance on the same host as another instance in a set of
of instances.
'''
def host_passes(self, host_state, filter_properties):
context = filter_
me = host_state.host
if affinity_uuids:
return any([i for i
# With no same_host key
return True
It looks like this is just a usage issue. You need to put square brackets around the single UUID.
So, instead of:
--hint same_host= ff81ed99- 78bb-4285- 87a0-33e12a919e bc
do:
--hint same_host= [ff81ed99- 78bb-4285- 87a0-33e12a919e bc]