-
Notifications
You must be signed in to change notification settings - Fork 928
Closed
Labels
Milestone
Description
Describe the bug
When FetchDVPorts
is requested to vcsim, criteria
field is ignored and all ports are responded
To Reproduce
Steps to reproduce the behavior:
- Start vcsim
- Request
FetchDVPorts
with criteria as below
var vCenterURL = "https://user:[email protected]:8989/sdk"
func main() {
ctx := context.TODO()
url, _ := url.Parse(vCenterURL)
c, _ := govmomi.NewClient(ctx, url, true)
f := find.NewFinder(c.Client)
n, _ := f.Network(ctx, "/DC0/network/DVS0")
dvs := object.NewDistributedVirtualSwitch(c.Client, n.Reference())
criteria := &types.DistributedVirtualSwitchPortCriteria{
PortgroupKey: []string{"dvportgroup-11"},
Inside: types.NewBool(true),
}
ports, err := dvs.FetchDVPorts(ctx, criteria)
if err != nil {
fmt.Printf("%+v\n", err)
return
}
for _, port := range ports {
fmt.Printf("key: %s, portgroupKey: %s\n", port.Key, port.PortgroupKey)
}
}
Expected behavior
A clear and concise description of what you expected to happen.
- vcsim responds only ports that belong to portgroups specified in the criteria
> go run main.go
key: 0, portgroupKey: dvportgroup-11
Affected version
Please provide details on the version used, e.g. release tag, commit, module version, etc.
- vcsim 0.27.2
Screenshots/Debug Output
If applicable, add screenshots or debug output to help explain your problem.
- vcsim responds all ports in the DVS
> go run main.go
key: dvportgroup-11, portgroupKey:
key: dvportgroup-13, portgroupKey:
Additional context
Add any other context about the problem here.
- In addition to the criteria issue, portgroupKey and portKey seems to be misplaced (as reported in [BUG] vcsim: portgroupKey and key in DistributedVirtualPorts are mistaken #2726).