Only have one path of support for api-metadata

The current cookbook allows the enabled_apis nova.conf key
to include the metadata value.  This causes the nove compute
service to try to auto start the api-metadata service.  But we
also have the api-metadata recipe in the run list by default which
also tries to start the api-metadata service. This can cause timing
issues with the starting service.

This patch will remove the metadata value from the enabled_apis
attribute, and put out a warning if it's included.  The api-metadata
receipe should be used to control this service.  By default the
api-metadata recipe is included in the os-compute-api role which
is included in the os-compute-single-controller role. So, in most cases
it's already included in the run list.

Change-Id: Ief1a98cf2ab072a8aa892c65c5fc07d12a02722c
Closes-Bug: #1415220
This commit is contained in:
Mark Vanderwiel 2015-05-28 09:55:09 -05:00
parent 8d1f4228d2
commit a01d815521
5 changed files with 13 additions and 11 deletions

View File

@ -313,7 +313,7 @@ Arrays whose elements will be copied exactly into the respective config files (c
EC2 Configuration Attributes
----------------------------
* `openstack["compute"]["enabled_apis"]` - Which apis have been enabled in nova compute
* `openstack["compute"]["enabled_apis"]` - Which apis have been enabled in nova compute, only for ec2 and osapi_compute. For metadata, include the api-metadata recipe.
Notification Attributes
-----------------------

View File

@ -548,7 +548,11 @@ default['openstack']['compute']['misc_paste'] = nil
# To disable the EC2 API endpoint, simply remove 'ec2,' from the list
# of enabled API services.
default['openstack']['compute']['enabled_apis'] = 'ec2,osapi_compute,metadata'
# NOTE: The metadata api service is enabled via including it's recipe
# NOTE: api-metadata. By default the api-metadata recipe is included in
# NOTE: the os-compute-api role which is included in the
# NOTE: os-compute-single-controller role.
default['openstack']['compute']['enabled_apis'] = 'ec2,osapi_compute'
# VMware driver
default['openstack']['compute']['vmware']['secret_name'] = 'openstack_vmware_secret_name'

View File

@ -29,7 +29,10 @@ end
include_recipe 'openstack-compute::nova-common'
if node['openstack']['compute']['enabled_apis'].include?('metadata')
include_recipe 'openstack-compute::api-metadata'
Chef::Log.warn('Attribute enabled_apis contains metadata, this '\
'could result in a timing issue starting the service. '\
'Please remove this value and include the api-metadata '\
'recipe instead')
end
include_recipe 'openstack-compute::network'

View File

@ -20,16 +20,11 @@ describe 'openstack-compute::compute' do
end
end
it 'includes api-metadata recipe' do
expect(chef_run).to include_recipe 'openstack-compute::api-metadata'
it 'does not include the api-metadata recipe' do
expect(chef_run).not_to include_recipe 'openstack-compute::api-metadata'
end
it 'does not include api-metadata recipe' do
chef_run = ::ChefSpec::SoloRunner.new ::UBUNTU_OPTS
node = chef_run.node
node.set['openstack']['compute']['enabled_apis'] = 'ec2,osapi_compute'
chef_run.converge 'openstack-compute::compute'
expect(chef_run).not_to include_recipe 'openstack-compute::api-metadata'
end

View File

@ -288,7 +288,7 @@ describe 'openstack-compute::identity_registration' do
describe "when 'ec2' is not in the list of enabled_apis" do
before do
node.set['openstack']['compute']['enabled_apis'] = 'osapi_compute,metadata'
node.set['openstack']['compute']['enabled_apis'] = 'osapi_compute'
end
it 'does not register ec2 service' do