{"action":"created","comment":{"url":"https://api.github.com/repos/apache/cloudstack/pulls/comments/45038549","id":45038549,"diff_hunk":"@@ -2076,6 +2087,9 @@ private static void postNvpConfigBeforeStart(VirtualMachineMO vmMo, VirtualMachi\n                 } else if (backing instanceof VirtualEthernetCardNetworkBackingInfo) {\n                     // This NIC is connected to a Virtual Switch\n                     // Nothing to do\n+                } else if (backing instanceof VirtualEthernetCardOpaqueNetworkBackingInfo) {\n+                    //if NSX API VERSION >= 4.2, connect to br-int (nsx.network), do not create portgroup else previous behaviour\n+                    //OK, connected to OpaqueNetwork","path":"plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java","position":72,"original_position":72,"commit_id":"b20c5be1ce0be945485f6dfae92ade91460f411a","original_commit_id":"b20c5be1ce0be945485f6dfae92ade91460f411a","user":{"login":"wilderrodrigues","id":5129209,"avatar_url":"https://avatars.githubusercontent.com/u/5129209?v=3","gravatar_id":"","url":"https://api.github.com/users/wilderrodrigues","html_url":"https://github.com/wilderrodrigues","followers_url":"https://api.github.com/users/wilderrodrigues/followers","following_url":"https://api.github.com/users/wilderrodrigues/following{/other_user}","gists_url":"https://api.github.com/users/wilderrodrigues/gists{/gist_id}","starred_url":"https://api.github.com/users/wilderrodrigues/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilderrodrigues/subscriptions","organizations_url":"https://api.github.com/users/wilderrodrigues/orgs","repos_url":"https://api.github.com/users/wilderrodrigues/repos","events_url":"https://api.github.com/users/wilderrodrigues/events{/privacy}","received_events_url":"https://api.github.com/users/wilderrodrigues/received_events","type":"User","site_admin":false},"body":"Those 2 else/if blocks should contain some logging in order to inform sys admins what is now comments in the code.\r\n\r\nYou can keep it for now, because it doesn't affect the feature that @miguelaferreira has already tested. Once this PR is merged, we can fix it.","created_at":"2015-11-17T09:38:45Z","updated_at":"2015-11-17T09:38:45Z","html_url":"https://github.com/apache/cloudstack/pull/935#discussion_r45038549","pull_request_url":"https://api.github.com/repos/apache/cloudstack/pulls/935","_links":{"self":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/comments/45038549"},"html":{"href":"https://github.com/apache/cloudstack/pull/935#discussion_r45038549"},"pull_request":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/935"}}},"pull_request":{"url":"https://api.github.com/repos/apache/cloudstack/pulls/935","id":47828615,"html_url":"https://github.com/apache/cloudstack/pull/935","diff_url":"https://github.com/apache/cloudstack/pull/935.diff","patch_url":"https://github.com/apache/cloudstack/pull/935.patch","issue_url":"https://api.github.com/repos/apache/cloudstack/issues/935","number":935,"state":"open","locked":false,"title":"CLOUDSTACK-8956: NSX/Nicira Plugin does not support NSX v4.2.1","user":{"login":"nvazquez","id":5295080,"avatar_url":"https://avatars.githubusercontent.com/u/5295080?v=3","gravatar_id":"","url":"https://api.github.com/users/nvazquez","html_url":"https://github.com/nvazquez","followers_url":"https://api.github.com/users/nvazquez/followers","following_url":"https://api.github.com/users/nvazquez/following{/other_user}","gists_url":"https://api.github.com/users/nvazquez/gists{/gist_id}","starred_url":"https://api.github.com/users/nvazquez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvazquez/subscriptions","organizations_url":"https://api.github.com/users/nvazquez/orgs","repos_url":"https://api.github.com/users/nvazquez/repos","events_url":"https://api.github.com/users/nvazquez/events{/privacy}","received_events_url":"https://api.github.com/users/nvazquez/received_events","type":"User","site_admin":false},"body":"JIRA Ticket: https://issues.apache.org/jira/browse/CLOUDSTACK-8956\r\n\r\n### Description of the problem:\r\nPrior to version 4.2. Nicira/VmWare NSX used a variation of Open vSwitch as means of integrating SDN into hypervisor layer. Cloudstack NiciraNVP plugin was written to support OVS as a bridge to NSX.\r\nIn version 4.2 VMware introduced NSX vSwitch as a replacement for OVS in ESX hypervisors. It is a fork of distributed vSwitch leveraging one of the recent features of ESX called opaque networks. Because of that change the current version of NiciraNVP plugin doesn’t support versions of NSX-MH above 4.2 specifically in Vsphere environment. Proposed fix will analyze a version of NVP/NSX API and use proper support for ESX hypervisors.\r\n\r\nvSphere hypervisor mode operations when NV is deployed onto NSX managed network changes:\r\n* Current mode. A portgroup = UUID of CS VM NIC is created on a local standard switch of the Hypervisor where VM is starting. VM nic is attached to that port group.\r\n* New mode. No additional port group is created on a HW. No port group cleanup is needed after VM/NIC is destroyed. VM is attached to 1st port group having the following attributes:\r\n** opaqueNetworkId string \"br-int”\r\n** opaqueNetworkType string \"nsx.network\"\r\n\r\nIf portgroup with such attributes is not found a deployment should fail with exception.\r\n\r\n### VMware vSphere API version from 5.1 to 5.5:\r\nSince vSphere API version 5.5, [OpaqueNetworks](https://www.vmware.com/support/developer/converter-sdk/conv55_apireference/vim.OpaqueNetwork.html) are introduced. \r\nIts description says: \r\n> This interface defines an opaque network, in the sense that the detail and configuration of the network is unknown to vShpere and is managed by a management plane outside of vSphere. However, the identifier and name of these networks is made available to vSphere so that host and virtual machine virtual ethernet device can connect to them.\r\n\r\nIn order to connect a vm's virtual ethernet device to the proper opaque network when deploying a vm into a NSX managed network, we first need to look for a particular opaque network on hosts. This opaque network's id has to be **\"br-int\"** and its type **\"nsx.network\"**.\r\n\r\nSince vSphere API version 5.5 [HostNetworkInfo](https://www.vmware.com/support/developer/converter-sdk/conv55_apireference/vim.host.NetworkInfo.html#opaqueNetwork) introduces a list of available opaque networks for each host. \r\nIf NSX API version >= 4.2 we look for a [OpaqueNetworkInfo](https://www.vmware.com/support/developer/converter-sdk/conv55_apireference/vim.host.OpaqueNetworkInfo.html) which satisfies:\r\n* opaqueNetworkId = \"br-int\"\r\n* opaqueNetworkType = \"nsx.netork\"\r\n\r\nIf that opaque network is found, then we need to attach vm's NIC to a virtual ethernet device which support this, so we use [VirtualEthernetCardOpaqueNetworkBackingInfo](https://www.vmware.com/support/developer/converter-sdk/conv55_apireference/vim.vm.device.VirtualEthernetCard.OpaqueNetworkBackingInfo.html) setting:\r\n* opaqueNetworkId = \"br-int\"\r\n* opaqueNetworkType = \"nsx.netork\"","created_at":"2015-10-15T19:11:17Z","updated_at":"2015-11-17T09:38:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fbfd60395ce50bedec4dc502cb70798e1ca9174f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/cloudstack/pulls/935/commits","review_comments_url":"https://api.github.com/repos/apache/cloudstack/pulls/935/comments","review_comment_url":"https://api.github.com/repos/apache/cloudstack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/cloudstack/issues/935/comments","statuses_url":"https://api.github.com/repos/apache/cloudstack/statuses/b20c5be1ce0be945485f6dfae92ade91460f411a","head":{"label":"nvazquez:from4.5.1","ref":"from4.5.1","sha":"b20c5be1ce0be945485f6dfae92ade91460f411a","user":{"login":"nvazquez","id":5295080,"avatar_url":"https://avatars.githubusercontent.com/u/5295080?v=3","gravatar_id":"","url":"https://api.github.com/users/nvazquez","html_url":"https://github.com/nvazquez","followers_url":"https://api.github.com/users/nvazquez/followers","following_url":"https://api.github.com/users/nvazquez/following{/other_user}","gists_url":"https://api.github.com/users/nvazquez/gists{/gist_id}","starred_url":"https://api.github.com/users/nvazquez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvazquez/subscriptions","organizations_url":"https://api.github.com/users/nvazquez/orgs","repos_url":"https://api.github.com/users/nvazquez/repos","events_url":"https://api.github.com/users/nvazquez/events{/privacy}","received_events_url":"https://api.github.com/users/nvazquez/received_events","type":"User","site_admin":false},"repo":{"id":40547252,"name":"cloudstack","full_name":"nvazquez/cloudstack","owner":{"login":"nvazquez","id":5295080,"avatar_url":"https://avatars.githubusercontent.com/u/5295080?v=3","gravatar_id":"","url":"https://api.github.com/users/nvazquez","html_url":"https://github.com/nvazquez","followers_url":"https://api.github.com/users/nvazquez/followers","following_url":"https://api.github.com/users/nvazquez/following{/other_user}","gists_url":"https://api.github.com/users/nvazquez/gists{/gist_id}","starred_url":"https://api.github.com/users/nvazquez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvazquez/subscriptions","organizations_url":"https://api.github.com/users/nvazquez/orgs","repos_url":"https://api.github.com/users/nvazquez/repos","events_url":"https://api.github.com/users/nvazquez/events{/privacy}","received_events_url":"https://api.github.com/users/nvazquez/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nvazquez/cloudstack","description":"Mirror of Apache Cloudstack","fork":true,"url":"https://api.github.com/repos/nvazquez/cloudstack","forks_url":"https://api.github.com/repos/nvazquez/cloudstack/forks","keys_url":"https://api.github.com/repos/nvazquez/cloudstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nvazquez/cloudstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nvazquez/cloudstack/teams","hooks_url":"https://api.github.com/repos/nvazquez/cloudstack/hooks","issue_events_url":"https://api.github.com/repos/nvazquez/cloudstack/issues/events{/number}","events_url":"https://api.github.com/repos/nvazquez/cloudstack/events","assignees_url":"https://api.github.com/repos/nvazquez/cloudstack/assignees{/user}","branches_url":"https://api.github.com/repos/nvazquez/cloudstack/branches{/branch}","tags_url":"https://api.github.com/repos/nvazquez/cloudstack/tags","blobs_url":"https://api.github.com/repos/nvazquez/cloudstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nvazquez/cloudstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nvazquez/cloudstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/nvazquez/cloudstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nvazquez/cloudstack/statuses/{sha}","languages_url":"https://api.github.com/repos/nvazquez/cloudstack/languages","stargazers_url":"https://api.github.com/repos/nvazquez/cloudstack/stargazers","contributors_url":"https://api.github.com/repos/nvazquez/cloudstack/contributors","subscribers_url":"https://api.github.com/repos/nvazquez/cloudstack/subscribers","subscription_url":"https://api.github.com/repos/nvazquez/cloudstack/subscription","commits_url":"https://api.github.com/repos/nvazquez/cloudstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/nvazquez/cloudstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/nvazquez/cloudstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/nvazquez/cloudstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/nvazquez/cloudstack/contents/{+path}","compare_url":"https://api.github.com/repos/nvazquez/cloudstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nvazquez/cloudstack/merges","archive_url":"https://api.github.com/repos/nvazquez/cloudstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nvazquez/cloudstack/downloads","issues_url":"https://api.github.com/repos/nvazquez/cloudstack/issues{/number}","pulls_url":"https://api.github.com/repos/nvazquez/cloudstack/pulls{/number}","milestones_url":"https://api.github.com/repos/nvazquez/cloudstack/milestones{/number}","notifications_url":"https://api.github.com/repos/nvazquez/cloudstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nvazquez/cloudstack/labels{/name}","releases_url":"https://api.github.com/repos/nvazquez/cloudstack/releases{/id}","created_at":"2015-08-11T14:42:21Z","updated_at":"2015-08-11T14:42:44Z","pushed_at":"2015-11-16T19:31:28Z","git_url":"git://github.com/nvazquez/cloudstack.git","ssh_url":"git@github.com:nvazquez/cloudstack.git","clone_url":"https://github.com/nvazquez/cloudstack.git","svn_url":"https://github.com/nvazquez/cloudstack","homepage":null,"size":496409,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"ea7c2d95b28e442df64607e914f66bd4517f2e03","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":9759448,"name":"cloudstack","full_name":"apache/cloudstack","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/cloudstack","description":"Mirror of Apache Cloudstack","fork":false,"url":"https://api.github.com/repos/apache/cloudstack","forks_url":"https://api.github.com/repos/apache/cloudstack/forks","keys_url":"https://api.github.com/repos/apache/cloudstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/cloudstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/cloudstack/teams","hooks_url":"https://api.github.com/repos/apache/cloudstack/hooks","issue_events_url":"https://api.github.com/repos/apache/cloudstack/issues/events{/number}","events_url":"https://api.github.com/repos/apache/cloudstack/events","assignees_url":"https://api.github.com/repos/apache/cloudstack/assignees{/user}","branches_url":"https://api.github.com/repos/apache/cloudstack/branches{/branch}","tags_url":"https://api.github.com/repos/apache/cloudstack/tags","blobs_url":"https://api.github.com/repos/apache/cloudstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/cloudstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/cloudstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/cloudstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/cloudstack/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/cloudstack/languages","stargazers_url":"https://api.github.com/repos/apache/cloudstack/stargazers","contributors_url":"https://api.github.com/repos/apache/cloudstack/contributors","subscribers_url":"https://api.github.com/repos/apache/cloudstack/subscribers","subscription_url":"https://api.github.com/repos/apache/cloudstack/subscription","commits_url":"https://api.github.com/repos/apache/cloudstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/cloudstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/cloudstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/cloudstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/cloudstack/contents/{+path}","compare_url":"https://api.github.com/repos/apache/cloudstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/cloudstack/merges","archive_url":"https://api.github.com/repos/apache/cloudstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/cloudstack/downloads","issues_url":"https://api.github.com/repos/apache/cloudstack/issues{/number}","pulls_url":"https://api.github.com/repos/apache/cloudstack/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/cloudstack/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/cloudstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/cloudstack/labels{/name}","releases_url":"https://api.github.com/repos/apache/cloudstack/releases{/id}","created_at":"2013-04-29T22:27:12Z","updated_at":"2015-11-17T09:37:08Z","pushed_at":"2015-11-17T09:19:49Z","git_url":"git://github.com/apache/cloudstack.git","ssh_url":"git@github.com:apache/cloudstack.git","clone_url":"https://github.com/apache/cloudstack.git","svn_url":"https://github.com/apache/cloudstack","homepage":null,"size":504424,"stargazers_count":315,"watchers_count":315,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":399,"mirror_url":"git://git.apache.org/cloudstack.git","open_issues_count":133,"forks":399,"open_issues":133,"watchers":315,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/935"},"html":{"href":"https://github.com/apache/cloudstack/pull/935"},"issue":{"href":"https://api.github.com/repos/apache/cloudstack/issues/935"},"comments":{"href":"https://api.github.com/repos/apache/cloudstack/issues/935/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/935/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/935/commits"},"statuses":{"href":"https://api.github.com/repos/apache/cloudstack/statuses/b20c5be1ce0be945485f6dfae92ade91460f411a"}}}}