VMware Networking Community
stanleycyk
Contributor
Contributor
Jump to solution

Can I change existing Logical Switch VXLAN ID using NSX API??

I tried to change VNI from 5002 to 5003, return code 200, but value not changed.... remains 5002.

PUT https://MyNsxMGR/api/2.0/vdn/virtualwires/virtualwire-2

<virtualWire>

<extendedAttributes/>

<vdnId>5003</vdnId>

<controlPlaneMode>UNICAST_MODE</controlPlaneMode>

</virtualWire>

  1. Status Code: 200 OK
  2. Cache-Control: private, no-cache
  3. Content-Type: application/xml
  4. Date: Wed, 17 May 2017 18:01:47 GMT
  5. Expires: Thu, 01 Jan 1970 00:00:00 GMT
  6. Strict-Transport-Security: max-age=31536000; includeSubDomains
  7. Transfer-Encoding: chunked
  8. X-Frame-Options: SAMEORIGIN
Reply
0 Kudos
1 Solution

Accepted Solutions
smitmartijn
VMware Employee
VMware Employee
Jump to solution

Hi Stanley,

You cannot change the VNI of a Logical Switch. As specified in the NSX API Guide (https://pubs.vmware.com/nsx-63/topic/com.vmware.ICbase/PDF/nsx_63_api.pdf  ) there is no vnId field, so the API ignored your input in your call and modified the fields that were accepted (which is why you got a 200 code).

Also why would you want to? It's an arbitrary ID which only serves purposes inside NSX/VXLAN itself. You don't have keep records, input it anywhere else. The only situation where you need that ID is if you were doing hardware VTEPs.

View solution in original post

Reply
0 Kudos
4 Replies
smitmartijn
VMware Employee
VMware Employee
Jump to solution

Hi Stanley,

You cannot change the VNI of a Logical Switch. As specified in the NSX API Guide (https://pubs.vmware.com/nsx-63/topic/com.vmware.ICbase/PDF/nsx_63_api.pdf  ) there is no vnId field, so the API ignored your input in your call and modified the fields that were accepted (which is why you got a 200 code).

Also why would you want to? It's an arbitrary ID which only serves purposes inside NSX/VXLAN itself. You don't have keep records, input it anywhere else. The only situation where you need that ID is if you were doing hardware VTEPs.

Reply
0 Kudos
SaurabhRV
Enthusiast
Enthusiast
Jump to solution

Logical Switch gets its vxlan vni or segment ID from (Segment ID pool). So its auto field and hence can not be modified, you can delete LS with specific VNI and that VNI gets reused as soon as you create new one.

in case of HWvTEP same vni is required by HwTunnel on your fabric or switch.

-Saurabh jain

Please consider marking this answer "correct" or "helpful" if you think your query have been answered correctly. http://www.linkedin.com/in/ saurabh-jain-a7b7bb9
Reply
0 Kudos
stanleycyk
Contributor
Contributor
Jump to solution

Thanks for the reply and yes, we are exploring to integrate with hardware VTEP and see what we could do to integrate. What we want to do is to assign different range of VNI to different tenants, such that we could preprovision everything at hardware VTEPs. It looks like we have no choice but follow whatever NSX created for us :smileycry:

Reply
0 Kudos
settlersoman
Contributor
Contributor
Jump to solution

Maybe it would be useful: https://www.settlersoman.com/ftf-008-how-to-enumerate-change-nsx-logical-switch-vni/

---------------------------------------------------------------------- If you find this or any other answer useful please mark the answer as correct or helpful. blog: http://www.settlersoman.com twitter: settlersoman
Reply
0 Kudos