Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is not possible to add more than a PCI device (passthrough) to a VM #540

Open
brodriguez-opennebula opened this issue Apr 8, 2024 · 2 comments

Comments

@brodriguez-opennebula
Copy link

brodriguez-opennebula commented Apr 8, 2024

Description

By default, a PCI template section does not allow more than one element

Terraform and Provider version

1.4.0

Affected resources and data sources

No response

Terraform configuration

template_section {
  name = "PCI"
  elements = {
    VENDOR = "...",
    DEVICE = "...",
    CLASS = "..."
  }
}

template_section {
  name = "PCI"
  elements = {
    VENDOR = "...",
    DEVICE = "...",
    CLASS = "..."
  }
}

Expected behavior

Both PCI elements should be created

Actual behavior

Only a PCI entry is created

Steps to Reproduce

template_section {
  name = "PCI"
  elements = {
    VENDOR = "...",
    DEVICE = "...",
    CLASS = "..."
  }
}

template_section {
  name = "PCI"
  elements = {
    VENDOR = "...",
    DEVICE = "...",
    CLASS = "..."
  }
}

Debug output

No response

Panic output

No response

Important factoids

No response

References

No response

@treywelsh
Copy link
Collaborator

treywelsh commented Apr 9, 2024

The template_section limitation is expected to keep things simple. In this case we just need to find the vector with the matching name. However, having the same name in multiple template_section implies that we need to compare the contents when reading i.e. matching the template_section with the same keys, same values.
See initial template_section PR here: #362

To solve you probleme we could either improve template_section to manage multiple instances with the same name, or introduce a PCI section like disk or nic. In this case we may want to introduce directly a new resource named opennebula_virtual_machine_pci.

@antalvrom
Copy link

@brodriguez-opennebula should we close this?

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

No branches or pull requests

3 participants