Skip to content

[FEATURE] Add harvester_pci_device resource for PCI device passthrough #10018

@jniedergang

Description

@jniedergang

Summary

Add support for PCI device passthrough to VMs in the Terraform provider using Harvester's PCIDeviceClaim CRD.

Use Case

Users need to pass physical PCI devices (GPUs, network cards, etc.) to their VMs for performance-critical workloads. This requires creating PCIDeviceClaim resources that bind PCI devices to specific VMs.

Proposed Solution

Add a new harvester_pci_device resource to the Terraform provider that:

  • Creates PCIDeviceClaim CRDs to enable PCI passthrough
  • Supports specifying the target VM, node, and PCI addresses
  • Handles the auto-generated claim names (format: nodename-address)
  • Supports optional labels for organization

Example Usage

resource "harvester_pci_device" "gpu" {
  namespace     = "default"
  vm_name       = "default/my-vm"
  node_name     = "harvester-node-1"
  pci_addresses = ["0000:00:1f.3"]
}

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/terraform-providerHarvester Terraform provider for manage Harvester resourceskind/featureIssues that represent larger new pieces of functionality, not enhancements to existing functionalityrequire/pm-reviewRequire PM review requests

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions