Do not add libvirt and mdev sections for non-computes

Libvirt configuration should not be needed outside of the compute hosts,
which shall reduce amount of parameters in nova.conf for
scheduler/api.
Change-Id: Ic74feafa0a9fa26ea8453cacf99cf6a53decf877
This commit is contained in:
Dmitriy Rabotyagov
2025年05月21日 18:02:12 +02:00
parent 8968c235ec
commit eb06951374

View File

@@ -255,16 +255,17 @@ insecure = {{ keystone_service_adminuri_insecure | bool }}
isolate_vif = True
{% endif %}
{% if nova_services['nova-compute']['group'] in group_names %}
[libvirt]
inject_partition = {{ nova_libvirt_inject_partition }}
inject_password = {{ nova_libvirt_inject_password }}
inject_key = {{ nova_libvirt_inject_key }}
virt_type = {{ nova_virt_type }}
{% if nova_cpu_mode is defined %}
{% if nova_cpu_mode is defined %}
cpu_mode = {{ nova_cpu_mode }}
{% endif %}
{% endif %}
{% if nova_rbd_inuse %}
{% if nova_rbd_inuse %}
# ceph rbd support
rbd_user = {{ nova_ceph_client }}
rbd_secret_uuid = {{ nova_ceph_client_uuid }}
@@ -286,6 +287,7 @@ live_migration_inbound_addr = {{ nova_libvirt_live_migration_inbound_addr }}
{% endif %}
hw_disk_discard = {{ nova_libvirt_hw_disk_discard }}
disk_cachemodes = {{ nova_libvirt_disk_cachemodes }}
{% endif %}
{% endif %}
{% if nova_barbican_enabled %}
@@ -335,14 +337,16 @@ track_instance_changes = {{ nova_scheduler_tracks_instance_changes }}
[upgrade_levels]
compute=auto
{% if nova_enabled_mdev_types | length > 0 or discovered_mdev_types is defined %}
{% if nova_services['nova-compute']['group'] in group_names %}
{% if nova_enabled_mdev_types | length > 0 or discovered_mdev_types is defined %}
[devices]
enabled_mdev_types = {{ nova_enabled_mdev_types | map(attribute='type') | list | default(discovered_mdev_types, true) | unique | join(',') }}
{% for record in nova_enabled_mdev_types | selectattr('address', 'defined') | list %}
{% for record in nova_enabled_mdev_types | selectattr('address', 'defined') | list %}
[mdev_{{ record.type }}]
device_addresses = {{ (record.address is string) | ternary(record.address, record.address | join(',')) }}
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
{% if nova_device_spec or nova_pci_alias %}
Reference in New Issue
openstack/openstack-ansible-os_nova
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.