Creating virtual machines with virtual GPUs
If you use only one vGPU type in the compute cluster, you need to create a flavor that requests one virtual GPU, and then create virtual machines with this flavor.
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 a vGPU
-
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
-
Some drivers may require to hide the hypervisor signature. To do this, add the
hide_hypervisor_id
property to the flavor:# openstack --insecure flavor set vgpu-flavor --property hide_hypervisor_id=true
-
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 the type that is configured in the compute cluster.