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

Host parameter inappropriately required in usb block for proxmox_virtual_environment_vm #888

Closed
macdweller opened this issue Jan 13, 2024 · 2 comments · Fixed by #1338
Closed
Labels
🐛 bug Something isn't working

Comments

@macdweller
Copy link

Describe the bug
It appears to be impossible to use a resource mapping to pass through a USB device to a vm. It will not allow you to specify the block like so:

  proxmox_virtual_environment_vm "foo" {
    # ...

    usb {
      mapping = "somedevice"
    }

    # ...
  }

because it wants a host parameter. Using the host parameter is also not a valid workaround, because only the root user in proxmox can assign raw usb devices (you're forced to use the mapping if you have a different account doing the cloning).

To Reproduce
Create a vm with the above usb block.

Expected behavior
host and mapping should be either/or in the usb block. If mapping is specified, host should not be required.

If I'm completely off base, please let me know. =)

Also, the documentation could use a once over; it references an id parameter that doesn't exist in the description for mapping.

Additional context

  • Proxmox 8.1.3 single host
  • Provider version: 0.43.2
  • Terraform version: 1.6.6
  • OS: Rocky 8.7
@macdweller macdweller changed the title Host parameter inappropriate required in usb block for proxmox_virtual_environment_vm Host parameter inappropriately required in usb block for proxmox_virtual_environment_vm Jan 13, 2024
@bpg bpg added the 🐛 bug Something isn't working label Jan 27, 2024
@ychlc
Copy link

ychlc commented Apr 25, 2024

+1, would love a fix for this. The only "workaround" I've found is to:

  • Use the root account and,
  • Use password, rather than API, authentication (on Proxmox 8 and later, at least)

@svengreb
Copy link
Contributor

I guess with #1231 this might be handled more easily (and resolved as a "side effect") since the new Terraform framework improved a lot of the problems of the previous Terraform plugin SDK (v2).
I've implemented support to create hardware mappings last month (proxmox_virtual_environment_hardware_mapping_pci or proxmox_virtual_environment_hardware_mapping_usb) which is available as of version 0.54.0. This might help to manage mappings in the VM resource, e.g. by using the id of the mapping for the mapping attribute. The mapping resource itself already includes the device name (host) so this should not be required in the VM resource USB block/object anymore and as soon as the new proxmox_virtual_environment_vm2 supports it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants