Creating virtual machines with physical GPUs
Limitations
- Virtual machines with attached physical GPUs cannot be live migrated.
Prerequisites
- The compute cluster is reconfigured for GPU passthrough, 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 an attached physical GPU
-
Create a flavor with the
pci_passthrough
property specifying the GPU alias from the pci-passthrough.yaml file and the number of GPUs to use. For example, to create thegpu-flavor
flavor with 8 vCPUs and 16 GiB of RAM, run:# openstack --insecure flavor create --ram 16384 --vcpus 8 --property "pci_passthrough:alias"="gpu:1" \ --public gpu-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 gpu-flavor --property hide_hypervisor_id=true
-
Create a virtual machine specifying the
gpu-flavor
flavor. For example, to create thegpu-vm
from thevol2
volume, run:# openstack --insecure server create --volume vol2 --flavor gpu-flavor gpu-vm