r/openstack • • Aug 29 '21

Affinity AND Anti-Affinity?

Hi all... I did some Googling but can't find the answer to this:

Is it possible to have both Affinity and Anti-Affinity? I shall explain...

I have four servers, two DB and two web. I want each set of (DB/web) to be physically proximate, but each pair to be physically separate from the other pair.

Something like:

Group 1 (Affinity)Group 2 (Affinity)
DB 1DB 2
Web 1Web 2

Possible? I know I can create two Affinity groups, but that won't guarantee that they're on separate hosts, and vice-versa: I can create two Anti-Affinity groups, but that won't guarantee that the DB and web servers are on the same host.

7 Upvotes

3 comments sorted by

2

u/cheaphomemadeacid Aug 29 '21

I'd use anti-affinity + aggregates availability zones for that

1

u/mattparlane Aug 29 '21

Hmm... thanks for that. I'm just an end-user (admin for a web-hosting company), are aggregates available to me as an end-user? They're not mentioned anywhere in my hosting company's docs, although I see can access them via the API.

I'm not able to create flavors via the API (403) so does that mean I can't create aggregates?

1

u/optyx Aug 30 '21

Yea some rules are restricted. So what you can look at is scheduler hints. Depending on how you deploy your servers they may allow the hints near and far. So create the first server then use —hint in the boot command I think it’s “near:server_uuid” for the server it’s grouped with. Then far from the others.