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

Add support for data source of vsphere_host_virtual_switch so that existing standard switches can be used for things like port group creation #2060

Open
4 tasks done
dc232 opened this issue Nov 12, 2023 · 3 comments
Labels
area/networking Area: Networking enhancement Type: Enhancement new-data-source Feature: New Data Source
Milestone

Comments

@dc232
Copy link

dc232 commented Nov 12, 2023

Community Guidelines

  • I have read and agree to the HashiCorp Community Guidelines .
  • Vote on this issue by adding a 👍 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

Add support for new data source to query a specified vsphere_host_virtual_switch so that existing switches can be used for things like port group creation rather than having to create a new vsphere_host_virtual_switch through a resource

Use Case(s)

Can be used for the creation of a port group when an vsphere_host_virtual_switch already exists on the esxi host

Potential Terraform Provider Configuration

data "vsphere_host_virtual_switch" "myvswitch" {
  name          = "truenas_switch"
  datacenter_id = data.vsphere_datacenter.datacenter.id
}
resource "vsphere_host_port_group" "pg" {
  name                = "PXE-port-group"
  host_system_id      = data.vsphere_host.host.id
  virtual_switch_name = data.vsphere_host_virtual_switch.myvswitch.name
  vlan_id             = 4
  allow_promiscuous   = true
}

References

No response

@dc232 dc232 added the enhancement Type: Enhancement label Nov 12, 2023
Copy link

Hello, dc232! 🖐

Thank you for submitting an issue for this provider. The issue will now enter into the issue lifecycle.

If you want to contribute to this project, please review the contributing guidelines and information on submitting pull requests.

@dc232 dc232 changed the title Add support for data source of vsphere_host_virtual_switch so that existing switches can be used for things like port group creation Add support for data source of vsphere_host_virtual_switch so that existing standard switches can be used for things like port group creation Nov 12, 2023
@wilhelmmi
Copy link

wilhelmmi commented Dec 1, 2023

Not sure if it will solve your problem, but i just used the host_vSwitch_name of the existing switch as an Reference and it worked... at least for me,

resource "vsphere_host_port_group" "port_group" {
name           = "vSwitch-test"
host_system_id = data.vsphere_host.host.0.id
virtual_switch_name = var.esxi_vswitch_name
}

Copy link

Marking this issue as stale due to inactivity in the past 180 days. This helps us focus on the active issues. If this issue is reproducible with the latest version of the provider, please comment. If this issue receives no comments in the next 30 days it will automatically be closed.
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Status: Stale label May 30, 2024
@tenthirtyam tenthirtyam added area/networking Area: Networking new-data-source Feature: New Data Source labels Jun 11, 2024
@github-actions github-actions bot removed the stale Status: Stale label Jun 12, 2024
@tenthirtyam tenthirtyam added this to the Backlog milestone Jun 12, 2024
@tenthirtyam tenthirtyam self-assigned this Jun 15, 2024
@tenthirtyam tenthirtyam removed their assignment Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking Area: Networking enhancement Type: Enhancement new-data-source Feature: New Data Source
Projects
None yet
Development

No branches or pull requests

3 participants