diff --git a/hooks/nova_cc_context.py b/hooks/nova_cc_context.py index 59dfbd05..36cec4d5 100644 --- a/hooks/nova_cc_context.py +++ b/hooks/nova_cc_context.py @@ -126,6 +126,9 @@ class NeutronAPIContext(ch_context.OSContextGenerator): } if rdata.get('enable-sriov', '').lower() == 'true': ctxt['additional_neutron_filters'] = 'PciPassthroughFilter' + # LP Bug#1805645 + if rdata.get('dns-domain', ''): + ctxt['dns_domain'] = rdata.get('dns-domain') if context_complete(ctxt): return ctxt return {} diff --git a/hooks/nova_cc_utils.py b/hooks/nova_cc_utils.py index dec2633d..b285e6bb 100644 --- a/hooks/nova_cc_utils.py +++ b/hooks/nova_cc_utils.py @@ -303,7 +303,8 @@ def resource_map(actual_services=True): user='nova', group='nova', script='/usr/bin/nova-metadata-wsgi'), - nova_cc_context.MetaDataHAProxyContext()], + nova_cc_context.MetaDataHAProxyContext(), + nova_cc_context.NeutronAPIContext()], 'services': svcs} return _resource_map diff --git a/templates/rocky/nova.conf b/templates/rocky/nova.conf new file mode 100644 index 00000000..20702c86 --- /dev/null +++ b/templates/rocky/nova.conf @@ -0,0 +1,216 @@ +# rocky +############################################################################### +# [ WARNING ] +# Configuration file maintained by Juju. Local changes may be overwritten. +############################################################################### +[DEFAULT] +verbose={{ verbose }} +debug={{ debug }} +dhcpbridge_flagfile=/etc/nova/nova.conf +dhcpbridge=/usr/bin/nova-dhcpbridge +logdir=/var/log/nova +state_path=/var/lib/nova +iscsi_helper=tgtadm +libvirt_use_virtio_for_bridges=True +connection_type=libvirt +root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf +volumes_path=/var/lib/nova/volumes +enabled_apis=osapi_compute,metadata +compute_driver=libvirt.LibvirtDriver +use_ipv6 = {{ use_ipv6 }} +osapi_compute_listen = {{ bind_host }} +metadata_host = {{ bind_host }} +s3_listen = {{ bind_host }} + +{% if transport_url %} +transport_url = {{ transport_url }} +{% endif %} + +{% if dns_domain -%} +# Per LP#1805645, dhcp_domain needs to be configured for nova-metadata-api +# It gets this information from neutron. +dhcp_domain = {{ dns_domain }} +{% endif -%} + +osapi_compute_workers = {{ workers }} + +cpu_allocation_ratio = {{ cpu_allocation_ratio }} +ram_allocation_ratio = {{ ram_allocation_ratio }} +disk_allocation_ratio = {{ disk_allocation_ratio }} + +use_syslog={{ use_syslog }} +my_ip = {{ host_ip }} + +{% include "parts/novnc" %} + +{% if rbd_pool -%} +rbd_pool = {{ rbd_pool }} +rbd_user = {{ rbd_user }} +rbd_secret_uuid = {{ rbd_secret_uuid }} +{% endif -%} + +{% if neutron_plugin and neutron_plugin in ('ovs', 'midonet') -%} +libvirt_vif_driver = nova.virt.libvirt.vif.LibvirtGenericVIFDriver +libvirt_user_virtio_for_bridges = True +{% if neutron_security_groups -%} +security_group_api = {{ network_manager }} +nova_firewall_driver = nova.virt.firewall.NoopFirewallDriver +{% endif -%} +{% if external_network -%} +default_floating_pool = {{ external_network }} +{% endif -%} +{% endif -%} + +{% if neutron_plugin and neutron_plugin == 'vsp' -%} +neutron_ovs_bridge = alubr0 +{% endif -%} + +{% if neutron_plugin and neutron_plugin == 'nvp' -%} +security_group_api = neutron +nova_firewall_driver = nova.virt.firewall.NoopFirewallDriver +{% if external_network -%} +default_floating_pool = {{ external_network }} +{% endif -%} +{% endif -%} + +{% if neutron_plugin and neutron_plugin == 'Calico' -%} +security_group_api = neutron +nova_firewall_driver = nova.virt.firewall.NoopFirewallDriver +{% endif -%} + +{% if neutron_plugin and neutron_plugin == 'plumgrid' -%} +security_group_api=neutron +firewall_driver = nova.virt.firewall.NoopFirewallDriver +{% endif -%} + +{% if network_manager_config -%} +{% for key, value in network_manager_config.items() -%} +{{ key }} = {{ value }} +{% endfor -%} +{% endif -%} + +{% if network_manager and network_manager == 'neutron' -%} +network_api_class = nova.network.neutronv2.api.API +{% else -%} +network_manager = nova.network.manager.FlatDHCPManager +{% endif -%} + +{% if default_floating_pool -%} +default_floating_pool = {{ default_floating_pool }} +{% endif -%} + +{% if volume_service -%} +volume_api_class=nova.volume.cinder.API +{% endif -%} + +{% if user_config_flags -%} +{% for key, value in user_config_flags.items() -%} +{{ key }} = {{ value }} +{% endfor -%} +{% endif -%} + +{% if listen_ports -%} +{% for key, value in listen_ports.items() -%} +{{ key }} = {{ value }} +{% endfor -%} +{% endif -%} + +{% if sections and 'DEFAULT' in sections -%} +{% for key, value in sections['DEFAULT'] -%} +{{ key }} = {{ value }} +{% endfor -%} +{% endif %} + +{% include "section-zeromq" %} + +{% include "parts/database-v2" %} + +{% include "parts/database-api" %} + +{% if glance_api_servers -%} +[glance] +api_servers = {{ glance_api_servers }} +{% endif -%} + +{% if network_manager and network_manager == 'neutron' %} +{% include "parts/section-neutron" %} +{% endif %} + +{% include "section-keystone-authtoken-mitaka" %} + +{% include "parts/section-cinder" %} + +[osapi_v3] +enabled=True + +{% include "parts/cell" %} + +[conductor] +workers = {{ workers }} + +{% include "section-rabbitmq-oslo" %} + +[notifications] +# Starting in the Pike release, the notification_format includes both the +# versioned and unversioned message notifications. Ceilometer does not yet +# consume the versioned message notifications, so intentionally make the +# notification format unversioned until this is implemented. +notification_format = unversioned + +{% include "section-oslo-notifications" %} + +[oslo_concurrency] +lock_path=/var/lock/nova + +[spice] +{% include "parts/spice" %} + +{% include "parts/section-serial-console" %} + +{% if memcached_servers %} +[cache] +enabled = true +backend = oslo_cache.memcache_pool +memcache_servers = {{ memcached_servers }} +{% endif %} + +{% include "parts/section-placement" %} + +[scheduler] +# NOTE(jamespage): perform automatic host cell mapping +# until we can orchestrate this better +# using the nova-cc <--> nova-compute +# relation +discover_hosts_in_cells_interval = 30 + +[filter_scheduler] +{% if additional_neutron_filters is defined %} +enabled_filters = {{ scheduler_default_filters }},{{ additional_neutron_filters }} +{% else %} +enabled_filters = {{ scheduler_default_filters }} +{% endif %} + +[api] +auth_strategy=keystone +{% if vendor_data or vendor_data_url -%} +vendordata_providers = {{ vendordata_providers }} +{% if vendor_data -%} +vendordata_jsonfile_path = /etc/nova/vendor_data.json +{% endif -%} +{% if vendor_data_url -%} +vendordata_dynamic_targets = {{ vendor_data_url }} +{% endif -%} +{% endif -%} + +[wsgi] +api_paste_config=/etc/nova/api-paste.ini + +[pci] +{% if pci_alias %} +alias = {{ pci_alias }} +{% endif %} +{% for alias in pci_aliases -%} +alias = {{ alias }} +{% endfor -%} + +{% include "section-oslo-middleware" %}