Prohibit use of UDP-CONNECT healthmonitor

Octavia UDP-CONNECT healthmonitor is not supported with NSX due to
mismatch in the operation mode and parameters.

Change-Id: I61b459fe2e3c0ddbc920b397a7aa5c162f559e30
This commit is contained in:
Kobi Samoray 2021-04-06 19:58:10 +03:00
parent 182cfc2524
commit 439755c1a8
2 changed files with 6 additions and 1 deletions

View File

@ -38,6 +38,7 @@ LB_HEALTH_MONITOR_PING = 'PING'
LB_HEALTH_MONITOR_TCP = 'TCP'
LB_HEALTH_MONITOR_HTTP = 'HTTP'
LB_HEALTH_MONITOR_HTTPS = 'HTTPS'
LB_HEALTH_MONITOR_UDP_CONNECT = 'UDP-CONNECT'
HEALTH_MONITOR_MAP = {
LB_HEALTH_MONITOR_PING: 'icmp',

View File

@ -32,9 +32,9 @@ from octavia_lib.api.drivers import exceptions
from octavia_lib.api.drivers import provider_base as driver_base
from vmware_nsx.services.lbaas import lb_const
from vmware_nsx.services.lbaas.octavia import constants as d_const
LOG = logging.getLogger(__name__)
cfg.CONF.import_group('oslo_messaging', 'octavia.common.config')
@ -492,6 +492,10 @@ class NSXOctaviaDriver(driver_base.ProviderDriver):
# Health Monitor
@log_helpers.log_method_call
def health_monitor_create(self, healthmonitor):
if healthmonitor.type == lb_const.LB_HEALTH_MONITOR_UDP_CONNECT:
raise exceptions.UnsupportedOptionError(
user_fault_string="UDP-CONNECT monitor is not supported")
kw = {'healthmonitor': self.obj_to_dict(healthmonitor)}
self.client.cast({}, 'healthmonitor_create', **kw)