nova/nova/conf/devices.py
naichuans 0b39b51ae5 vgpu: add enabled white list
Some pGPUs (e.g. NVIDIA GRID K1) support different vGPU types. User can
use `enabled_vgpu_types` to specify the enabled vGPU types that a guest
could consume from the host.

NOTE(sbauza) :
Since that configuration is shared between all virt drivers, we need to
provide a single change that will just add that conf opt and then use
it in separate series as a common base. That implies that configuration
option is useless until we merge the code that reads it, but that's a
necessary compromise for making sure we can move both Xen and libvirt
efforts in parallel.

Partially Implements: blueprint add-support-for-vgpu
Co-Authored-By: Sylvain Bauza <sbauza@redhat.com>

Change-Id: I56f9597e968eac041832cdb90fe52cf0d3b4a4ef
2017-11-21 06:43:52 -08:00

41 lines
1.3 KiB
Python

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
devices_group = cfg.OptGroup(
name='devices',
title='physical or virtual device options')
vgpu_opts = [
cfg.ListOpt('enabled_vgpu_types',
default=[],
help="""
A list of the vGPU types enabled in the compute node.
Some pGPUs (e.g. NVIDIA GRID K1) support different vGPU types. User can use
this option to specify a list of enabled vGPU types that may be assigned to a
guest instance. An example is as the following:
[devices]
enabled_vgpu_types = ['GRID K100', 'Intel GVT-g', 'MxGPU.2', 'nvidia-11']
""")
]
def register_opts(conf):
conf.register_group(devices_group)
conf.register_opts(vgpu_opts, group=devices_group)
def list_opts():
return {devices_group: vgpu_opts}