[pve-devel] [PATCH docs 1/2] pci passthrough: mention incompatibility with ballooning

Friedrich Weber f.weber at proxmox.com
Mon Nov 13 18:09:15 CET 2023

When using PCI(e) passthrough, setting a minimum amount of memory does
not have any effect, which may be surprising to users [0]. Add a note
to the PCI(e) passthrough section, and reference it in the ballooning

[0] https://forum.proxmox.com/threads/134202/

Signed-off-by: Friedrich Weber <f.weber at proxmox.com>
 qm-pci-passthrough.adoc | 10 ++++++++++
 qm.adoc                 |  5 +++++
 2 files changed, 15 insertions(+)

diff --git a/qm-pci-passthrough.adoc b/qm-pci-passthrough.adoc
index 1f68721..406156d 100644
--- a/qm-pci-passthrough.adoc
+++ b/qm-pci-passthrough.adoc
@@ -20,6 +20,16 @@ PCI speeds. Passing through devices as PCIe just sets a flag for the guest to
 tell it that the device is a  PCIe device instead of a "really fast legacy PCI
 device". Some guest applications benefit from this.
+xref:qm_ballooning[Automatic memory allocation (ballooning)] is not possible
+when using PCI(e) passthrough. As the PCI device may use DMA (Direct Memory
+Access), QEMU needs to map the complete guest memory on VM startup. Hence, the
+QEMU process will use at least the (maximum) configured amount of VM memory and
+setting a minimum amount does not have any effect. When using PCI(e)
+passthrough, it is recommended to set memory and minimum memory to the same
+amount and keep the balloning device enabled. However, keep in mind that the
+memory consumption reported in the GUI for the VM may be much lower than the
+memory consumption of the QEMU process.
 General Requirements
diff --git a/qm.adoc b/qm.adoc
index b7938d7..cbc5e0d 100644
--- a/qm.adoc
+++ b/qm.adoc
@@ -623,6 +623,7 @@ it (like for debugging purposes), simply uncheck *Ballooning Device* or set
 in the configuration.
 .Automatic Memory Allocation
 // see autoballoon() in pvestatd.pm
@@ -659,6 +660,10 @@ systems.
 When allocating RAM to your VMs, a good rule of thumb is always to leave 1GB
 of RAM available to the host.
+When using PCI(e) passthrough, setting a minimum amount of memory does not have
+any effect, see the section on xref:qm_pci_passthrough[PCI(e) passthrough] for
+more details.
 Network Device

More information about the pve-devel mailing list