Rename nova_enabled_vgpu_types

In order to reflect upstream nova variable change [1] we rename
nova_enabled_vgpu_types to nova_enabled_mdev_types.

[1] https://docs.openstack.org/nova/latest/configuration/config.html#devices.enabled_mdev_types

Change-Id: I7fcc6f6fbfd8e6e358036e72a82348b9cefe74ef
This commit is contained in:
Dmitriy Rabotyagov 2021-11-03 13:49:25 +02:00
parent 0f25baaa38
commit af44f385d7
5 changed files with 15 additions and 10 deletions

View File

@ -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: <device address>
# - type: nvidia-36
# address: <another device address>
nova_enabled_vgpu_types: {}
nova_enabled_mdev_types: "{{ nova_enabled_vgpu_types | default({}) }}"
# PCI devices passthrough to nova
# For SR-IOV please use:

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
Variable ``nova_enabled_vgpu_types`` has been deprecated and is replaced
with ``nova_enabled_mdev_types``.

View File

@ -119,7 +119,7 @@
- always
- nova-config
- import_tasks: nova_vgpu_detect.yml
- import_tasks: nova_mdev_detect.yml
tags:
- always
- nova-config

View File

@ -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

View File

@ -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 %}