Creating virtual machines with physical GPU
-
Connect to the OpenStack command-line interface as a system administrator to authorize further OpenStack commands (refer to Connecting to OpenStack command-line interface).
# kolla-ansible post-deploy # source /etc/kolla/admin-openrc.sh
-
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 16 --vcpus 8 --property "pci_passthrough:alias"="gpu:1" 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