Creating virtual machines with virtual GPUs
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 create a virtual machine with any vGPU enabled on a node
-
Create a flavor with the
resources
property specifying the number of vGPUs to use. For example, to create thevgpu-flavor
flavor with 2 vCPUs and 4 GiB of RAM, run:# openstack --insecure flavor create --ram 4096 --vcpus 2 --property resources:VGPU=1 --public vgpu-flavor
-
Create a virtual machine specifying the
vgpu-flavor
flavor. For example, to create thevgpu-vm
from thevol2
volume, run:# openstack --insecure server create --volume vol2 --flavor vgpu-flavor vgpu-vm
The created virtual machine will have a virtual GPU of a randomly chosen vGPU type that is enabled on the host.
To create a virtual machine with a vGPU of a particular type
-
Create a flavor with the
resources
andtrait
properties specifying the number of vGPUs and the vGPU type to use. For example, to create thevgpu228-flavor
flavor with 2 vCPUs, 4 GiB of RAM, and thenvidia-228
vGPU type, run:# openstack --insecure flavor create --ram 4096 --vcpus 2 --property resources:VGPU=1 \ --property trait:CUSTOM_NVIDIA_228=required --public vgpu228-flavor
-
Create a virtual machine specifying the
vgpu228-flavor
flavor. For example, to create thevgpu-vm
from thevol2
volume, run:# openstack --insecure server create --volume vol2 --flavor vgpu228-flavor vgpu-vm
The created virtual machine will have a virtual GPU of the nvidia-228
vGPU type.