Add more attributes for nova.conf DEFAULT section

Since there are some default options that did not set in nova.conf.erb
file, so add them to ensure users can custom them.

Change-Id: I70c110b0e4d67b25155bb02e96bb8f02b455b3bd
This commit is contained in:
Chen Zhiwei 2014-10-30 16:49:24 +08:00
parent c2a262ab4f
commit 398e359bcc
5 changed files with 49 additions and 3 deletions

View File

@ -16,6 +16,7 @@ This file is used to list changes made in each version of cookbook-openstack-com
* Add more neutron section attributes * Add more neutron section attributes
* Add glance_api_insecure and neutron_api_insecure; make glance_api_servers and neutron_url to be prefixed with scheme * Add glance_api_insecure and neutron_api_insecure; make glance_api_servers and neutron_url to be prefixed with scheme
* Add [ssl] section, needed to communicate with Glance when using https; add cinder_ca_certificates_file and cinder_api_insecure * Add [ssl] section, needed to communicate with Glance when using https; add cinder_ca_certificates_file and cinder_api_insecure
* Add more attributes for nova.conf DEFAULT section
## 9.3.1 ## 9.3.1
* Move auth configuration from api-paste.ini to nova.conf * Move auth configuration from api-paste.ini to nova.conf

View File

@ -276,6 +276,7 @@ Libvirt Configuration Attributes
Scheduler Configuration Attributes Scheduler Configuration Attributes
---------------------------------- ----------------------------------
* `openstack["compute"]["scheduler"]["scheduler_manager"]` - the scheduler manager to use
* `openstack["compute"]["scheduler"]["scheduler_driver"]` - the scheduler driver to use * `openstack["compute"]["scheduler"]["scheduler_driver"]` - the scheduler driver to use
NOTE: The filter scheduler currently does not work with ec2. NOTE: The filter scheduler currently does not work with ec2.
* `openstack["compute"]["scheduler"]["available_filters"]` - Filter classes available to the scheduler which may be specified more than once. * `openstack["compute"]["scheduler"]["available_filters"]` - Filter classes available to the scheduler which may be specified more than once.
@ -314,6 +315,7 @@ Notification Attributes
* `openstack["compute"]["config"]["instance_usage_audit"]`- Boolean that indicates whether to generate intance usage audits. * `openstack["compute"]["config"]["instance_usage_audit"]`- Boolean that indicates whether to generate intance usage audits.
* `openstack["compute"]["config"]["instance_usage_audit_period"]`- Time period to generate instance usages for. Time period must be "hour", "day", "month" or "year". * `openstack["compute"]["config"]["instance_usage_audit_period"]`- Time period to generate instance usages for. Time period must be "hour", "day", "month" or "year".
* `openstack["compute"]["config"]["notify_on_state_change"]`- If set, send compute.instance.update notifications on instance state changes. Valid values are None, "vm_state" or "vm_and_task_state". * `openstack["compute"]["config"]["notify_on_state_change"]`- If set, send compute.instance.update notifications on instance state changes. Valid values are None, "vm_state" or "vm_and_task_state".
* `openstack["compute"]["config"]["notification_topics"]`- AMQP topic used for OpenStack notifications.
When enabling nova metering with ceilometer, the notification configuration When enabling nova metering with ceilometer, the notification configuration
properties need to be set to values that are different from the default values properties need to be set to values that are different from the default values
@ -327,6 +329,12 @@ ceilometer. In order for the notification driver to be available, make sure
the `os-telemetry-agent-compute` role (or the openstack-telemetry::agent-compute recipe) the `os-telemetry-agent-compute` role (or the openstack-telemetry::agent-compute recipe)
are set on this node. are set on this node.
Monitor Attributes
-----------------------
* `openstack["compute"]["config"]["compute_available_monitors"]`- Monitor classes available to the compute.
* `openstack["compute"]["config"]["compute_monitors"]`- An array of monitors that can be used for getting compute metrics.
VMware Configuration Attributes VMware Configuration Attributes
------------------------------- -------------------------------

