Skip to content

Data Source: proxmox_hardware_pci

Retrieves the list of PCI devices present on a specific Proxmox VE node. This is useful for discovering PCI devices available for passthrough or for configuring hardware mappings.

Example Usage

# List all PCI devices on a node (using default blacklist)
data "proxmox_hardware_pci" "example" {
  node_name = "pve"
}

# List all PCI devices including bridges and memory controllers
data "proxmox_hardware_pci" "all" {
  node_name           = "pve"
  pci_class_blacklist = []
}

# Find all NVIDIA GPUs (vendor ID 10de = NVIDIA, class 03 = display controller)
data "proxmox_hardware_pci" "gpus" {
  node_name           = "pve"
  pci_class_blacklist = []

  filters = {
    vendor_id = "10de"
    class     = "03"
  }
}

Schema

Required

  • node_name (String) The name of the node to list PCI devices from.

Optional

  • filters (Attributes) Client-side filters for narrowing down results. All filters use prefix matching. (see below for nested schema)
  • pci_class_blacklist (List of String) A list of PCI class IDs (hex prefixes) to exclude from the results. If not set, the Proxmox default blacklist is used which filters out memory controllers (05), bridges (06), and processors (0b). Set to an empty list to return all devices.

Read-Only

Nested Schema for filters

Optional:

  • class (String) Filter by PCI class code prefix (e.g. 03 to match all display controllers). The 0x prefix in class codes is stripped before matching.
  • device_id (String) Filter by device ID prefix. The 0x prefix in device IDs is stripped before matching.
  • id (String) Filter by PCI address prefix (e.g. 0000:01 to match all devices on bus 01).
  • vendor_id (String) Filter by vendor ID prefix (e.g. 8086 for Intel devices). The 0x prefix in vendor IDs is stripped before matching.

Nested Schema for devices

Read-Only:

  • class (String) The PCI class code (hex, e.g. 0x030000).
  • device (String) The PCI device ID (hex, e.g. 0x5916).
  • device_name (String) The human-readable device name.
  • id (String) The PCI address in domain:bus:device.function format (e.g. 0000:00:02.0).
  • iommu_group (Number) The IOMMU group number. -1 indicates that the device is not in an IOMMU group.
  • mdev (Boolean) Whether the device supports mediated devices (vGPU).
  • subsystem_device (String) The PCI subsystem device ID (hex).
  • subsystem_device_name (String) The human-readable subsystem device name.
  • subsystem_vendor (String) The PCI subsystem vendor ID (hex).
  • subsystem_vendor_name (String) The human-readable subsystem vendor name.
  • vendor (String) The PCI vendor ID (hex, e.g. 0x8086).
  • vendor_name (String) The human-readable vendor name (e.g. Intel Corporation).