diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b917858..db586424 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 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 more attributes for nova.conf DEFAULT section ## 9.3.1 * Move auth configuration from api-paste.ini to nova.conf diff --git a/README.md b/README.md index 2673f309..a6e990bc 100644 --- a/README.md +++ b/README.md @@ -276,6 +276,7 @@ Libvirt 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 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. @@ -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_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"]["notification_topics"]`- AMQP topic used for OpenStack notifications. When enabling nova metering with ceilometer, the notification configuration 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) 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 ------------------------------- diff --git a/attributes/default.rb b/attributes/default.rb index 22eec79e..2536f1d8 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -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_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']['available_filters'] = 'nova.scheduler.filters.all_filters' 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_period'] = 'hour' default['openstack']['compute']['config']['notify_on_state_change'] = 'vm_and_task_state' + default['openstack']['compute']['config']['notification_topics'] = ['notifications'] else default['openstack']['compute']['config']['notification_drivers'] = [] default['openstack']['compute']['config']['instance_usage_audit'] = 'False' default['openstack']['compute']['config']['instance_usage_audit_period'] = 'month' default['openstack']['compute']['config']['notify_on_state_change'] = '' + default['openstack']['compute']['config']['notification_topics'] = [] end +# Monitor settings +default['openstack']['compute']['config']['compute_available_monitors'] = ['nova.compute.monitors.all_monitors'] +default['openstack']['compute']['config']['compute_monitors'] = [] + # Keystone settings default['openstack']['compute']['api']['auth_strategy'] = 'keystone' diff --git a/spec/nova-common_spec.rb b/spec/nova-common_spec.rb index eb614108..1b573bbd 100644 --- a/spec/nova-common_spec.rb +++ b/spec/nova-common_spec.rb @@ -402,6 +402,15 @@ describe 'openstack-compute::nova-common' do 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 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', 'instance_usage_audit=True', '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| expect(chef_run).to render_file(file.name).with_content(line) end @@ -593,7 +603,8 @@ describe 'openstack-compute::nova-common' do end 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_default_filters=AvailabilityZoneFilter,RamFilter,ComputeFilter,CoreFilter,SameHostFilter,DifferentHostFilter$/ ].each do |line| diff --git a/templates/default/nova.conf.erb b/templates/default/nova.conf.erb index 6a9f3668..1c487c50 100644 --- a/templates/default/nova.conf.erb +++ b/templates/default/nova.conf.erb @@ -75,7 +75,7 @@ qpid_topology_version=<%= node['openstack']['mq']['compute']['qpid']['topology_v ##### SCHEDULER ##### -# scheduler_manager=nova.scheduler.manager.SchedulerManager +scheduler_manager=<%= node["openstack"]["compute"]["scheduler"]["scheduler_manager"] %> compute_scheduler_driver=<%= node["openstack"]["compute"]["scheduler"]["scheduler_driver"] %> scheduler_available_filters=<%= node["openstack"]["compute"]["scheduler"]["available_filters"] %> # which filter class names to use for filtering hosts when not specified in the request. @@ -167,6 +167,12 @@ notification_driver=<%= d %> <% 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 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"] %> <% 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 ##### # iscsi target user-land tool to use iscsi_helper=<%= @iscsi_helper %>