View File

@ -212,6 +212,7 @@ default['openstack']['compute']['network']['auto_assign_floating_ip'] = false
default['openstack']['compute']['network']['use_single_default_gateway'] = false default['openstack']['compute']['network']['use_single_default_gateway'] = false
default['openstack']['compute']['network']['use_ipv6'] = false default['openstack']['compute']['network']['use_ipv6'] = false
default['openstack']['compute']['scheduler']['scheduler_manager'] = 'nova.scheduler.manager.SchedulerManager'
default['openstack']['compute']['scheduler']['scheduler_driver'] = 'nova.scheduler.filter_scheduler.FilterScheduler' default['openstack']['compute']['scheduler']['scheduler_driver'] = 'nova.scheduler.filter_scheduler.FilterScheduler'
default['openstack']['compute']['scheduler']['available_filters'] = 'nova.scheduler.filters.all_filters' default['openstack']['compute']['scheduler']['available_filters'] = 'nova.scheduler.filters.all_filters'
default['openstack']['compute']['scheduler']['default_filters'] = %W( default['openstack']['compute']['scheduler']['default_filters'] = %W(
@ -357,13 +358,19 @@ if node['openstack']['compute']['metering']
default['openstack']['compute']['config']['instance_usage_audit'] = 'True' default['openstack']['compute']['config']['instance_usage_audit'] = 'True'
default['openstack']['compute']['config']['instance_usage_audit_period'] = 'hour' default['openstack']['compute']['config']['instance_usage_audit_period'] = 'hour'
default['openstack']['compute']['config']['notify_on_state_change'] = 'vm_and_task_state' default['openstack']['compute']['config']['notify_on_state_change'] = 'vm_and_task_state'
default['openstack']['compute']['config']['notification_topics'] = ['notifications']
else else
default['openstack']['compute']['config']['notification_drivers'] = [] default['openstack']['compute']['config']['notification_drivers'] = []
default['openstack']['compute']['config']['instance_usage_audit'] = 'False' default['openstack']['compute']['config']['instance_usage_audit'] = 'False'
default['openstack']['compute']['config']['instance_usage_audit_period'] = 'month' default['openstack']['compute']['config']['instance_usage_audit_period'] = 'month'
default['openstack']['compute']['config']['notify_on_state_change'] = '' default['openstack']['compute']['config']['notify_on_state_change'] = ''
default['openstack']['compute']['config']['notification_topics'] = []
end end
# Monitor settings
default['openstack']['compute']['config']['compute_available_monitors'] = ['nova.compute.monitors.all_monitors']
default['openstack']['compute']['config']['compute_monitors'] = []
# Keystone settings # Keystone settings
default['openstack']['compute']['api']['auth_strategy'] = 'keystone' default['openstack']['compute']['api']['auth_strategy'] = 'keystone'

View File

@ -402,6 +402,15 @@ describe 'openstack-compute::nova-common' do
end end
end end
it 'has monitor options' do
node.set['openstack']['compute']['config']['compute_monitors'] = ['CustomMonitor']
[/^compute_available_monitors=nova.compute.monitors.all_monitors$/,
/^compute_monitors=CustomMonitor$/].each do |line|
expect(chef_run).to render_file(file.name).with_content(line)
end
end
it 'has default vncserver_* options set' do it 'has default vncserver_* options set' do
node.set['openstack']['endpoints']['compute-vnc-bind']['bind_interface'] = 'lo' node.set['openstack']['endpoints']['compute-vnc-bind']['bind_interface'] = 'lo'
@ -487,7 +496,8 @@ describe 'openstack-compute::nova-common' do
'notification_driver=ceilometer.compute.nova_notifier', 'notification_driver=ceilometer.compute.nova_notifier',
'instance_usage_audit=True', 'instance_usage_audit=True',
'instance_usage_audit_period=hour', 'instance_usage_audit_period=hour',
'notify_on_state_change=vm_and_task_state' 'notify_on_state_change=vm_and_task_state',
'notification_topics=notifications'
].each do |line| ].each do |line|
expect(chef_run).to render_file(file.name).with_content(line) expect(chef_run).to render_file(file.name).with_content(line)
end end
@ -593,7 +603,8 @@ describe 'openstack-compute::nova-common' do
end end
it 'has scheduler options' do it 'has scheduler options' do
[/^compute_scheduler_driver=nova.scheduler.filter_scheduler.FilterScheduler$/, [/^scheduler_manager=nova.scheduler.manager.SchedulerManager$/,
/^compute_scheduler_driver=nova.scheduler.filter_scheduler.FilterScheduler$/,
/^scheduler_available_filters=nova.scheduler.filters.all_filters$/, /^scheduler_available_filters=nova.scheduler.filters.all_filters$/,
/^scheduler_default_filters=AvailabilityZoneFilter,RamFilter,ComputeFilter,CoreFilter,SameHostFilter,DifferentHostFilter$/ /^scheduler_default_filters=AvailabilityZoneFilter,RamFilter,ComputeFilter,CoreFilter,SameHostFilter,DifferentHostFilter$/
].each do |line| ].each do |line|

