16
16
name = 'devices' ,
17
17
title = 'physical or virtual device options' )
18
18
19
- vgpu_opts = [
20
- cfg .ListOpt ('enabled_vgpu_types ' ,
19
+ mdev_opts = [
20
+ cfg .ListOpt ('enabled_mdev_types ' ,
21
21
default = [],
22
+ deprecated_name = 'enabled_vgpu_types' ,
22
23
help = """
23
- The vGPU types enabled in the compute node.
24
+ The mdev types enabled in the compute node.
24
25
25
- Some pGPUs (e.g. NVIDIA GRID K1) support different vGPU types. User can use
26
- this option to specify a list of enabled vGPU types that may be assigned to a
26
+ Some hardware (e.g. NVIDIA GRID K1) support different mdev types. User can use
27
+ this option to specify a list of enabled mdev types that may be assigned to a
27
28
guest instance.
28
29
29
- If more than one single vGPU type is provided, then for each *vGPU type* an
30
- additional section, ``[vgpu_$(VGPU_TYPE )]``, must be added to the configuration
30
+ If more than one single mdev type is provided, then for each *mdev type* an
31
+ additional section, ``[mdev_$(MDEV_TYPE )]``, must be added to the configuration
31
32
file. Each section then **must** be configured with a single configuration
32
33
option, ``device_addresses``, which should be a list of PCI addresses
33
- corresponding to the physical GPU(s) to assign to this type.
34
+ corresponding to the physical GPU(s) or mdev-capable hardware to assign to this
35
+ type.
34
36
35
37
If one or more sections are missing (meaning that a specific type is not wanted
36
- to use for at least one physical GPU ) or if no device addresses are provided,
37
- then Nova will only use the first type that was provided by
38
- ``[devices]/enabled_vgpu_types ``.
38
+ to use for at least one physical device ) or if no device addresses are provided
39
+ , then Nova will only use the first type that was provided by
40
+ ``[devices]/enabled_mdev_types ``.
39
41
40
42
If the same PCI address is provided for two different types, nova-compute will
41
43
return an InvalidLibvirtGPUConfig exception at restart.
42
44
43
- An example is as the following::
45
+ As an interim period, old configuration groups named ``[vgpu_$(MDEV_TYPE)]``
46
+ will be accepted. A valid configuration could then be::
44
47
45
48
[devices]
46
- enabled_vgpu_types = nvidia-35, nvidia-36
49
+ enabled_mdev_types = nvidia-35, nvidia-36
47
50
48
- [vgpu_nvidia -35]
51
+ [mdev_nvidia -35]
49
52
device_addresses = 0000:84:00.0,0000:85:00.0
50
53
51
54
[vgpu_nvidia-36]
57
60
58
61
def register_opts (conf ):
59
62
conf .register_group (devices_group )
60
- conf .register_opts (vgpu_opts , group = devices_group )
63
+ conf .register_opts (mdev_opts , group = devices_group )
61
64
62
65
63
66
def register_dynamic_opts (conf ):
@@ -66,14 +69,15 @@ def register_dynamic_opts(conf):
66
69
This must be called by the service that wishes to use the options **after**
67
70
the initial configuration has been loaded.
68
71
"""
69
- opt = cfg .ListOpt ('device_addresses' , default = [],
70
- item_type = cfg .types .String ())
71
72
72
- # Register the '[vgpu_$(VGPU_TYPE)]/device_addresses' opts, implicitly
73
- # registering the '[vgpu_$(VGPU_TYPE)]' groups in the process
74
- for vgpu_type in conf .devices .enabled_vgpu_types :
75
- conf .register_opt (opt , group = 'vgpu_%s' % vgpu_type )
73
+ # Register the '[mdev_$(MDEV_TYPE)]/device_addresses' opts, implicitly
74
+ # registering the '[mdev_$(MDEV_TYPE)]' groups in the process
75
+ for mdev_type in conf .devices .enabled_mdev_types :
76
+ opt = cfg .ListOpt ('device_addresses' , default = [],
77
+ item_type = cfg .types .String (),
78
+ deprecated_group = 'vgpu_%s' % mdev_type )
79
+ conf .register_opt (opt , group = 'mdev_%s' % mdev_type )
76
80
77
81
78
82
def list_opts ():
79
- return {devices_group : vgpu_opts }
83
+ return {devices_group : mdev_opts }
0 commit comments