Creating virtual machines with different vGPU types
If you want to use multiple vGPU types in the compute cluster, you need to manually create CUSTOM_NVIDIA_XXX
traits and assign them to corresponding vGPU resource providers first. Then, you can proceed to create flavors and virtual machines with the assigned traits.
Limitations
- Virtual machines with attached vGPUs cannot be suspended and live migrated.
-
The default QLX driver for the VNC console and the NVIDIA GPU driver are incompatible
After installing the NVIDIA GPU driver inside a virtual machine with an attached vGPU, the VNC console stops working. You can use RDP for a remote connection. Alternatively, for templates that already have the NVIDIA GPU driver installed, you can set the
hw_use_vgpu_display
property, to disable the integrated QLX driver. For example:# openstack --insecure image set --property hw_use_vgpu_display 007db63f-9b41-4918-b572-2c5eef4c8f4b
Prerequisites
- The compute cluster is reconfigured for vGPU support, as described in Enabling PCI passthrough and vGPU support.
- To authorize further OpenStack commands, the OpenStack command-line client must be configured, as outlined in Connecting to OpenStack command-line interface.
To configure multiple vGPU types for the compute cluster
-
List resource providers in the compute cluster to obtain their IDs. For example:
# openstack --insecure resource provider list +--------------------------------------+-----------------------------------------+------------+--------------------+----------------------+ | uuid | name | generation | root_provider_uuid | parent_provider_uuid | +--------------------------------------+-----------------------------------------+------------+--------------------+----------------------+ | 7d2ef259-42df-4ef8-8eaa-66c3b7448fc3 | node001.vstoragedomain_pci_0000_85_00_0 | 62 | 1f08c319-f270-<…> | 1f08c319-f270-<…> | | 94a84fc6-2f28-46d5-93e1-e588e347dd3b | node001.vstoragedomain_pci_0000_10_00_0 | 38 | 1f08c319-f270-<…> | 1f08c319-f270-<…> | | 41c177e3-6998-4e56-8d29-f98f72fef910 | node002.vstoragedomain_pci_0000_85_00_0 | 13 | 9dbc8c64-0048-<…> | 9dbc8c64-0048-<…> | | 7fd1d10f-9ceb-4cd1-acec-a1254755211b | node002.vstoragedomain_pci_0000_10_00_0 | 13 | 9dbc8c64-0048-<…> | 9dbc8c64-0048-<…> | +--------------------------------------+-----------------------------------------+------------+--------------------+----------------------+
-
Create custom traits that correspond to different GPU types. For example, to create the traits
CUSTOM_NVIDIA_231
andCUSTOM_NVIDIA_232
, run:# openstack --insecure trait create CUSTOM_NVIDIA_231 # openstack --insecure trait create CUSTOM_NVIDIA_232
-
Add the corresponding trait to the resource provider matching the GPU. For example:
# openstack --insecure resource provider trait set --trait CUSTOM_NVIDIA_231 7d2ef259-42df-4ef8-8eaa-66c3b7448fc3 +-------------------+ | name | +-------------------+ | CUSTOM_NVIDIA_231 | +-------------------+ # openstack --insecure resource provider trait set --trait CUSTOM_NVIDIA_231 94a84fc6-2f28-46d5-93e1-e588e347dd3b +-------------------+ | name | +-------------------+ | CUSTOM_NVIDIA_231 | +-------------------+
Now, the trait
CUSTOM_NVIDIA_231
is assigned to the vGPU resource providers of the nodenode001
. To assign the traitCUSTOM_NVIDIA_232
to the vGPU resource providers of the nodenode002
, run:# openstack --insecure resource provider trait set --trait CUSTOM_NVIDIA_232 41c177e3-6998-4e56-8d29-f98f72fef910 +-------------------+ | name | +-------------------+ | CUSTOM_NVIDIA_232 | +-------------------+ # openstack --insecure resource provider trait set --trait CUSTOM_NVIDIA_232 7fd1d10f-9ceb-4cd1-acec-a1254755211b +-------------------+ | name | +-------------------+ | CUSTOM_NVIDIA_232 | +-------------------+
To create virtual machines with different vGPU types
-
Create flavors with the
resources
property specifying the number of vGPUs to use. For example, to create thevgpu231-flavor
flavor with 2 vCPUs and 4 GiB of RAM and thevgpu232-flavor
flavor with 4 vCPUs and 8 GiB of RAM, run:# openstack --insecure flavor create --ram 4096 --vcpus 2 --property resources:VGPU=1 --public vgpu231-flavor # openstack --insecure flavor create --ram 8192 --vcpus 4 --property resources:VGPU=1 --public vgpu232-flavor
-
Add the requested traits to your flavors. For example, to add the traits
CUSTOM_NVIDIA_231
andCUSTOM_NVIDIA_232
to the flavorsvgpu231-flavor
andvgpu232-flavor
, run:# openstack --insecure flavor set --property trait:CUSTOM_NVIDIA_231=required vgpu231-flavor # openstack --insecure flavor set --property trait:CUSTOM_NVIDIA_232=required vgpu232-flavor
-
Create virtual machines specifying the prepared flavors. For example, to create the vm
vgpu231-vm
with thevgpu231-flavor
flavor and thevol1
volume, and the vmvgpu232-vm
with thevgpu232-flavor
flavor and thevol2
volume, run:# openstack --insecure server create --volume vol1 --flavor vgpu231-flavor vgpu231-vm # openstack --insecure server create --volume vol2 --flavor vgpu232-flavor vgpu232-vm
The created virtual machines will have virtual GPUs of different types that are configured in the compute cluster.