diff --git a/defaults/main.yml b/defaults/main.yml index 5c28b83b..26337613 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -511,16 +511,16 @@ nova_api_os_compute_uwsgi_ini_overrides: {} # Enabled vGPU Types - dict defining 'type' and 'address' (optional) of vGPU # an address is only required when supporting more than one physical GPU on the host # Example 1: -# nova_enabled_vgpu_types: +# nova_enabled_mdev_types: # - type: nvidia-35 # # Example 2: -# nova_enabled_vgpu_types: +# nova_enabled_mdev_types: # - type: nvidia-35 # address: # - type: nvidia-36 # address: -nova_enabled_vgpu_types: {} +nova_enabled_mdev_types: "{{ nova_enabled_vgpu_types | default({}) }}" # PCI devices passthrough to nova # For SR-IOV please use: diff --git a/releasenotes/notes/nova_mdev_types-df92fb3d1ce339ec.yaml b/releasenotes/notes/nova_mdev_types-df92fb3d1ce339ec.yaml new file mode 100644 index 00000000..98080753 --- /dev/null +++ b/releasenotes/notes/nova_mdev_types-df92fb3d1ce339ec.yaml @@ -0,0 +1,5 @@ +--- +deprecations: + - | + Variable ``nova_enabled_vgpu_types`` has been deprecated and is replaced + with ``nova_enabled_mdev_types``. diff --git a/tasks/main.yml b/tasks/main.yml index e582ba38..8ecde0d8 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -119,7 +119,7 @@ - always - nova-config -- import_tasks: nova_vgpu_detect.yml +- import_tasks: nova_mdev_detect.yml tags: - always - nova-config diff --git a/tasks/nova_vgpu_detect.yml b/tasks/nova_mdev_detect.yml similarity index 89% rename from tasks/nova_vgpu_detect.yml rename to tasks/nova_mdev_detect.yml index 5b547b69..80579ec3 100644 --- a/tasks/nova_vgpu_detect.yml +++ b/tasks/nova_mdev_detect.yml @@ -22,9 +22,9 @@ register: mdev when: mdev_folder.stat.exists -- name: Register a fact for nova enabled_vgpu_types +- name: Register a fact for nova enabled_mdev_types set_fact: - discovered_vgpu_types: "{{ mdev.stdout_lines | unique }}" + discovered_mdev_types: "{{ mdev.stdout_lines | unique }}" when: - mdev.stdout_lines is defined - mdev.stdout_lines | length > 0 diff --git a/templates/nova.conf.j2 b/templates/nova.conf.j2 index 8a75b428..52643505 100644 --- a/templates/nova.conf.j2 +++ b/templates/nova.conf.j2 @@ -289,12 +289,12 @@ tracks_instance_changes = {{ nova_scheduler_tracks_instance_changes }} [upgrade_levels] compute=auto -{% if nova_enabled_vgpu_types | length > 0 or discovered_vgpu_types is defined %} +{% if nova_enabled_mdev_types | length > 0 or discovered_mdev_types is defined %} [devices] -enabled_vgpu_types = {{ nova_enabled_vgpu_types | map(attribute='type') | list | default(discovered_vgpu_types, true) | unique | join(',') }} +enabled_mdev_types = {{ nova_enabled_mdev_types | map(attribute='type') | list | default(discovered_mdev_types, true) | unique | join(',') }} -{% for record in nova_enabled_vgpu_types | selectattr('address', 'defined') | list %} -[vgpu_{{ record.type }}] +{% for record in nova_enabled_mdev_types | selectattr('address', 'defined') | list %} +[mdev_{{ record.type }}] device_addresses = {{ record.address }} {% endfor %} {% endif %}