summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/cinder-controller
diff options
context:
space:
mode:
authorliyuenan <liyuenan@huawei.com>2017-02-16 09:08:52 +0800
committerliyuenan <liyuenan@huawei.com>2017-02-20 13:48:54 +0800
commit744d6f99424491429b0a307c9f85e2ae50a8826a (patch)
tree3e0d1682ba3c4bf5d9675d7b1ef8191c34ac49b0 /deploy/adapters/ansible/roles/cinder-controller
parent9b3c5d5f10e99a4612bf3e05274c8d183da9f2ca (diff)
FIX access database failed
JIRA: COMPASS-521 Use a dynamic value to set number of workers for Openstack API service when the number of cpu more than 4. Change-Id: Ic6482cfad9b5eba8fad9e56ea1a33f65e8c71001 Signed-off-by: liyuenan <liyuenan@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/cinder-controller')
-rw-r--r--deploy/adapters/ansible/roles/cinder-controller/templates/cinder.conf9
1 files changed, 6 insertions, 3 deletions
diff --git a/deploy/adapters/ansible/roles/cinder-controller/templates/cinder.conf b/deploy/adapters/ansible/roles/cinder-controller/templates/cinder.conf
index 05a1c8fd..8b035653 100644
--- a/deploy/adapters/ansible/roles/cinder-controller/templates/cinder.conf
+++ b/deploy/adapters/ansible/roles/cinder-controller/templates/cinder.conf
@@ -3,6 +3,11 @@
{% set _ = memcached_servers.append('%s:11211'% host) %}
{% endfor %}
{% set memcached_servers = memcached_servers|join(',') %}
+{% if ansible_processor_vcpus > 5 %}
+{% set api_workers = ansible_processor_vcpus // 5 %}
+{% else %}
+{% set api_workers = 1 %}
+{% endif %}
[DEFAULT]
rootwrap_config = /etc/cinder/rootwrap.conf
@@ -35,9 +40,7 @@ quota_driver = cinder.quota.DbQuotaDriver
osapi_volume_listen = {{ storage_controller_host }}
osapi_volume_listen_port = 8776
-{% if ansible_processor_vcpus > 30 %}
-osapi_volume_workers = 30
-{% endif %}
+osapi_volume_workers = {{ api_workers }}
db_backend = sqlalchemy
volume_name_template = volume-%s