diff --git a/devstack/plugin.sh b/devstack/plugin.sh index ee5faffd29..c76982c886 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -87,6 +87,12 @@ function octavia_configure { iniuncomment $OCTAVIA_CONF haproxy_amphora connection_max_retries iniuncomment $OCTAVIA_CONF haproxy_amphora connection_retry_interval + # devstack optimizations for tempest runs + iniset $OCTAVIA_CONF haproxy_amphora connection_max_retries 1500 + iniset $OCTAVIA_CONF haproxy_amphora connection_retry_interval 1 + iniset $OCTAVIA_CONF controller_worker amp_active_retries 100 + iniset $OCTAVIA_CONF controller_worker amp_active_wait_sec 1 + if [[ -a $OCTAVIA_SSH_DIR ]] ; then rm -rf $OCTAVIA_SSH_DIR fi diff --git a/diskimage-create/diskimage-create.sh b/diskimage-create/diskimage-create.sh index 0af2f3a4d5..082dcffa58 100755 --- a/diskimage-create/diskimage-create.sh +++ b/diskimage-create/diskimage-create.sh @@ -327,6 +327,9 @@ if [ "$AMP_ROOTPW" ]; then export DIB_PASSWORD=$AMP_ROOTPW fi +# Add the devstack no-resolvconf hack +AMP_element_sequence="$AMP_element_sequence no-resolvconf" + # Add the Octavia Amphora agent.py element AMP_element_sequence="$AMP_element_sequence amphora-agent" diff --git a/elements/no-resolvconf/README.rst b/elements/no-resolvconf/README.rst new file mode 100644 index 0000000000..04f91c8821 --- /dev/null +++ b/elements/no-resolvconf/README.rst @@ -0,0 +1,9 @@ +This element clears out /etc/resolv.conf and prevents dhclient from populating +it with data from DHCP. This means that DNS resolution will not work from the +amphora. This is OK because all outbound connections from the amphora will +be based using raw IP addresses. + +This has the real benefit of speeding up host boot and configutation times. +This is especially helpful when running tempest tests in a devstack environment +where DNS resolution from the amphora usually doesn't work anyway: This means +that the amphora never waits for DNS timeouts to occur. diff --git a/elements/no-resolvconf/finalise.d/99-disable-resolv-conf b/elements/no-resolvconf/finalise.d/99-disable-resolv-conf new file mode 100755 index 0000000000..2675b8ecf0 --- /dev/null +++ b/elements/no-resolvconf/finalise.d/99-disable-resolv-conf @@ -0,0 +1,7 @@ +#!/bin/bash +echo "" > /etc/resolv.conf +echo "" > /etc/resolv.conf.ORIG +echo "#!/bin/sh +make_resolv_conf() { : ; }" > /etc/dhcp/dhclient-enter-hooks.d/noresolvconf +chmod +x /etc/dhcp/dhclient-enter-hooks.d/noresolvconf +rm -f /etc/dhcp/dhclient-enter-hooks.d/resolvconf diff --git a/octavia/common/config.py b/octavia/common/config.py index 8197128b2d..9b68ecfa96 100644 --- a/octavia/common/config.py +++ b/octavia/common/config.py @@ -177,7 +177,8 @@ haproxy_amphora_opts = [ help=_('Retry threshold for connecting to amphorae.')), cfg.IntOpt('connection_retry_interval', default=5, - help=_('Retry timeout between attempts in seconds.')), + help=_('Retry timeout between connection attempts in ' + 'seconds.')), cfg.StrOpt('haproxy_stick_size', default='10k', help=_('Size of the HAProxy stick table. Accepts k, m, g ' 'suffixes. Example: 10k')), @@ -210,7 +211,8 @@ controller_worker_opts = [ help=_('Retry attempts to wait for Amphora to become active')), cfg.IntOpt('amp_active_wait_sec', default=10, - help=_('Seconds to wait for an Amphora to become active')), + help=_('Seconds to wait between checks on whether an Amphora ' + 'has become active')), cfg.StrOpt('amp_flavor_id', default='', help=_('Nova instance flavor id for the Amphora')),