[openstack-dev] [sahara] Anti-Affinity Broke

Joe Topjian joe at topjian.net
Fri Jun 22 03:00:16 UTC 2018


Hello,

I originally posted this to the general openstack list to get a sanity
check on what I was seeing. Jeremy F reached out and confirmed that, so I'm
going to re-post the details here to begin a discussion.

>From what I can see, anti-affinity is not working at all in Sahara. I was
able to get it working locally by making the following changes:

1. ng.count is either invalid, always returns 0, or isn't being set
somewhere else.

https://github.com/openstack/sahara/blob/master/sahara/service/heat/templates.py#L276

Instead, I've used

ng_count = self.node_groups_extra[ng.id]['node_count']

2. An uninitialized Python key:

https://github.com/openstack/sahara/blob/master/sahara/service/heat/templates.py#L283

3. Incorrect bounds in range():

https://github.com/openstack/sahara/blob/master/sahara/service/heat/templates.py#L255-L256

I believe this should be:

for i in range(0, self.cluster.anti_affinity_ratio):
    resources.update(self._serialize_aa_server_group(i+1))

https://github.com/openstack/sahara/blob/master/sahara/service/heat/templates.py#L278

I believe this should be:

for i in range(0, ng_count):

With the above in place, anti-affinity began working. The above changes
were all quick fixes to get it up and running, so there might be better
ways of going about this.

I can also create something on StoryBoard for this, too.

Thanks,
Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20180621/432bac30/attachment.html>


More information about the OpenStack-dev mailing list