{"action":"created","issue":{"url":"https://api.github.com/repos/vmware/govmomi/issues/467","repository_url":"https://api.github.com/repos/vmware/govmomi","labels_url":"https://api.github.com/repos/vmware/govmomi/issues/467/labels{/name}","comments_url":"https://api.github.com/repos/vmware/govmomi/issues/467/comments","events_url":"https://api.github.com/repos/vmware/govmomi/issues/467/events","html_url":"https://github.com/vmware/govmomi/issues/467","id":141138245,"number":467,"title":"Best way to create a VM and bind an un-used dvs portgroup port?","user":{"login":"eyz","id":4591181,"avatar_url":"https://avatars.githubusercontent.com/u/4591181?v=3","gravatar_id":"","url":"https://api.github.com/users/eyz","html_url":"https://github.com/eyz","followers_url":"https://api.github.com/users/eyz/followers","following_url":"https://api.github.com/users/eyz/following{/other_user}","gists_url":"https://api.github.com/users/eyz/gists{/gist_id}","starred_url":"https://api.github.com/users/eyz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyz/subscriptions","organizations_url":"https://api.github.com/users/eyz/orgs","repos_url":"https://api.github.com/users/eyz/repos","events_url":"https://api.github.com/users/eyz/events{/privacy}","received_events_url":"https://api.github.com/users/eyz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-16T00:42:51Z","updated_at":"2016-03-18T21:52:11Z","closed_at":"2016-03-18T21:52:11Z","body":"I plan to obtain an un-used port from a dvs portgroup and assign it to an interface on a new VM. I'd like to know if anyone can think of any gotchas regarding how to ensure the port isn't taken while the VM is being created.\r\n\r\nI see that most CRUD is being done in a task queue, but I'm not sure if there is anything other than checking for failures on the network interface / port binding that would prevent collisions on allocation of the port.\r\n\r\nThoughts?\r\n\r\nFor some reference, see the new [dvs.portgroup.info](https://github.com/eyz/govmomi/blob/dvs-enhancements/govc/dvs/portgroup/info.go) I am working on"},"comment":{"url":"https://api.github.com/repos/vmware/govmomi/issues/comments/198558684","html_url":"https://github.com/vmware/govmomi/issues/467#issuecomment-198558684","issue_url":"https://api.github.com/repos/vmware/govmomi/issues/467","id":198558684,"user":{"login":"eyz","id":4591181,"avatar_url":"https://avatars.githubusercontent.com/u/4591181?v=3","gravatar_id":"","url":"https://api.github.com/users/eyz","html_url":"https://github.com/eyz","followers_url":"https://api.github.com/users/eyz/followers","following_url":"https://api.github.com/users/eyz/following{/other_user}","gists_url":"https://api.github.com/users/eyz/gists{/gist_id}","starred_url":"https://api.github.com/users/eyz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eyz/subscriptions","organizations_url":"https://api.github.com/users/eyz/orgs","repos_url":"https://api.github.com/users/eyz/repos","events_url":"https://api.github.com/users/eyz/events{/privacy}","received_events_url":"https://api.github.com/users/eyz/received_events","type":"User","site_admin":false},"created_at":"2016-03-18T21:52:11Z","updated_at":"2016-03-18T21:52:11Z","body":"I found that the PortKey is not required, and on VM creation an unavailable port will be allocated, so the FetchDVPorts search is not needed, and thus there is no known race condition this code needs to deal with. Closing again"}}