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

vmware_host_passthrough by id #1364

Closed
holmesb opened this issue Jun 22, 2022 · 6 comments · Fixed by #1365
Closed

vmware_host_passthrough by id #1364

holmesb opened this issue Jun 22, 2022 · 6 comments · Fixed by #1365
Assignees

Comments

@holmesb
Copy link

holmesb commented Jun 22, 2022

SUMMARY

Hi,

Currently if multiple PCI devices exist of the same name, can only passthrough all or none. vmware_host_passthrough only supports device name, not ID. So if only some NICs\GPUs need to be passedthrough, can't be done.

Cheers.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

module: vmware_host_passthrough

@sky-joker
Copy link
Collaborator

Thanks, @holmesb for requesting the feature!
I will examine to add the parameter for specifying an id.

@sky-joker
Copy link
Collaborator

resolved_by_pr #1365

@sky-joker
Copy link
Collaborator

sky-joker commented Jun 23, 2022

Hi @holmesb

I made a patch(#1365) to fix the issue.
Could you please test the fixed module works well in your environment?
And please let me know the result.

You can test by the below procedure.

$ mkdir something_work_dir
$ cd something_work_dir
$ git clone https://github.com/ansible-collections/community.vmware.git
$ cd community.vmware
$ git fetch origin pull/1365/head:fix_issue1364 && git checkout fix_issue1364
$ cd ..
$ mkdir -p collections/ansible_collections/community
$ mv community.vmware collections/ansible_collections/community/vmware
$ ls
collections
$ vi playbook.yml

playbook.yml

---
- hosts: localhost
  gather_facts: false
  tasks:
    - name: Enable passthrough of PCI device with ID
      community.vmware.vmware_host_passthrough:
        hostname: "{{ vcenter_hostname }}"
        username: "{{ vcenter_username }}"
        password: "{{ vcenter_password }}"
        validate_certs: false
        esxi_hostname: "{{ esxi1 }}"
        devices:
          - device: "{{ target_pci_device }}"

@mariolenz
Copy link
Collaborator

@holmesb Did you have the time yet to test if #1365 fixes your issue?

softwarefactory-project-zuul bot pushed a commit that referenced this issue Jul 7, 2022
…ces parameter (#1365)

vmware_host_passthrough: Fix to be able to specify PCI id in the devices parameter

Depends-On: ansible/ansible-zuul-jobs#1579
SUMMARY
If ESXi has multiple PCI devices and they are the same name, and you want to enable the passthrough, you need to specify the PCI id.
But the module hasn't been able to specify the PCI id of the PCI device.
This PR is to be able to specify the id in the devices parameter the module has.
fixes: #1364
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/modules/vmware_host_passthrough.py
ADDITIONAL INFORMATION
tested in vCenter/ESXi 7.0.0

Reviewed-by: Mario Lenz <m@riolenz.de>
@holmesb
Copy link
Author

holmesb commented Jul 8, 2022

@mariolenz @sky-joker sorry, but I got this working in Terraform instead, and haven't found any time to test since. Glad it's added anyway.

@fs30000
Copy link

fs30000 commented Nov 20, 2024

So, after enabling passthrought for a device, how can it be mapped to a guest with ansible? On my particular case, a NIC.

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