Skip to content
New issue

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

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

Already on GitHub? # to your account

Add support for additional features in vsphere_distributed_virtual_switch resource #1145

Closed
codeopen1 opened this issue Jul 24, 2020 · 3 comments · Fixed by #1146
Closed
Labels
acknowledged Status: Issue or Pull Request Acknowledged area/networking Area: Networking enhancement Type: Enhancement

Comments

@codeopen1
Copy link
Contributor

Description

Hi. First of all thanks for the plugin.
I would like to implement some functionality in the distributed_virtual_switch resource and I just wanted to give notice while I prepare the code for a PR.

Features include:

  • PVLAN mappings
  • VSPAN (port mirroring) sessions
  • Filter policies (maybe)

So far, I have implemented PVLANs but the code is not quite ready for a PR yet.

Potential Terraform Configuration

Example pvlan mappings:

resource "vsphere_distributed_virtual_switch" "dvs" {
  # ...

  # VMwareDVSPvlanMapEntry
  pvlan_mapping {
    primary_vlan_id   = 100
    secondary_vlan_id = 100
    pvlan_type        = "promiscuous"
  }

  pvlan_mapping {
    primary_vlan_id   = 100
    secondary_vlan_id = 101
    pvlan_type        = "community"
  }

  pvlan_mapping {
    primary_vlan_id   = 100
    secondary_vlan_id = 102
    pvlan_type        = "isolated"
  }
  
  # Defaults to false
  # ignore_other_pvlan_mappings = true
}

It works how you would expect. The ignore_other_pvlan_mappings allows you to have unmanaged mappings that won't get overwritten. It also allows you to use the standalone mapping resources which I have implemented (vsphere_distributed_virtual_switch_pvlan_mapping). The standalone resource works in a similar way to the AWS provider route_table/route and security_group/security_group_rule. In order to get that to work I have added a global MutexKV object so that the DVS doesn't get reconfigured concurrently.

Feedback is welcome. At this stage, I just wanted to let people know that I've got some code I plan on sharing if possible.

Thanks

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@bill-rich
Copy link
Contributor

Hi @codeopen1! That looks like a good method of implementing this feature. Thanks for working on this, and let me know if you run into any problems or questions.

@tenthirtyam tenthirtyam changed the title distributed_virtual_switch additions Add support for additional features in vsphere_distributed_virtual_switch resource Feb 4, 2022
@tenthirtyam tenthirtyam added the acknowledged Status: Issue or Pull Request Acknowledged label Feb 4, 2022
@tenthirtyam tenthirtyam added the area/networking Area: Networking label Feb 22, 2022
@tenthirtyam
Copy link
Collaborator

PVLANs added in PR #1146.

If additional enhancements are required for r/vsphere_distributed_virtual_switch, please file separate enhancement requests.

Ryan Johnson
Staff II Solutions Architect | VMware, Inc.

@tenthirtyam tenthirtyam linked a pull request Mar 19, 2022 that will close this issue
10 tasks
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
acknowledged Status: Issue or Pull Request Acknowledged area/networking Area: Networking enhancement Type: Enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants