From a529033fdcb36ccea8cf0cc76339816ed31418c7 Mon Sep 17 00:00:00 2001 From: Vladimir Kuklin Date: Thu, 19 Jan 2017 17:35:35 +0300 Subject: [PATCH] Set memcached server to local one for non-keyston services We misconfigured local cache for services with change https://review.openstack.org/#/q/Id1034e22d79c3ea6b25575d9bcf8e8750a02365d Thus, it becomes extremely slow when a controller is down. With this commit we revert things back to normal with local memcached for all openstack services leaving keystone memcached shared for tokens (this was thoroughly tested previously) Change-Id: I8f6bbf77d27f3d8976985241deb8a948984862f5 Closes-bug: #1657727 --- .../openstack_tasks/manifests/aodh/aodh.pp | 3 ++- .../manifests/ceilometer/controller.pp | 3 ++- .../manifests/glance/glance.pp | 11 +++++----- .../openstack_tasks/manifests/heat/heat.pp | 5 +++-- .../manifests/ironic/ironic.pp | 3 ++- .../manifests/murano/murano.pp | 3 ++- .../openstack_cinder/openstack_cinder.pp | 3 ++- .../openstack_controller.pp | 12 +++-------- .../openstack_network/server_config.pp | 3 ++- .../manifests/roles/compute.pp | 3 ++- .../manifests/roles/ironic_conductor.pp | 3 ++- .../manifests/sahara/sahara.pp | 3 ++- .../manifests/swift/proxy_storage.pp | 3 ++- .../manifests/globals/globals.pp | 6 ++++++ .../osnailyfacter/templates/globals_yaml.erb | 1 + tests/noop/spec/hosts/aodh/aodh_spec.rb | 5 +++-- .../spec/hosts/ceilometer/controller_spec.rb | 5 +++-- tests/noop/spec/hosts/glance/glance_spec.rb | 21 ++++++++++--------- tests/noop/spec/hosts/heat/heat_spec.rb | 7 ++++--- tests/noop/spec/hosts/ironic/ironic_spec.rb | 5 +++-- tests/noop/spec/hosts/murano/murano_spec.rb | 3 ++- .../openstack-cinder/openstack-cinder_spec.rb | 3 ++- .../openstack-controller_spec.rb | 9 ++++---- .../openstack-network/server-config_spec.rb | 5 +++-- tests/noop/spec/hosts/roles/compute_spec.rb | 5 +++-- .../spec/hosts/roles/ironic-conductor_spec.rb | 3 ++- tests/noop/spec/hosts/sahara/sahara_spec.rb | 3 ++- .../spec/hosts/swift/proxy_storage_spec.rb | 5 +++-- 28 files changed, 85 insertions(+), 59 deletions(-) diff --git a/deployment/puppet/openstack_tasks/manifests/aodh/aodh.pp b/deployment/puppet/openstack_tasks/manifests/aodh/aodh.pp index 5db4d4065f..b0ff1947e0 100644 --- a/deployment/puppet/openstack_tasks/manifests/aodh/aodh.pp +++ b/deployment/puppet/openstack_tasks/manifests/aodh/aodh.pp @@ -77,6 +77,7 @@ $public_cert = get_ssl_property($ssl_hash, $public_ssl_hash, 'keystone', 'public', 'path', ['']) $memcached_servers = hiera('memcached_servers') + $local_memcached_server = hiera('local_memcached_server') $internal_auth_protocol = get_ssl_property($ssl_hash, {}, 'keystone', 'internal', 'protocol', 'http') $internal_auth_address = get_ssl_property($ssl_hash, {}, 'keystone', 'internal', 'hostname', [$management_vip]) @@ -147,7 +148,7 @@ project_name => $tenant, auth_uri => $keystone_auth_uri, auth_url => $keystone_auth_url, - memcached_servers => $memcached_servers, + memcached_servers => $local_memcached_server, } class { '::aodh::api': diff --git a/deployment/puppet/openstack_tasks/manifests/ceilometer/controller.pp b/deployment/puppet/openstack_tasks/manifests/ceilometer/controller.pp index e9409cc454..2868b927e7 100644 --- a/deployment/puppet/openstack_tasks/manifests/ceilometer/controller.pp +++ b/deployment/puppet/openstack_tasks/manifests/ceilometer/controller.pp @@ -45,6 +45,7 @@ $keystone_auth_uri = "${internal_auth_protocol}://${internal_auth_endpoint}:5000/" $memcached_servers = hiera('memcached_servers') + $local_memcached_server = hiera('local_memcached_server') #as $ssl default value in ceilometer::wsgi::apache is true and #we use SSL at HAproxy, but not the API host we should set 'false' @@ -181,7 +182,7 @@ project_name => $ceilometer_hash['tenant'], auth_url => $keystone_auth_url, auth_uri => $keystone_auth_uri, - memcached_servers => $memcached_servers, + memcached_servers => $local_memcached_server, } # Install the ceilometer-api service diff --git a/deployment/puppet/openstack_tasks/manifests/glance/glance.pp b/deployment/puppet/openstack_tasks/manifests/glance/glance.pp index da3ad50f76..5bbeaec0a3 100644 --- a/deployment/puppet/openstack_tasks/manifests/glance/glance.pp +++ b/deployment/puppet/openstack_tasks/manifests/glance/glance.pp @@ -28,6 +28,7 @@ $primary_controller = hiera('primary_controller') $kombu_compression = hiera('kombu_compression', $::os_service_default) $memcached_servers = hiera('memcached_servers') + $local_memcached_server = hiera('local_memcached_server') $rabbit_heartbeat_timeout_threshold = pick($glance_hash['rabbit_heartbeat_timeout_threshold'], $rabbit_hash['heartbeat_timeout_threshold'], 60) $rabbit_heartbeat_rate = pick($glance_hash['rabbit_heartbeat_rate'], $rabbit_hash['rabbit_heartbeat_rate'], 2) @@ -129,8 +130,8 @@ project_name => $glance_tenant, auth_url => $auth_url, auth_uri => $auth_uri, - token_cache_time => '-1', - memcached_servers => $memcached_servers, + token_cache_time => '300', + memcached_servers => $local_memcached_server, } # Install and configure glance-api @@ -182,8 +183,8 @@ project_name => $glance_glare_tenant, auth_url => $auth_url, auth_uri => $auth_uri, - token_cache_time => '-1', - memcached_servers => $memcached_servers, + token_cache_time => '300', + memcached_servers => $local_memcached_server, } class { '::glance::glare': @@ -211,7 +212,7 @@ project_name => $glance_tenant, auth_url => $auth_url, auth_uri => $auth_uri, - memcached_servers => $memcached_servers, + memcached_servers => $local_memcached_server, } # Install and configure glance-registry diff --git a/deployment/puppet/openstack_tasks/manifests/heat/heat.pp b/deployment/puppet/openstack_tasks/manifests/heat/heat.pp index a69c366660..f95d341117 100644 --- a/deployment/puppet/openstack_tasks/manifests/heat/heat.pp +++ b/deployment/puppet/openstack_tasks/manifests/heat/heat.pp @@ -52,6 +52,7 @@ $deployment_mode = hiera('deployment_mode') $bind_host = get_network_role_property('heat/api', 'ipaddr') $memcached_servers = hiera('memcached_servers') + $local_memcached_server = hiera('local_memcached_server') $keystone_user = pick($heat_hash['user'], 'heat') $keystone_tenant = pick($heat_hash['tenant'], 'services') $region = hiera('region', 'RegionOne') @@ -119,7 +120,7 @@ heat_config { 'cache/enabled': value => true; 'cache/backend': value => 'oslo_cache.memcache_pool'; - 'cache/memcache_servers': value => join(any2array($memcached_servers), ',') + 'cache/memcache_servers': value => $local_memcached_server; } # TODO(aschultz): ubuntu does not have a heat docker package @@ -187,7 +188,7 @@ project_name => $keystone_tenant, auth_uri => $auth_uri, auth_url => $auth_url, - memcached_servers => $memcached_servers, + memcached_servers => $local_memcached_server, } # Common configuration, logging and RPC diff --git a/deployment/puppet/openstack_tasks/manifests/ironic/ironic.pp b/deployment/puppet/openstack_tasks/manifests/ironic/ironic.pp index 40112dcaaa..61807b88e4 100644 --- a/deployment/puppet/openstack_tasks/manifests/ironic/ironic.pp +++ b/deployment/puppet/openstack_tasks/manifests/ironic/ironic.pp @@ -26,6 +26,7 @@ $kombu_compression = hiera('kombu_compression', $::os_service_default) $memcached_servers = hiera('memcached_servers') + $local_memcached_server = hiera('local_memcached_server') $db_type = pick($ironic_hash['db_type'], 'mysql+pymysql') $db_host = pick($ironic_hash['db_host'], $database_vip) @@ -98,7 +99,7 @@ project_name => $ironic_tenant, auth_url => $admin_identity_uri, auth_uri => $internal_auth_url, - memcached_servers => $memcached_servers, + memcached_servers => $local_memcached_server, } class { '::ironic::api': diff --git a/deployment/puppet/openstack_tasks/manifests/murano/murano.pp b/deployment/puppet/openstack_tasks/manifests/murano/murano.pp index 16b334bdd8..6709ae214c 100644 --- a/deployment/puppet/openstack_tasks/manifests/murano/murano.pp +++ b/deployment/puppet/openstack_tasks/manifests/murano/murano.pp @@ -28,6 +28,7 @@ $primary_controller = hiera('primary_controller') $kombu_compression = hiera('kombu_compression', $::os_service_default) $memcached_servers = hiera('memcached_servers') + $local_memcached_server = hiera('local_memcached_server') $public_auth_protocol = get_ssl_property($ssl_hash, $public_ssl_hash, 'keystone', 'public', 'protocol', 'http') $public_auth_address = get_ssl_property($ssl_hash, $public_ssl_hash, 'keystone', 'public', 'hostname', [$public_ip]) @@ -150,7 +151,7 @@ external_network => $external_network, use_trusts => true, kombu_compression => $kombu_compression, - memcached_servers => $memcached_servers, + memcached_servers => $local_memcached_server, } class { '::murano::api': diff --git a/deployment/puppet/openstack_tasks/manifests/openstack_cinder/openstack_cinder.pp b/deployment/puppet/openstack_tasks/manifests/openstack_cinder/openstack_cinder.pp index ce03683193..f5e3e89abf 100644 --- a/deployment/puppet/openstack_tasks/manifests/openstack_cinder/openstack_cinder.pp +++ b/deployment/puppet/openstack_tasks/manifests/openstack_cinder/openstack_cinder.pp @@ -24,6 +24,7 @@ $proxy_port = hiera('proxy_port', '8080') $kombu_compression = hiera('kombu_compression', $::os_service_default) $memcached_servers = hiera('memcached_servers') + $local_memcached_server = hiera('local_memcached_server') $default_volume_type = pick($cinder_hash['default_volume_type'], $::os_service_default) $db_type = pick($cinder_hash['db_type'], 'mysql+pymysql') $db_host = pick($cinder_hash['db_host'], hiera('database_vip')) @@ -163,7 +164,7 @@ username => $keystone_user, project_name => $keystone_tenant, password => $cinder_user_password, - memcached_servers => $memcached_servers, + memcached_servers => $local_memcached_server, auth_version => $keystone_api, } diff --git a/deployment/puppet/openstack_tasks/manifests/openstack_controller/openstack_controller.pp b/deployment/puppet/openstack_tasks/manifests/openstack_controller/openstack_controller.pp index 82642297cd..aaec55b589 100644 --- a/deployment/puppet/openstack_tasks/manifests/openstack_controller/openstack_controller.pp +++ b/deployment/puppet/openstack_tasks/manifests/openstack_controller/openstack_controller.pp @@ -153,13 +153,7 @@ } $memcached_servers = hiera('memcached_servers') - - # LP1621541 In order to increase nova performance after failover, - # we need to point nova to local memcached instance for keystone tokens, - # in future we can consider moving memcached under HAproxy - $memcached_port = hiera('memcache_server_port', '11211') - $memcached_address = get_network_role_property('mgmt/memcache', 'ipaddr') - $memcached_authtoken_server = "${memcached_address}:${memcached_port}" + $local_memcached_server = hiera('local_memcached_server') $debug = pick($openstack_controller_hash['debug'], hiera('debug', true)) @@ -211,7 +205,7 @@ class { '::nova::cache': enabled => true, backend => 'oslo_cache.memcache_pool', - memcache_servers => $memcached_servers, + memcache_servers => $local_memcached_server, } } else { ensure_packages($pymemcache_package_name) @@ -264,7 +258,7 @@ auth_url => $keystone_auth_url, auth_uri => $keystone_auth_uri, auth_version => pick($nova_hash['auth_version'], $::os_service_default), - memcached_servers => $memcached_authtoken_server, + memcached_servers => $local_memcached_server, } # Configure nova-api diff --git a/deployment/puppet/openstack_tasks/manifests/openstack_network/server_config.pp b/deployment/puppet/openstack_tasks/manifests/openstack_network/server_config.pp index 64e65d6740..dca7558dcb 100644 --- a/deployment/puppet/openstack_tasks/manifests/openstack_network/server_config.pp +++ b/deployment/puppet/openstack_tasks/manifests/openstack_network/server_config.pp @@ -50,6 +50,7 @@ $region_name = hiera('region', 'RegionOne') $auth_endpoint_type = 'internalURL' $memcached_servers = hiera('memcached_servers') + $local_memcached_server = hiera('local_memcached_server') $ssl_hash = hiera_hash('use_ssl', {}) @@ -188,7 +189,7 @@ region_name => $region_name, auth_url => $auth_url, auth_uri => $auth_uri, - memcached_servers => $memcached_servers, + memcached_servers => $local_memcached_server, } class { '::neutron::server': diff --git a/deployment/puppet/openstack_tasks/manifests/roles/compute.pp b/deployment/puppet/openstack_tasks/manifests/roles/compute.pp index d3b7606187..96d99ba16b 100644 --- a/deployment/puppet/openstack_tasks/manifests/roles/compute.pp +++ b/deployment/puppet/openstack_tasks/manifests/roles/compute.pp @@ -60,6 +60,7 @@ ##CALCULATED PARAMETERS $memcached_servers = hiera('memcached_servers') + $local_memcached_server = hiera('local_memcached_server') # TODO(xarses): We need to validate this is needed if ($storage_hash['volumes_lvm']) { @@ -265,7 +266,7 @@ class { '::nova::cache': enabled => $nova_cache, backend => 'oslo_cache.memcache_pool', - memcache_servers => $memcached_servers, + memcache_servers => $local_memcached_server, } class { '::nova::availability_zone': diff --git a/deployment/puppet/openstack_tasks/manifests/roles/ironic_conductor.pp b/deployment/puppet/openstack_tasks/manifests/roles/ironic_conductor.pp index eb1cb9cc3f..b8f43681d1 100644 --- a/deployment/puppet/openstack_tasks/manifests/roles/ironic_conductor.pp +++ b/deployment/puppet/openstack_tasks/manifests/roles/ironic_conductor.pp @@ -31,6 +31,7 @@ $ironic_user_password = pick($ironic_hash['user_password'],'ironic') $ironic_swift_tempurl_key = pick($ironic_hash['swift_tempurl_key'],'ironic') $memcached_servers = hiera('memcached_servers') + $local_memcached_server = hiera('local_memcached_server') $ssl_hash = hiera('use_ssl', {}) $neutron_endpoint_default = hiera('neutron_endpoint', $management_vip) @@ -116,7 +117,7 @@ 'keystone_authtoken/admin_tenant_name': value => $ironic_tenant; 'keystone_authtoken/admin_user': value => $ironic_user; 'keystone_authtoken/admin_password': value => $ironic_user_password, secret => true; - 'keystone_authtoken/memcached_servers': value => join(any2array($memcached_servers), ','); + 'keystone_authtoken/memcached_servers': value => $local_memcached_server; 'glance/swift_endpoint_url': value => "http://${baremetal_vip}:8080"; 'glance/temp_url_endpoint_type': value => $temp_url_endpoint_type; } diff --git a/deployment/puppet/openstack_tasks/manifests/sahara/sahara.pp b/deployment/puppet/openstack_tasks/manifests/sahara/sahara.pp index 1940e23188..f7ffd995ad 100644 --- a/deployment/puppet/openstack_tasks/manifests/sahara/sahara.pp +++ b/deployment/puppet/openstack_tasks/manifests/sahara/sahara.pp @@ -32,6 +32,7 @@ $admin_identity_uri = "${admin_identity_protocol}://${admin_identity_address}:35357" $kombu_compression = hiera('kombu_compression', $::os_service_default) $memcached_servers = hiera('memcached_servers') + $local_memcached_server = hiera('local_memcached_server') ################################################################# @@ -111,7 +112,7 @@ rabbit_port => $amqp_port, rabbit_hosts => split($amqp_hosts, ','), kombu_compression => $kombu_compression, - memcached_servers => $memcached_servers, + memcached_servers => $local_memcached_server, } if $public_ssl_hash['services'] { diff --git a/deployment/puppet/openstack_tasks/manifests/swift/proxy_storage.pp b/deployment/puppet/openstack_tasks/manifests/swift/proxy_storage.pp index 3df099432c..10e243b417 100644 --- a/deployment/puppet/openstack_tasks/manifests/swift/proxy_storage.pp +++ b/deployment/puppet/openstack_tasks/manifests/swift/proxy_storage.pp @@ -13,6 +13,7 @@ $swift_host_ip_map = get_node_to_ipaddr_map_by_network_role(hiera_hash('swift_proxies', {}), 'swift/api') $swift_proxies_addr_list = sorted_hosts($swift_host_ip_map, 'ip', 'ip') $memcached_servers = hiera('memcached_servers') + $local_memcached_server = hiera('local_memcached_server') $is_primary_swift_proxy = hiera('is_primary_swift_proxy', false) $proxy_port = hiera('proxy_port', '8080') $storage_hash = hiera_hash('storage') @@ -79,7 +80,7 @@ class { 'openstack_tasks::swift::parts::proxy': swift_user_password => $swift_hash['user_password'], swift_operator_roles => $swift_operator_roles, - memcached_servers => $memcached_servers, + memcached_servers => $local_memcached_server, ring_part_power => $ring_part_power, ring_replicas => $ring_replicas, primary_proxy => $is_primary_swift_proxy, diff --git a/deployment/puppet/osnailyfacter/manifests/globals/globals.pp b/deployment/puppet/osnailyfacter/manifests/globals/globals.pp index af5492d036..c1d7ebfb49 100644 --- a/deployment/puppet/osnailyfacter/manifests/globals/globals.pp +++ b/deployment/puppet/osnailyfacter/manifests/globals/globals.pp @@ -519,6 +519,12 @@ $memcached_port = hiera('memcache_server_port', '11211') $memcached_servers = suffix($memcached_addresses, ":${memcached_port}") + # LP1621541 In order to increase nova performance after failover, + # we need to point nova to local memcached instance for keystone tokens, + # in future we can consider moving memcached under HAproxy + $memcached_bind_address = get_network_role_property('mgmt/memcache', 'ipaddr') + $local_memcached_server = "${memcached_bind_address}:${memcached_port}" + $cinder_backends = { 'volumes_ceph' => $storage_hash['volumes_ceph'] ? { true => 'RBD-backend', default => false }, 'volumes_lvm' => $storage_hash['volumes_lvm'] ? { true => 'LVM-backend', default => false }, diff --git a/deployment/puppet/osnailyfacter/templates/globals_yaml.erb b/deployment/puppet/osnailyfacter/templates/globals_yaml.erb index 886234220a..55ba8cc16b 100644 --- a/deployment/puppet/osnailyfacter/templates/globals_yaml.erb +++ b/deployment/puppet/osnailyfacter/templates/globals_yaml.erb @@ -122,6 +122,7 @@ <% globals.store "memcached_addresses", @memcached_addresses -%> <% globals.store "memcached_port", @memcached_port -%> <% globals.store "memcached_servers", @memcached_servers -%> +<% globals.store "local_memcached_server", @local_memcached_server -%> <% globals.store "swift_master_role", @swift_master_role -%> <% globals.store "swift_nodes", @swift_nodes -%> <% globals.store "swift_proxies", @swift_proxies -%> diff --git a/tests/noop/spec/hosts/aodh/aodh_spec.rb b/tests/noop/spec/hosts/aodh/aodh_spec.rb index 6a82363abf..9a369f1557 100644 --- a/tests/noop/spec/hosts/aodh/aodh_spec.rb +++ b/tests/noop/spec/hosts/aodh/aodh_spec.rb @@ -16,6 +16,7 @@ end let(:memcached_servers) { Noop.hiera 'memcached_servers' } + let(:local_memcached_server) { Noop.hiera 'local_memcached_server' } let(:aodh_api_bind_host) do aodh_api_bind_host = Noop.puppet_function 'get_network_role_property', 'aodh/api', 'ipaddr' @@ -72,7 +73,7 @@ 'project_name' => tenant, 'auth_uri' => keystone_auth_uri, 'auth_url' => keystone_auth_url, - 'memcached_servers' => memcached_servers, + 'memcached_servers' => local_memcached_server, ) end @@ -108,7 +109,7 @@ it 'should configure "keystone_authtoken/" section' do - should contain_aodh_config('keystone_authtoken/memcached_servers').with(:value => memcached_servers.join(',')) + should contain_aodh_config('keystone_authtoken/memcached_servers').with(:value => local_memcached_server) should contain_aodh_config('keystone_authtoken/auth_url').with(:value => keystone_auth_url) should contain_aodh_config('keystone_authtoken/auth_uri').with(:value => keystone_auth_uri) should contain_aodh_config('keystone_authtoken/project_name').with(:value => tenant) diff --git a/tests/noop/spec/hosts/ceilometer/controller_spec.rb b/tests/noop/spec/hosts/ceilometer/controller_spec.rb index c3df8a09d1..f17016cba1 100644 --- a/tests/noop/spec/hosts/ceilometer/controller_spec.rb +++ b/tests/noop/spec/hosts/ceilometer/controller_spec.rb @@ -58,6 +58,7 @@ ssl = 'false' let(:memcached_servers) { Noop.hiera 'memcached_servers' } + let(:local_memcached_server) { Noop.hiera 'local_memcached_server' } let (:api_bind_address) do api_bind_address = Noop.puppet_function('get_network_role_property', 'ceilometer/api', 'ipaddr') end @@ -101,7 +102,7 @@ 'project_name' => ceilometer_tenant, 'auth_url' => keystone_auth_url, 'auth_uri' => keystone_auth_uri, - 'memcached_servers' => memcached_servers, + 'memcached_servers' => local_memcached_server ) end @@ -118,7 +119,7 @@ should contain_ceilometer_config('keystone_authtoken/project_name').with(:value => ceilometer_tenant) should contain_ceilometer_config('keystone_authtoken/auth_uri').with(:value => keystone_auth_uri) should contain_ceilometer_config('keystone_authtoken/auth_url').with(:value => keystone_auth_url) - should contain_ceilometer_config('keystone_authtoken/memcached_servers').with(:value => memcached_servers.join(',')) + should contain_ceilometer_config('keystone_authtoken/memcached_servers').with(:value => local_memcached_server) end it 'should configure interface (ex. OS ENDPOINT TYPE) for ceilometer' do diff --git a/tests/noop/spec/hosts/glance/glance_spec.rb b/tests/noop/spec/hosts/glance/glance_spec.rb index 3a85ead79c..017748f5c5 100644 --- a/tests/noop/spec/hosts/glance/glance_spec.rb +++ b/tests/noop/spec/hosts/glance/glance_spec.rb @@ -80,6 +80,7 @@ let(:auth_url) { "#{admin_auth_protocol}://#{admin_auth_address}:35357/" } let(:memcached_servers) { Noop.hiera 'memcached_servers' } + let(:local_memcached_server) { Noop.hiera 'local_memcached_server' } let(:transport_url) { Noop.hiera 'transport_url', 'rabbit://guest:password@127.0.0.1:5672/' } @@ -106,8 +107,8 @@ 'project_name' => glance_project_name, 'auth_url' => auth_url, 'auth_uri' => auth_uri, - 'token_cache_time' => '-1', - 'memcached_servers' => memcached_servers) + 'token_cache_time' => 300, + 'memcached_servers' => local_memcached_server) end it 'should have correct auth options for Glance Glare' do @@ -117,8 +118,8 @@ 'project_name' => glance_glare_project_name, 'auth_url' => auth_url, 'auth_uri' => auth_uri, - 'token_cache_time' => '-1', - 'memcached_servers' => memcached_servers) + 'token_cache_time' => 300, + 'memcached_servers' => local_memcached_server) end it 'should have correct auth options for Glance Registry' do @@ -128,7 +129,7 @@ 'project_name' => glance_project_name, 'auth_url' => auth_url, 'auth_uri' => auth_uri, - 'memcached_servers' => memcached_servers) + 'memcached_servers' => local_memcached_server) end it 'should configure workers for API, registry services' do @@ -173,8 +174,8 @@ should contain_glance_api_config('keystone_authtoken/username').with_value(glance_username) should contain_glance_api_config('keystone_authtoken/password').with_value(glance_password) should contain_glance_api_config('keystone_authtoken/project_name').with_value(glance_project_name) - should contain_glance_api_config('keystone_authtoken/token_cache_time').with_value('-1') - should contain_glance_api_config('keystone_authtoken/memcached_servers').with_value(memcached_servers.join(',')) + should contain_glance_api_config('keystone_authtoken/token_cache_time').with_value('300') + should contain_glance_api_config('keystone_authtoken/memcached_servers').with_value(local_memcached_server) end it 'should configure glance glare config' do @@ -189,8 +190,8 @@ should contain_glance_glare_config('keystone_authtoken/username').with_value(glance_glare_username) should contain_glance_glare_config('keystone_authtoken/password').with_value(glance_glare_password) should contain_glance_glare_config('keystone_authtoken/project_name').with_value(glance_glare_project_name) - should contain_glance_glare_config('keystone_authtoken/token_cache_time').with_value('-1') - should contain_glance_glare_config('keystone_authtoken/memcached_servers').with_value(memcached_servers.join(',')) + should contain_glance_glare_config('keystone_authtoken/token_cache_time').with_value('300') + should contain_glance_glare_config('keystone_authtoken/memcached_servers').with_value(local_memcached_server) end if $glance_backend == 'rbd' @@ -226,7 +227,7 @@ should contain_glance_registry_config('keystone_authtoken/username').with_value(glance_username) should contain_glance_registry_config('keystone_authtoken/password').with_value(glance_password) should contain_glance_registry_config('keystone_authtoken/project_name').with_value(glance_project_name) - should contain_glance_registry_config('keystone_authtoken/memcached_servers').with_value(memcached_servers.join(',')) + should contain_glance_registry_config('keystone_authtoken/memcached_servers').with_value(local_memcached_server) end if use_syslog diff --git a/tests/noop/spec/hosts/heat/heat_spec.rb b/tests/noop/spec/hosts/heat/heat_spec.rb index 3f7e5a6c41..006697fc5f 100644 --- a/tests/noop/spec/hosts/heat/heat_spec.rb +++ b/tests/noop/spec/hosts/heat/heat_spec.rb @@ -25,6 +25,7 @@ end let(:memcached_servers) { Noop.hiera 'memcached_servers' } + let(:local_memcached_server) { Noop.hiera 'local_memcached_server' } let(:heat_ha_engine) do Noop.hiera 'heat_ha_engine', true @@ -149,7 +150,7 @@ 'project_name' => tenant, 'auth_url' => keystone_auth_url, 'auth_uri' => keystone_auth_uri, - 'memcached_servers' => memcached_servers, + 'memcached_servers' => local_memcached_server ) end @@ -169,7 +170,7 @@ should contain_heat_config('keystone_authtoken/project_name').with(:value => tenant) should contain_heat_config('keystone_authtoken/auth_url').with(:value => keystone_auth_url) should contain_heat_config('keystone_authtoken/auth_uri').with(:value => keystone_auth_uri) - should contain_heat_config('keystone_authtoken/memcached_servers').with(:value => memcached_servers.join(',')) + should contain_heat_config('keystone_authtoken/memcached_servers').with(:value => local_memcached_server) end it 'should configure heat class' do @@ -197,7 +198,7 @@ it 'should configure caching for validation process' do should contain_heat_config('cache/enabled').with_value('true') should contain_heat_config('cache/backend').with_value('oslo_cache.memcache_pool') - should contain_heat_config('cache/memcache_servers').with_value(memcached_servers.join(',')) + should contain_heat_config('cache/memcache_servers').with_value(local_memcached_server) end it 'should configure urls for metadata, cloudwatch and waitcondition servers' do diff --git a/tests/noop/spec/hosts/ironic/ironic_spec.rb b/tests/noop/spec/hosts/ironic/ironic_spec.rb index 9ebbbdb582..0f0001ffaf 100644 --- a/tests/noop/spec/hosts/ironic/ironic_spec.rb +++ b/tests/noop/spec/hosts/ironic/ironic_spec.rb @@ -51,6 +51,7 @@ let(:neutron_address) { Noop.puppet_function 'get_ssl_property',ssl_hash,{},'neutron','internal','hostname', neutron_endpoint_default } let(:memcached_servers) { Noop.hiera 'memcached_servers' } + let(:local_memcached_server) { Noop.hiera 'local_memcached_server' } rabbit_heartbeat_timeout_threshold = Noop.puppet_function 'pick', ironic_hash['rabbit_heartbeat_timeout_threshold'], rabbit_hash['heartbeat_timeout_treshold'], 60 rabbit_heartbeat_rate = Noop.puppet_function 'pick', ironic_hash['rabbit_heartbeat_rate'], rabbit_hash['heartbeat_rate'], 2 @@ -82,7 +83,7 @@ 'project_name' => admin_tenant, 'auth_url' => admin_auth_uri, 'auth_uri' => internal_auth_url, - 'memcached_servers' => memcached_servers, + 'memcached_servers' => local_memcached_server, ) end @@ -92,7 +93,7 @@ should contain_ironic_config('keystone_authtoken/project_name').with(:value => admin_tenant) should contain_ironic_config('keystone_authtoken/auth_url').with(:value => admin_auth_uri) should contain_ironic_config('keystone_authtoken/auth_uri').with(:value => internal_auth_url) - should contain_ironic_config('keystone_authtoken/memcached_servers').with(:value => memcached_servers.join(',')) + should contain_ironic_config('keystone_authtoken/memcached_servers').with(:value => local_memcached_server) end it 'should declare ironic::api class correctly' do diff --git a/tests/noop/spec/hosts/murano/murano_spec.rb b/tests/noop/spec/hosts/murano/murano_spec.rb index 037e9855ed..79a26e982c 100644 --- a/tests/noop/spec/hosts/murano/murano_spec.rb +++ b/tests/noop/spec/hosts/murano/murano_spec.rb @@ -61,6 +61,7 @@ let(:db_password) { Noop.hiera_structure('murano/db_password') } let(:memcached_servers) { Noop.hiera 'memcached_servers' } + let(:local_memcached_server) { Noop.hiera 'local_memcached_server' } let(:predefined_networks) { Noop.hiera_structure('neutron_config/predefined_networks') } @@ -193,7 +194,7 @@ 'service_host' => bind_address, 'service_port' => api_bind_port, 'external_network' => external_network, - 'memcached_servers' => memcached_servers, + 'memcached_servers' => local_memcached_server, ) end diff --git a/tests/noop/spec/hosts/openstack-cinder/openstack-cinder_spec.rb b/tests/noop/spec/hosts/openstack-cinder/openstack-cinder_spec.rb index 94d0a42d0b..cbafa0ab7c 100644 --- a/tests/noop/spec/hosts/openstack-cinder/openstack-cinder_spec.rb +++ b/tests/noop/spec/hosts/openstack-cinder/openstack-cinder_spec.rb @@ -64,6 +64,7 @@ let(:glance_api_servers) { Noop.hiera 'glance_api_servers', "#{glance_protocol}://#{glance_endpoint}:9292" } let(:memcached_servers) { Noop.hiera 'memcached_servers' } + let(:local_memcached_server) { Noop.hiera 'local_memcached_server' } let(:transport_url) { Noop.hiera 'transport_url', 'rabbit://guest:password@127.0.0.1:5672/' } @@ -150,7 +151,7 @@ should contain_cinder_config('keystone_authtoken/auth_uri').with(:value => auth_uri) should contain_cinder_config('keystone_authtoken/auth_url').with(:value => auth_url) should contain_cinder_config('keystone_authtoken/auth_version').with(:value => auth_version) - should contain_cinder_config('keystone_authtoken/memcached_servers').with(:value => memcached_servers.join(",")) + should contain_cinder_config('keystone_authtoken/memcached_servers').with(:value => local_memcached_server) end it 'ensures cinder_config contains correct values' do diff --git a/tests/noop/spec/hosts/openstack-controller/openstack-controller_spec.rb b/tests/noop/spec/hosts/openstack-controller/openstack-controller_spec.rb index 775602baa4..86d10ea989 100644 --- a/tests/noop/spec/hosts/openstack-controller/openstack-controller_spec.rb +++ b/tests/noop/spec/hosts/openstack-controller/openstack-controller_spec.rb @@ -25,6 +25,7 @@ use_cache = Noop.hiera_structure 'nova/use_cache', true let(:memcached_servers) { Noop.hiera 'memcached_servers' } + let(:local_memcached_server) { Noop.hiera 'local_memcached_server' } let(:memcached_port) { Noop.hiera 'memcached_server_port', '11211' } let(:memcached_address) { Noop.puppet_function 'get_network_role_property', 'mgmt/memcache', 'ipaddr' } @@ -175,7 +176,7 @@ it 'nova config should contain right memcached servers list' do should contain_nova_config('keystone_authtoken/memcached_servers').with( - 'value' => memcached_authtoken_server, + 'value' => local_memcached_server, ) end @@ -220,7 +221,7 @@ 'value' => true, ) should contain_nova_config('cache/memcache_servers').with( - 'value' => memcached_servers.join(','), + 'value' => local_memcached_server, ) end end @@ -245,7 +246,7 @@ :auth_url => keystone_auth_url, :auth_uri => keystone_auth_uri, :auth_version => auth_version, - :memcached_servers => memcached_authtoken_server, + :memcached_servers => local_memcached_server, ) end @@ -256,7 +257,7 @@ should contain_nova_config('keystone_authtoken/auth_url').with(:value => keystone_auth_url) should contain_nova_config('keystone_authtoken/auth_uri').with(:value => keystone_auth_uri) should contain_nova_config('keystone_authtoken/auth_version').with(:value => auth_version) - should contain_nova_config('keystone_authtoken/memcached_servers').with(:value => memcached_authtoken_server) + should contain_nova_config('keystone_authtoken/memcached_servers').with(:value => local_memcached_server) end it 'should configure nova::api' do diff --git a/tests/noop/spec/hosts/openstack-network/server-config_spec.rb b/tests/noop/spec/hosts/openstack-network/server-config_spec.rb index ee6f00ccd5..6f4e816762 100644 --- a/tests/noop/spec/hosts/openstack-network/server-config_spec.rb +++ b/tests/noop/spec/hosts/openstack-network/server-config_spec.rb @@ -90,6 +90,7 @@ region_name = Noop.hiera('region', 'RegionOne') auth_endpoint_type = 'internalURL' memcached_servers = Noop.hiera 'memcached_servers' + let(:local_memcached_server) { Noop.hiera 'local_memcached_server' } ssl_hash = Noop.hiera_hash('use_ssl', {}) internal_auth_protocol = Noop.puppet_function 'get_ssl_property',ssl_hash,{},'keystone','internal','protocol', 'http' @@ -267,7 +268,7 @@ 'region_name' => region_name, 'auth_url' => auth_url, 'auth_uri' => auth_uri, - 'memcached_servers' => memcached_servers,) + 'memcached_servers' => local_memcached_server,) end it 'should correctly configure authtoken parameters' do @@ -277,7 +278,7 @@ should contain_neutron_config('keystone_authtoken/region_name').with(:value => region_name) should contain_neutron_config('keystone_authtoken/auth_url').with(:value => auth_url) should contain_neutron_config('keystone_authtoken/auth_uri').with(:value => auth_uri) - should contain_neutron_config('keystone_authtoken/memcached_servers').with(:value => memcached_servers.join(',')) + should contain_neutron_config('keystone_authtoken/memcached_servers').with(:value => local_memcached_server) end it 'should have agent related settings' do diff --git a/tests/noop/spec/hosts/roles/compute_spec.rb b/tests/noop/spec/hosts/roles/compute_spec.rb index 89702d6463..34569477dc 100644 --- a/tests/noop/spec/hosts/roles/compute_spec.rb +++ b/tests/noop/spec/hosts/roles/compute_spec.rb @@ -25,7 +25,8 @@ }) } - let (:memcached_servers) { Noop.hiera 'memcached_servers' } + let(:memcached_servers) { Noop.hiera 'memcached_servers' } + let(:local_memcached_server) { Noop.hiera 'local_memcached_server' } let(:nova_hash) do Noop.hiera_structure 'nova' @@ -326,7 +327,7 @@ should contain_class('nova::cache').with( :enabled => use_cache, :backend => 'oslo_cache.memcache_pool', - :memcache_servers => memcached_servers, + :memcache_servers => local_memcached_server, ) end diff --git a/tests/noop/spec/hosts/roles/ironic-conductor_spec.rb b/tests/noop/spec/hosts/roles/ironic-conductor_spec.rb index 2cbc9335af..49c2186a4f 100644 --- a/tests/noop/spec/hosts/roles/ironic-conductor_spec.rb +++ b/tests/noop/spec/hosts/roles/ironic-conductor_spec.rb @@ -20,6 +20,7 @@ baremetal_vip = Noop.hiera_structure 'network_metadata/vips/baremetal/ipaddr' let(:memcached_servers) { Noop.hiera 'memcached_servers' } + let(:local_memcached_server) { Noop.hiera 'local_memcached_server' } if ironic_enabled it 'should ensure that ironic-fa-deploy is installed' do @@ -83,7 +84,7 @@ should contain_ironic_config('keystone_authtoken/auth_uri').with('value' => internal_auth_uri) should contain_ironic_config('keystone_authtoken/identity_uri').with('value' => admin_identity_uri) should contain_ironic_config('keystone_authtoken/admin_user').with('value' => ironic_user) - should contain_ironic_config('keystone_authtoken/memcached_servers').with('value' => memcached_servers.join(',')) + should contain_ironic_config('keystone_authtoken/memcached_servers').with('value' => local_memcached_server) should contain_ironic_config('glance/temp_url_endpoint_type').with('value' => temp_url_endpoint_type) end diff --git a/tests/noop/spec/hosts/sahara/sahara_spec.rb b/tests/noop/spec/hosts/sahara/sahara_spec.rb index 7c378f879b..86a6385820 100644 --- a/tests/noop/spec/hosts/sahara/sahara_spec.rb +++ b/tests/noop/spec/hosts/sahara/sahara_spec.rb @@ -25,6 +25,7 @@ let(:public_vip) { Noop.hiera('public_vip') } let(:floating_net) { Noop.hiera_structure('neutron_config/default_floating_net', 'admin_floating_net') } let(:memcached_servers) { Noop.hiera 'memcached_servers' } + let(:local_memcached_server) { Noop.hiera 'local_memcached_server' } let(:network_scheme) do Noop.hiera_hash 'network_scheme' @@ -139,7 +140,7 @@ 'rabbit_hosts' => amqp_hosts.split(","), 'host' => bind_address, 'port' => '8386', - 'memcached_servers' => memcached_servers, + 'memcached_servers' => local_memcached_server, ) end diff --git a/tests/noop/spec/hosts/swift/proxy_storage_spec.rb b/tests/noop/spec/hosts/swift/proxy_storage_spec.rb index e0ee942024..e698a91209 100644 --- a/tests/noop/spec/hosts/swift/proxy_storage_spec.rb +++ b/tests/noop/spec/hosts/swift/proxy_storage_spec.rb @@ -14,6 +14,7 @@ network_scheme = Noop.hiera_hash 'network_scheme' let(:memcached_servers) { Noop.hiera 'memcached_servers' } + let(:local_memcached_server) { Noop.hiera 'local_memcached_server' } management_vip = Noop.hiera('management_vip') swift_operator_roles = storage_hash.fetch('swift_operator_roles', ['admin', 'SwiftOperator', '_member_']) @@ -103,7 +104,7 @@ it 'should declare swift::proxy::cache class with correct memcache_servers parameter' do should contain_class('swift::proxy::cache').with( - 'memcache_servers' => memcached_servers, + 'memcache_servers' => local_memcached_server, ) end @@ -170,7 +171,7 @@ it 'should contain memcached params' do should contain_class('openstack_tasks::swift::parts::proxy').with( - :memcached_servers => memcached_servers + :memcached_servers => local_memcached_server ) end