diff --git a/CHANGELOG.md b/CHANGELOG.md index f68d77d..e1760bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,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 09124a7..3125e42 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