Can't assign system with multiple GPUs to different VMs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Confirmed
|
Low
|
Unassigned |
Bug Description
I have an OS Mitaka deployment that was done by Fuel (9.0).
I have a system with 8GPUs in a single box. We are trying to allow VMs to request access to GPU resources via this box.
I know that with PCI Passthrough you can only have a device assigned to a single VM (e.g. 1 device <-> 1 VM). However, this box has 8 GPUs (8 separate devices). So I want support (1GPU -> 1VM) * 8, or (2GPU -> 1VM) * 4, (4GPU -> 1VM) * 2, or (8GPU -> 1VM) * 1.
I have successfully been able to get the system to have 1 GPU <-> 1 VM, however when I go to create another VM with a GPU I get "not enough hosts found".
This is what I have done so far.
/etc/nova/nova.conf
Add:
Pic_passthroug
sudo gedit /etc/modules and add:
pci_stub
vfio
vfio_iommu_type1
vfio_pci
kvm
kvm_intel
Sudo vi /etc/default/grub
GRUB_CMDLINE_
//BLACKLIST
sudo gedit /etc/initramfs-
pci_stub ids=10de:17c2
sudo update-initramfs -u
On Controller Node:
Edit nova.conf
Add specifically for GPU you want to use!
pci_alias=
Add
scheduler_
scheduler_
scheduler_
scheduler_
#: source openrc
Nova flavor-key g1.xlarge set "pci_passthroug
Actual Results:
When I go to create my second VM with the same flavor it errors out with this message. (If I create 1 VM it works and a GPU is assigned to that machine).
Message: No valid host was found. There are not enough hosts available.
Code: 500
File "/usr/lib/
Running SELECT * FROM pci_devices; on the nova database I get the following
As you can see it shows 7 are available.
Expected Results:
Another VM created with 1 more GPU used from the system.
tags: | added: libvirt pci |
Changed in nova: | |
status: | New → Confirmed |
importance: | Undecided → Low |
Was doing some more investigating and found this in the nova-all.log. This looks to like an issue like the device (0f:00.0) is busy, however it shouldn't be as the only one in use *should* be 10:00.0.
All devices seem to be claimed by pci-stub which from my understanding indicates that they can't be claimed by the current running OS.
<179>Sep 27 18:53:48 node-13 nova-conductor: 2016-09-27 18:53:48.631 24595 ERROR nova.scheduler. utils [req-dfd5dfe7- ea36-4ce0- 8fe7-2412df59db 20 11a8bdff50d34c6 4b2a9fc2b477af7 4b 81d1532551c2436 793417cd7ef0abf 35 - - -] [instance: e5fadc3b- 6fab-4524- 9a35-c8ac954014 bd] Error from last host: cirrascale1 (node cirrascale1): [u'Traceback (most recent call last):\n', u' File "/usr/lib/ python2. 7/dist- packages/ nova/compute/ manager. py", line 1926, in _do_build_ and_run_ instance\ n filter_ properties) \n', u' File "/usr/lib/ python2. 7/dist- packages/ nova/compute/ manager. py", line 2116, in _build_ and_run_ instance\ n instance_ uuid=instance. uuid, reason= six.text_ type(e) )\n', u"RescheduledEx ception: Build of instance e5fadc3b- 6fab-4524- 9a35-c8ac954014 bd was re-scheduled: internal error: process exited while connecting to monitor: 2016-09- 27T18:53: 46.506916Z qemu-system-x86_64: -device vfio-pci, host=0f: 00.0,id= hostdev0, bus=pci. 0,addr= 0x5: vfio: Error: Failed to setup INTx fd: Device or resource busy\n2016- 09-27T18: 53:46.507929Z qemu-system-x86_64: -device vfio-pci, host=0f: 00.0,id= hostdev0, bus=pci. 0,addr= 0x5: Device initialization failed\ n2016-09- 27T18:53: 46.507952Z qemu-system-x86_64: -device vfio-pci, host=0f: 00.0,id= hostdev0, bus=pci. 0,addr= 0x5: Device 'vfio-pci' could not be initialized\n\n"]