Skip to content

Conversation

@rohityadavcloud
Copy link
Member

On newer libvirt/qemu it seems PCI hot-plugging could be an issue as
seen in:

https://www.suse.com/support/kb/doc/?id=000019383
https://bugs.launchpad.net/nova/+bug/1836065

As per the default machine doc, it advises to pre-allocate PCI
controllers on the machine and pcie-to-pci-bridge based controller
for legacy PCI models:
https://libvirt.org/pci-hotplug.html#x86_64-q35

This patch introduces the concept as a workaround until a proper fix is
done (ideally in the upstream libvirt/qemu projects). Until then client
code can add 32 PCI controllers and a pcie-to-pci-bridge controller.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

How Has This Been Tested?

On this env:

# virsh version
Compiled against library: libvirt 6.0.0
Using library: libvirt 6.0.0
Using API: QEMU 6.0.0
Running hypervisor: QEMU 4.2.0

I was unable to add nic to a VM (beyond 3 nics) and got the error "No more available PCI slots". After this workaround/fix I was able to add nic and disks to the VM. (The VM was using virtio-scsi for disks and virtio based nics on PCI controller)

On newer libvirt/qemu it seems PCI hot-plugging could be an issue as
seen in:

https://www.suse.com/support/kb/doc/?id=000019383
https://bugs.launchpad.net/nova/+bug/1836065

As per the default machine doc, it advises to pre-allocate PCI
controllers on the machine and pcie-to-pci-bridge based controller
for legacy PCI models:
https://libvirt.org/pci-hotplug.html#x86_64-q35

This patch introduces the concept as a workaround until a proper fix is
done (ideally in the upstream libvirt/qemu projects). Until then client
code can add 32 PCI controllers and a pcie-to-pci-bridge controller.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 532b234)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@rohityadavcloud
Copy link
Member Author

@kiwiflyer @weizhouapache @wido @GabrielBrascher @nvazquez @andrijapanicsb
This is a workaround and would allow upto 64 PCI/legacy-pcie nics/disks to be added. But this needs discussion, preferably a better solution than having to pre-allocate controllers (than use a hardcoded or settings-define number of controllers). Thanks.

@rohityadavcloud
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos7 ✔debian. JID-1474

@rohityadavcloud
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@rohityadavcloud
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@GabrielBrascher
Copy link
Member

GabrielBrascher commented Jul 1, 2020

@rhtyd I have no objection to this implementation as a work-around.

I researched some alternatives, one would be Using PCI Hotplug Support. But that requires Hotplug drivers installed on all KVM nodes; and then use qemu monitor to add the devices on demand.

@rohityadavcloud
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@rohityadavcloud
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@rohityadavcloud
Copy link
Member Author

On hold - tests are failing, needs investigation and explore best case solution

@rohityadavcloud rohityadavcloud marked this pull request as draft July 8, 2020 05:52
@rohityadavcloud
Copy link
Member Author

Closing this, moved to #5193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants