0

Why can't openstack's virtual machine unbind/detach PCI devices such as GPU?

After I created a virtual machine in openstack using flavor with GPU device, the virtual machine cannot unbind/detach this GPU. This makes me very confused and I hope to get an answer.

sky zk
  • 1

1 Answers1

0

Try this method:

  • 1, create a new flavor which copy from the original flavor used to create server but without the property like "resources:VGPU".
  • 2, resize the original server to the new flavor.

Or remove GPU by virsh the section of Removing NVIDIA vGPU devices.

Victor Lee
  • 2,467
  • 3
  • 19
  • 37
  • Thank you for your advice. But I just tried to use ```resize```. The situation is as follows: 1. If both virtual machines do not have GPU, ```resize``` can succeed. 2. If a virtual machine has a GPU and the resized ```flavor``` does not have a GPU, an error is reported: ```no valid host was fund No valid host found for resize.``` At the same time, it should be noted that in my environment, a GPU is directly pass-through the virtual machine. – sky zk May 24 '22 at 13:22
  • @skyzk could you try to detach the GPU in host? – Victor Lee May 24 '22 at 13:25
  • Until now, I can't. However, the virtual machine I created through virt-manager can successfully unbind GPU through the command: ```virsh detach device```. – sky zk May 24 '22 at 13:27
  • And if I create a new virtual machine through ```flavor``` in openstack, I can't unbind GPU through the command: ```virsh detach-device```. – sky zk May 24 '22 at 13:37