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

Support finding Portgroups by ID in Finder.Network #2626

Merged
merged 1 commit into from
Oct 19, 2021

Conversation

dougm
Copy link
Member

@dougm dougm commented Oct 15, 2021

Description

With standard vSphere networking, Portgroups cannot have the same name within the same network folder.
With NSX, Portgroups can have the same name, even within the same Switch. In this case, using an inventory path
results in a MultipleFoundError. A MOID, switch UUID or segment ID can be used instead, as both are unique.

  • Add ContainerView.FindAny method
  • Add nsx backing and SegmentId defaults to the simulator for testing
  • Add simulator support for renaming a Portgroup, only allowing nsx to have duplicate names

Note that applications using Finder.Network do not require any code changes to use this functionality. Only the go module dependency needs to be bumped to include this change.

Type of change

Please mark options that are relevant:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update
  • Build related change

How Has This Been Tested?

  • Added TestFindNetwork that uses Finder.Network with MOID, Switch UUID and Segment ID
  • Added govc tests using the -net flags with MOID, Switch UUID and Segment ID

Checklist:

  • My code follows the CONTRIBUTION guidelines of
    this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

With standard vSphere networking, Portgroups cannot have the same name within the same network folder.
With NSX, Portgroups can have the same name, even within the same Switch. In this case, using an inventory path
results in a MultipleFoundError. A MOID, switch UUID or segment ID can be used instead, as both are unique.

- Add ContainerView.FindAny method
- Add nsx backing and SegmentId defaults to the simulator for testing
- Add simulator support for renaming a Portgroup, only allowing nsx to have duplicate names
Copy link

@saimanoj01 saimanoj01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Thanks a lot for the quick fix.

@dougm dougm merged commit d99e995 into vmware:master Oct 19, 2021
@dougm dougm deleted the network-find branch October 19, 2021 00:37
dougm added a commit to dougm/govmomi that referenced this pull request Feb 8, 2023
Rather than limit by ID search to find.Network, move the logic to NetworkList to support both methods.

Add finder_test (meant to include with PR vmware#2626)
dougm added a commit to dougm/govmomi that referenced this pull request Feb 8, 2023
Rather than limit by ID search to find.Network, move the logic to NetworkList to support both methods.

Add finder_test (meant to include with PR vmware#2626)
dougm added a commit to dougm/govmomi that referenced this pull request Feb 8, 2023
Rather than limit by ID search to find.Network, move the logic to NetworkList to support both methods.

Add finder_test (meant to include with PR vmware#2626)
dougm added a commit that referenced this pull request Mar 16, 2023
Rather than limit by ID search to find.Network, move the logic to NetworkList to support both methods.

Add finder_test (meant to include with PR #2626)
priyanka19-98 pushed a commit to priyanka19-98/govmomi that referenced this pull request Jan 17, 2024
Rather than limit by ID search to find.Network, move the logic to NetworkList to support both methods.

Add finder_test (meant to include with PR vmware#2626)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants