From 5ef8617161b0c190e721e489fb91ef4a14052bef Mon Sep 17 00:00:00 2001 From: Mark Vanderwiel Date: Fri, 12 Sep 2014 12:19:08 -0500 Subject: [PATCH] Add attribute for osapi_volume_workers Change-Id: I99b7f5284a7f5eeb8cf5608937043b2b11217fec Closes-Bug: #1368873 --- CHANGELOG.md | 1 + attributes/default.rb | 5 +++++ spec/cinder_common_spec.rb | 2 +- templates/default/cinder.conf.erb | 5 +++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49659ec..3a1fb10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This file is used to list changes made in each version of the openstack-block-st * Sync conf files with Juno * Upgrading berkshelf from 2.0.18 to 3.1.5 * Move keystone keys into cinder.conf +* Add attribute for osapi_volume_workers ## 9.4.1 * Add support for LVMISCSIDriver driver using block devices with LVM diff --git a/attributes/default.rb b/attributes/default.rb index 78f460a..401d8b4 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -49,6 +49,11 @@ default['openstack']['block-storage']['control_exchange'] = 'cinder' default['openstack']['block-storage']['region'] = node['openstack']['region'] default['openstack']['block-storage']['scheduler_role'] = 'os-block-storage-scheduler' +# Number of workers for OpenStack Volume API service. The +# default is equal to the number of CPUs available. (integer +# value) +default['openstack']['block-storage']['osapi_volume_workers'] = [8, node['cpu']['total'].to_i].min + # Template strings to be used to generate resource names default['openstack']['block-storage']['volume_name_template'] = 'volume-%s' default['openstack']['block-storage']['snapshot_name_template'] = 'snapshot-%s' diff --git a/spec/cinder_common_spec.rb b/spec/cinder_common_spec.rb index c8e6e94..0b706c2 100644 --- a/spec/cinder_common_spec.rb +++ b/spec/cinder_common_spec.rb @@ -136,7 +136,7 @@ describe 'openstack-block-storage::cinder-common' do context 'commonly named attributes' do %w(debug verbose lock_path notification_driver storage_availability_zone quota_volumes quota_gigabytes quota_driver - volume_name_template snapshot_name_template + volume_name_template snapshot_name_template osapi_volume_workers control_exchange max_gigabytes).each do |attr_key| it "has a #{attr_key} attribute" do node.set['openstack']['block-storage'][attr_key] = "#{attr_key}_value" diff --git a/templates/default/cinder.conf.erb b/templates/default/cinder.conf.erb index 013c8ee..1f2d2b3 100644 --- a/templates/default/cinder.conf.erb +++ b/templates/default/cinder.conf.erb @@ -221,6 +221,11 @@ osapi_volume_listen=<%= @volume_api_bind_address %> #### (IntOpt) port for os volume api to listen osapi_volume_listen_port=<%= @volume_api_bind_port %> +# Number of workers for OpenStack Volume API service. The +# default is equal to the number of CPUs available. (integer +# value) +osapi_volume_workers=<%= node["openstack"]["block-storage"]["osapi_volume_workers"] %> + ######## defined in cinder.test ######## # sqlite_clean_db=clean.sqlite