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.


  • Virtual machines with attached vGPUs cannot be suspended and live migrated.


To create a virtual machine with a vGPU

  1. Create a flavor with the resources property specifying the number of vGPUs to use. For example, to create the vgpu-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
  2. Create a virtual machine specifying the vgpu-flavor flavor. For example, to create the vgpu-vm from the vol2 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.