Creating virtual machines with physical GPUs


  • Virtual machines with attached physical GPUs cannot be live migrated.


To create a virtual machine with an attached physical GPU

  1. 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 the gpu-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
  2. 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
  3. Create a virtual machine specifying the gpu-flavor flavor. For example, to create the gpu-vm from the vol2 volume, run:

    # openstack --insecure server create --volume vol2 --flavor gpu-flavor gpu-vm