-
Notifications
You must be signed in to change notification settings - Fork 913
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
govc: support raw object references in import.ova NetworkMapping #1997
Conversation
@jtarchie can you review? |
I don't know enough to review the code. We are going test it against a live env to see if it resolves our issue. |
So user has to find the raw MO first? Is that possible this can be done by reference "distributed_switch/port_group_name" Only port group name is unique, while the distributed switch is unique |
@datianshi yes, see examples in #1996 In general, the inventory paths used by govmomi/govc are generic to the vCenter inventory hierarchy (https://blogs.vmware.com/vsphere/2012/05/introduction-to-the-vsphere-api-part-3-inventory-hierarchy.html) The paths are composed using parent/child relationships, regardless of type. The catch here is that switches and port groups are siblings in the vCenter inventory. It is possible we could make "distributed_switch/port_group_name" work in the long term, but the fallback to moref in this PR is more straightforward for the short term. |
@datianshi @jtarchie looking at this closer, I think we can make "distributed_switch/port_group_name" work without too much trouble. The native vSphere |
vCenter doesn't allow duplicate port group names within the network folder when creating via the UI or the AddDVPortgroupTask() API. However, NSXt 3.0 can do so via other (unknown) means. With this condition, govc would fail to map the given network name to its managed object reference. To workaround this, a raw MO ref can now be used in the NetworkMapping, instead of the Network name or inventory path. Related history: 223168f * Add NetworkMapping section to importx options. e3c3cd0 * Populate network mapping from ovf envelope (vmware#546) Fixes vmware#1996
While the native vSphere SearchIndex and ContainerView APIs don't support inventory paths with this structure, it is useful for use with NSXt3 where portgroup may not be unique within the same network inventory folder.
Added a new commit to support "distributed_switch/port_group_name". Using raw moref is still an option, but not required when switch name is included. |
vCenter doesn't allow duplicate port group names within the network folder when creating via the UI
or the AddDVPortgroupTask() API. However, NSXt 3.0 can do so via other (unknown) means. With this
condition, govc would fail to map the given network name to its managed object reference.
To workaround this, a raw MO ref can now be used in the NetworkMapping, instead of the Network name
or inventory path.
Related history:
223168f * Add NetworkMapping section to importx options.
e3c3cd0 * Populate network mapping from ovf envelope (#546)
Fixes #1996