View File

@ -75,7 +75,7 @@ qpid_topology_version=<%= node['openstack']['mq']['compute']['qpid']['topology_v
##### SCHEDULER ##### ##### SCHEDULER #####
# scheduler_manager=nova.scheduler.manager.SchedulerManager scheduler_manager=<%= node["openstack"]["compute"]["scheduler"]["scheduler_manager"] %>
compute_scheduler_driver=<%= node["openstack"]["compute"]["scheduler"]["scheduler_driver"] %> compute_scheduler_driver=<%= node["openstack"]["compute"]["scheduler"]["scheduler_driver"] %>
scheduler_available_filters=<%= node["openstack"]["compute"]["scheduler"]["available_filters"] %> scheduler_available_filters=<%= node["openstack"]["compute"]["scheduler"]["available_filters"] %>
# which filter class names to use for filtering hosts when not specified in the request. # which filter class names to use for filtering hosts when not specified in the request.
@ -167,6 +167,12 @@ notification_driver=<%= d %>
<% end %> <% end %>
<% end %> <% end %>
<% if node['openstack']['compute']['config']['notification_topics'] %>
# AMQP topic used for OpenStack notifications. (list value)
# Deprecated group/name - [rpc_notifier2]/topics
notification_topics=<%= node['openstack']['compute']['config']['notification_topics'].join(",") %>
<% end %>
# Generate periodic compute.instance.exists notifications # Generate periodic compute.instance.exists notifications
instance_usage_audit=<%= node['openstack']['compute']['config']['instance_usage_audit'] %> instance_usage_audit=<%= node['openstack']['compute']['config']['instance_usage_audit'] %>
@ -325,6 +331,19 @@ osapi_compute_workers=<%= node["openstack"]["compute"]["osapi_compute_workers"]
metadata_workers=<%= node["openstack"]["compute"]["metadata_workers"] %> metadata_workers=<%= node["openstack"]["compute"]["metadata_workers"] %>
<% end %> <% end %>
##### MONITORS ######
<% node['openstack']['compute']['config']['compute_available_monitors'].each do |m| %>
# Monitor classes available to the compute which may be
# specified more than once. (multi valued)
compute_available_monitors=<%= m %>
<% end %>
<% if node["openstack"]["compute"]["config"]["compute_monitors"] %>
# A list of monitors that can be used for getting compute
# metrics. (list value)
compute_monitors=<%= node["openstack"]["compute"]["config"]["compute_monitors"].join(",") %>
<% end %>
##### VOLUMES ##### ##### VOLUMES #####
# iscsi target user-land tool to use # iscsi target user-land tool to use
iscsi_helper=<%= @iscsi_helper %> iscsi_helper=<%= @iscsi_helper %>