Ansible deployment of the Kolla containers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

nova.conf.j2 9.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. # nova.conf
  2. [DEFAULT]
  3. debug = {{ nova_logging_debug }}
  4. log_dir = /var/log/kolla/nova
  5. state_path = /var/lib/nova
  6. osapi_compute_listen = {{ api_interface_address }}
  7. osapi_compute_listen_port = {{ nova_api_listen_port }}
  8. osapi_compute_workers = {{ openstack_service_workers }}
  9. metadata_workers = {{ openstack_service_workers }}
  10. metadata_listen = {{ api_interface_address }}
  11. metadata_listen_port = {{ nova_metadata_listen_port }}
  12. allow_resize_to_same_host = true
  13. {% if service_name == "nova-compute-ironic" %}
  14. host={{ ansible_hostname }}-ironic
  15. log_file = /var/log/kolla/nova/nova-compute-ironic.log
  16. compute_driver = ironic.IronicDriver
  17. ram_allocation_ratio = 1.0
  18. reserved_host_memory_mb = 0
  19. {% elif enable_nova_fake | bool %}
  20. host = {{ ansible_hostname }}_{{ service_name }}
  21. compute_driver = fake.FakeDriver
  22. {% elif nova_compute_virt_type == 'vmware' %}
  23. compute_driver = vmwareapi.VMwareVCDriver
  24. {% elif nova_compute_virt_type == 'xenapi' %}
  25. compute_driver = xenapi.XenAPIDriver
  26. {% if service_name == 'nova-compute' %}
  27. host = xenapi_facts['dom0_hostname']
  28. {% endif %}
  29. {% else %}
  30. compute_driver = libvirt.LibvirtDriver
  31. {% endif %}
  32. # Though my_ip is not used directly, lots of other variables use $my_ip
  33. my_ip = {{ api_interface_address }}
  34. {% if enable_ceilometer | bool or enable_searchlight | bool or enable_designate | bool %}
  35. instance_usage_audit = True
  36. instance_usage_audit_period = hour
  37. {% if enable_watcher | bool %}
  38. compute_monitors=nova.compute.monitors.cpu.virt_driver
  39. {% endif %}
  40. {% endif %}
  41. transport_url = {{ rpc_transport_url }}
  42. {% if enable_blazar | bool %}
  43. [filter_scheduler]
  44. available_filters = nova.scheduler.filters.all_filters
  45. available_filters = blazarnova.scheduler.filters.blazar_filter.BlazarFilter
  46. enabled_filters = RetryFilter,AvailabilityZoneFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,BlazarFilter
  47. {% endif %}
  48. [api]
  49. use_forwarded_for = true
  50. [conductor]
  51. workers = {{ openstack_service_workers }}
  52. {% if nova_console == 'novnc' %}
  53. [vnc]
  54. {% if service_name == "nova-compute-ironic" %}
  55. enabled = false
  56. {% else %}
  57. novncproxy_host = {{ api_interface_address }}
  58. novncproxy_port = {{ nova_novncproxy_listen_port }}
  59. server_listen = {{ api_interface_address }}
  60. server_proxyclient_address = {{ api_interface_address }}
  61. {% if inventory_hostname in groups['compute'] %}
  62. novncproxy_base_url = {{ public_protocol }}://{{ nova_novncproxy_fqdn }}:{{ nova_novncproxy_port }}/vnc_auto.html
  63. {% endif %}
  64. {% endif %}
  65. {% elif nova_console == 'spice' %}
  66. [vnc]
  67. # We have to turn off vnc to use spice
  68. enabled = false
  69. [spice]
  70. enabled = true
  71. server_listen = {{ api_interface_address }}
  72. server_proxyclient_address = {{ api_interface_address }}
  73. {% if inventory_hostname in groups['compute'] %}
  74. html5proxy_base_url = {{ public_protocol }}://{{ nova_spicehtml5proxy_fqdn }}:{{ nova_spicehtml5proxy_port }}/spice_auto.html
  75. {% endif %}
  76. html5proxy_host = {{ api_interface_address }}
  77. html5proxy_port = {{ nova_spicehtml5proxy_listen_port }}
  78. {% elif nova_console == 'none' %}
  79. [vnc]
  80. enabled = false
  81. [spice]
  82. enabled = false
  83. {% endif %}
  84. {% if enable_nova_serialconsole_proxy | bool %}
  85. [serial_console]
  86. enabled = true
  87. base_url = {{ nova_serialproxy_protocol }}://{{ nova_serialproxy_fqdn }}:{{ nova_serialproxy_port }}/
  88. serialproxy_host = {{ api_interface_address }}
  89. serialproxy_port = {{ nova_serialproxy_listen_port }}
  90. proxyclient_address = {{ api_interface_address }}
  91. {% endif %}
  92. {% if service_name == "nova-compute-ironic" %}
  93. [ironic]
  94. username = {{ ironic_keystone_user }}
  95. password = {{ ironic_keystone_password }}
  96. auth_url = {{ openstack_auth.auth_url }}/v3
  97. auth_type = password
  98. project_name = service
  99. user_domain_name = {{ default_user_domain_name }}
  100. project_domain_name = {{ default_project_domain_name }}
  101. endpoint_override = {{ internal_protocol }}://{{ ironic_internal_fqdn }}:{{ ironic_api_port }}/v1
  102. {% endif %}
  103. [oslo_middleware]
  104. enable_proxy_headers_parsing = True
  105. [oslo_concurrency]
  106. lock_path = /var/lib/nova/tmp
  107. [glance]
  108. api_servers = {{ internal_protocol }}://{{ glance_internal_fqdn }}:{{ glance_api_port }}
  109. num_retries = {{ groups['glance-api'] | length }}
  110. {% if enable_cinder | bool %}
  111. [cinder]
  112. catalog_info = volumev3:cinderv3:internalURL
  113. os_region_name = {{ openstack_region_name }}
  114. {% endif %}
  115. [neutron]
  116. metadata_proxy_shared_secret = {{ metadata_secret }}
  117. service_metadata_proxy = true
  118. {% if neutron_plugin_agent == 'vmware_nsxv3' %}
  119. ovs_bridge = {{ ovs_bridge }}
  120. {% endif %}
  121. auth_url = {{ keystone_admin_url }}
  122. auth_type = password
  123. project_domain_name = {{ default_project_domain_name }}
  124. user_domain_id = {{ default_user_domain_id }}
  125. project_name = service
  126. username = {{ neutron_keystone_user }}
  127. password = {{ neutron_keystone_password }}
  128. region_name = {{ openstack_region_name }}
  129. valid_interfaces = internal
  130. {% if not service_name.startswith('nova-compute') %}
  131. [database]
  132. connection = mysql+pymysql://{{ nova_database_user }}:{{ nova_database_password }}@{{ nova_database_address }}/{{ nova_database_name }}
  133. max_pool_size = 50
  134. max_overflow = 1000
  135. max_retries = -1
  136. [api_database]
  137. connection = mysql+pymysql://{{ nova_api_database_user }}:{{ nova_api_database_password }}@{{ nova_api_database_address }}/{{ nova_api_database_name }}
  138. max_retries = -1
  139. {% endif %}
  140. [cache]
  141. backend = oslo_cache.memcache_pool
  142. enabled = True
  143. memcache_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %}
  144. [keystone_authtoken]
  145. www_authenticate_uri = {{ keystone_internal_url }}
  146. auth_url = {{ keystone_admin_url }}
  147. auth_type = password
  148. project_domain_id = {{ default_project_domain_id }}
  149. user_domain_id = {{ default_user_domain_id }}
  150. project_name = service
  151. username = {{ nova_keystone_user }}
  152. password = {{ nova_keystone_password }}
  153. memcache_security_strategy = ENCRYPT
  154. memcache_secret_key = {{ memcache_secret_key }}
  155. memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %}
  156. {% if service_name == 'nova-compute' %}
  157. {% if nova_compute_virt_type in ['kvm', 'qemu'] %}
  158. {# must be an include because Ansible 2.8 (and earlier) does not like defined variables referencing undefined variables: migration_interface_address here #}
  159. {# see https://github.com/ansible/ansible/issues/58835 #}
  160. {% include 'nova.conf.d/libvirt.conf.j2' %}
  161. {% endif %}
  162. {% endif %}
  163. {% if nova_compute_virt_type == "vmware" %}
  164. [vmware]
  165. host_ip = {{ vmware_vcenter_host_ip }}
  166. host_username = {{ vmware_vcenter_host_username }}
  167. host_password = {{ vmware_vcenter_host_password }}
  168. cluster_name = {{ vmware_vcenter_cluster_name }}
  169. datastore_regex = {{ vmware_vcenter_datastore_regex }}
  170. insecure = {{ vmware_vcenter_insecure }}
  171. {% if not vmware_vcenter_insecure | bool %}
  172. ca_file = /etc/nova/vmware_ca
  173. {% endif %}
  174. {% endif %}
  175. [upgrade_levels]
  176. compute = auto
  177. [oslo_messaging_notifications]
  178. transport_url = {{ notify_transport_url }}
  179. {% if nova_enabled_notification_topics %}
  180. driver = messagingv2
  181. topics = {{ nova_enabled_notification_topics | map(attribute='name') | join(',') }}
  182. {% else %}
  183. driver = noop
  184. {% endif %}
  185. {% if nova_policy_file is defined %}
  186. [oslo_policy]
  187. policy_file = {{ nova_policy_file }}
  188. {% endif %}
  189. [privsep_entrypoint]
  190. helper_command=sudo nova-rootwrap /etc/nova/rootwrap.conf privsep-helper --config-file /etc/nova/nova.conf
  191. [glance]
  192. debug = {{ nova_logging_debug }}
  193. [guestfs]
  194. debug = {{ nova_logging_debug }}
  195. [wsgi]
  196. api_paste_config = /etc/nova/api-paste.ini
  197. {% if kolla_enable_tls_external | bool or kolla_enable_tls_internal | bool %}
  198. secure_proxy_ssl_header = HTTP_X_FORWARDED_PROTO
  199. {% endif %}
  200. [scheduler]
  201. max_attempts = 10
  202. # NOTE(yoctozepto): kolla-ansible handles cell mapping by itself on each deploy
  203. # periodic run must be disabled to avoid random failures (where both try to map)
  204. # -1 is default and means periodic discovery is disabled
  205. discover_hosts_in_cells_interval = -1
  206. {% if enable_nova_fake | bool %}
  207. default_filters = RetryFilter,AvailabilityZoneFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter
  208. {% endif %}
  209. [placement]
  210. auth_type = password
  211. auth_url = {{ keystone_admin_url }}
  212. username = {{ placement_keystone_user }}
  213. password = {{ placement_keystone_password }}
  214. user_domain_name = {{ default_user_domain_name }}
  215. project_name = service
  216. project_domain_name = {{ default_project_domain_name }}
  217. region_name = {{ openstack_region_name }}
  218. os_interface = internal
  219. [notifications]
  220. {% if enable_ceilometer | bool or enable_searchlight | bool or enable_designate | bool or enable_neutron_infoblox_ipam_agent | bool %}
  221. notify_on_state_change = vm_and_task_state
  222. {% endif %}
  223. {% if not enable_searchlight | bool %}
  224. notification_format = unversioned
  225. {% else %}
  226. notification_format = both
  227. {% endif %}
  228. {% if enable_osprofiler | bool %}
  229. [profiler]
  230. enabled = true
  231. trace_sqlalchemy = true
  232. hmac_keys = {{ osprofiler_secret }}
  233. connection_string = {{ osprofiler_backend_connection_string }}
  234. {% endif %}
  235. {% if enable_barbican | bool %}
  236. [barbican]
  237. auth_endpoint = {{ keystone_internal_url }}
  238. {% endif %}
  239. {% if nova_compute_virt_type == "xenapi" %}
  240. [xenserver]
  241. ovs_integration_bridge = br-int
  242. connection_password = {{ xenserver_password }}
  243. connection_username = {{ xenserver_username }}
  244. connection_url = {{ xenserver_connect_protocol }}://{{ xenserver_himn_ip }}
  245. {% endif %}