Make compute dbsync command timeout to be an optional parameter

The default dbsync command timeout value 3600 seconds may be too small
when there are large data in compute database.
Make timeout to be optional to fix this problem.

Change-Id: I1ca4c594da34134aa3807fca753b955ed0b239bd
Related-Bug: #1389111
This commit is contained in:
Mark Vanderwiel 2014-11-21 12:18:21 -06:00
parent f3952ed4e4
commit 5de0025c53
5 changed files with 21 additions and 2 deletions

View File

@ -22,6 +22,7 @@ This file is used to list changes made in each version of cookbook-openstack-com
* Updated the nova-networking to start metadata-api
* Allow rabbit ssl in the ha case
* Move deprecated neutron_*/glance_*/cinder_* configurations to [neutron]/[glance]/[cinder] sections in nova.conf
* Allow dbsync_timeout to be configurable
## 9.3.1
* Move auth configuration from api-paste.ini to nova.conf

View File

@ -114,6 +114,7 @@ Openstack Compute attributes are in the attribute namespace ["openstack"]["compu
* `openstack['compute']['ssl_only'] = Disallow non-encrypted connections
* `openstack['compute']['cert'] = SSL certificate file
* `openstack['compute']['key'] = SSL key file (if separate from cert)
* `openstack['compute']['dbsync_timeout']` - Set dbsync command timeout value
* `openstack["compute"]["compute"]["api"]["protocol"]` - Protocol used for the OS API
* `openstack["compute"]["compute"]["api"]["port"]` - Port on which OS API runs
* `openstack["compute"]["compute"]["api"]["version"]` - Version of the OS API used

View File

@ -36,6 +36,9 @@ default['openstack']['compute']['ec2_workers'] = nil
default['openstack']['compute']['osapi_compute_workers'] = nil
default['openstack']['compute']['metadata_workers'] = nil
# Set dbsync command timeout value
default['openstack']['compute']['dbsync_timeout'] = 3600
# The name of the Chef role that sets up the Keystone Service API
default['openstack']['compute']['identity_service_chef_role'] = 'os-identity'

View File

@ -28,6 +28,7 @@ nova_user = node['openstack']['compute']['user']
nova_group = node['openstack']['compute']['group']
execute 'nova-manage db sync' do
timeout node['openstack']['compute']['dbsync_timeout']
user nova_user
group nova_group
command 'nova-manage db sync'

View File

@ -11,8 +11,21 @@ describe 'openstack-compute::nova-setup' do
include_context 'compute_stubs'
include_examples 'expect_runs_nova_common_recipe'
it 'runs db migrations' do
expect(chef_run).to run_execute('nova-manage db sync').with(user: 'nova', group: 'nova')
it 'runs db migrations with default timeout' do
expect(chef_run).to run_execute('nova-manage db sync').with(
user: 'nova',
group: 'nova',
timeout: 3600
)
end
it 'runs db migrations with timeout override' do
node.set['openstack']['compute']['dbsync_timeout'] = 1234
expect(chef_run).to run_execute('nova-manage db sync').with(
user: 'nova',
group: 'nova',
timeout: 1234
)
end
it 'adds nova network ipv4 addresses' do