Adds a new config for soft-anti-affinity

Introduces a new config parameter to specify the anti-affinity
policy.

Bumps nova version.

Closes-Bug: 1677604

Change-Id: I8c50057bd43873182058097e802bc839d1be0554
changes/24/451924/8
German Eichberger 6 years ago
parent afd6c2b874
commit e58721c4e0
  1. 6
      etc/octavia.conf
  2. 2
      octavia/common/clients.py
  3. 3
      octavia/common/config.py
  4. 1
      octavia/common/constants.py
  5. 2
      octavia/controller/worker/tasks/compute_tasks.py
  6. 3
      releasenotes/notes/add-anti-affinity-policy-config-39df309fd12d443c.yaml

@ -284,6 +284,12 @@
# Availability zone to use for creating Amphorae
# availability_zone =
# Enable anti-affinity in nova
# enable_anti_affinity = False
# Set the anti-affinity policy to what is suitable.
# Nova supports: anti-affinity and soft-anti-affinity
# anti_affinity_policy = anti-affinity
[glance]
# The name of the glance service in the keystone catalog
# service_name =

@ -26,7 +26,7 @@ CONF = cfg.CONF
GLANCE_VERSION = '2'
NEUTRON_VERSION = '2.0'
NOVA_VERSION = '2.1'
NOVA_VERSION = '2.15'
class NovaAuth(object):

@ -403,6 +403,9 @@ nova_opts = [
cfg.BoolOpt('enable_anti_affinity', default=False,
help=_('Flag to indicate if nova anti-affinity feature is '
'turned on.')),
cfg.StrOpt('anti_affinity_policy', default=constants.ANTI_AFFINITY,
choices=[constants.ANTI_AFFINITY, constants.SOFT_ANTI_AFFINITY],
help=_('Sets the anti-affinity policy for nova')),
cfg.IntOpt('random_amphora_name_length', default=0,
help=_('If non-zero, generate a random name of the length '
'provided for each amphora, in the format "a[A-Z0-9]*". '

@ -158,6 +158,7 @@ LOADBALANCER = 'loadbalancer'
LOADBALANCER_ID = 'loadbalancer_id'
SERVER_GROUP_ID = 'server_group_id'
ANTI_AFFINITY = 'anti-affinity'
SOFT_ANTI_AFFINITY = 'soft-anti-affinity'
MEMBER = 'member'
MEMBER_ID = 'member_id'
COMPUTE_ID = 'compute_id'

@ -208,7 +208,7 @@ class NovaServerGroupCreate(BaseComputeTask):
name = 'octavia-lb-' + loadbalancer_id
server_group = self.compute.create_server_group(
name, constants.ANTI_AFFINITY)
name, CONF.nova.anti_affinity_policy)
LOG.debug("Server Group created with id: %s for load balancer id: "
"%s", server_group.id, loadbalancer_id)
return server_group.id

@ -0,0 +1,3 @@
---
features:
- Adds a new config parameter to specify the anti-affinity policy
Loading…
Cancel
Save