Introduction
In this post we will take a look how we can use the Create Logical Switch vCenter Orchestrator (vCO)/vRealize Orchestrator (vRO) workflow to create a logical switch in NSX. The workflow is part of the NSX vSphere Plugin for vRO/vCO.
Lab Environment
The following environment has been used in all of the examples below:
- Active Directory Domain called vmware.com
- Windows Server 2012 R2 (with FQDN lan1dc1.vmware.com)
- Domain Controller
- DNS Server.
- PowerShell v4 Host.
- .NET 4 Framework installed (4.0.30319)
- Windows Server 2008 R2 SP1 (with FQDN lan1dm1.vmware.com)
- Domain Member
- PowerShell v3 Host.
- .NET 4 Framework installed (4.0.30319)
- vCO 5.5.2.0 Virtual Appliance (with FQDN vco-a-02.vmware.com)
- NSX vSphere Plugin (1.0.0)
- vCO 5.5.1.0 Virtual Appliance (with FQDN vco-a-01.vmware.com)
- vCO PowerShell Plugin installed (version 1.0.4.1736639)
The full lab logical design can be seen HERE.
Running the Create Logical Switch workflow
When you install the NSX vSphere Plugin for vRO/vCO you will find the Create Logical Switch workflow under [Workflows > library > NSX > NSX Workflows]
You need several required input parameters to run the workflow:
- NSX Endpoint: Select the NSX Endpoint. You must have an NSX endpoint configured. You can create/add an NSX Endpoint by running the [Workflows > library > NSX > Configuration > Create NSX Endpoint ] workflow .
- Transport zone id: The transport zone ID.
- Logical Switch Name: Name of the new logical switch
Let’s take a deeper look into the Transport zone id input parameter and how to find it. For the purpose of the lab I have created:
- 2 transport zones: Global-Transport-Zone, Test-Transport-Zone
- A LS-TestTransportZone logical switch connected to the Test-Transport-Zone zone and a bunch of other LS’s connected to the Global-Transport-Zone.
Now to find out the value for the input run the following get request:
GET https://<NSX_Manager_FQDN>/api/2.0/vdn/virtualwires
Note: Make sure you use authentication header and provide the credentials for the NSX Manager.
Your response body should look something like this:
<virtualWires>
<dataPage>
<pagingInfo>
<pageSize>20</pageSize>
<startIndex>0</startIndex>
<totalCount>6</totalCount>
<sortOrderAscending>true</sortOrderAscending>
</pagingInfo>
<virtualWire>
<objectId>virtualwire-11</objectId>
<objectTypeName>VirtualWire</objectTypeName>
<vsmUuid>4219BF6F-AA46-6F6D-C86A-0F2996AB7F4A</vsmUuid>
<revision>2</revision>
<type>
<typeName>VirtualWire</typeName>
</type>
<name>Transport-Network-01</name>
<description/>
<clientHandle/>
<extendedAttributes/>
<tenantId>virtual wire tenant</tenantId>
<vdnScopeId>vdnscope-2</vdnScopeId>
<vdsContextWithBacking>
<switch>
<objectId>dvs-16</objectId>
<objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName>
<vsmUuid>4219BF6F-AA46-6F6D-C86A-0F2996AB7F4A</vsmUuid>
<revision>53</revision>
<type>
<typeName>VmwareDistributedVirtualSwitch</typeName>
</type>
<name>vDS_MGMT</name>
<scope>
<id>datacenter-2</id>
<objectTypeName>Datacenter</objectTypeName>
<name>Datacenter A</name>
</scope>
<clientHandle/>
<extendedAttributes/>
</switch>
<mtu>1600</mtu>
<promiscuousMode>false</promiscuousMode>
<backingType>portgroup</backingType>
<backingValue>dvportgroup-106</backingValue>
</vdsContextWithBacking>
<vdnId>5000</vdnId>
<guestVlanAllowed>false</guestVlanAllowed>
<controlPlaneMode>UNICAST_MODE</controlPlaneMode>
</virtualWire>
<virtualWire>
<objectId>virtualwire-12</objectId>
<objectTypeName>VirtualWire</objectTypeName>
<vsmUuid>4219BF6F-AA46-6F6D-C86A-0F2996AB7F4A</vsmUuid>
<revision>2</revision>
<type>
<typeName>VirtualWire</typeName>
</type>
<name>Web-Tier-01</name>
<description/>
<clientHandle/>
<extendedAttributes/>
<tenantId>virtual wire tenant</tenantId>
<vdnScopeId>vdnscope-2</vdnScopeId>
<vdsContextWithBacking>
<switch>
<objectId>dvs-16</objectId>
<objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName>
<vsmUuid>4219BF6F-AA46-6F6D-C86A-0F2996AB7F4A</vsmUuid>
<revision>53</revision>
<type>
<typeName>VmwareDistributedVirtualSwitch</typeName>
</type>
<name>vDS_MGMT</name>
<scope>
<id>datacenter-2</id>
<objectTypeName>Datacenter</objectTypeName>
<name>Datacenter A</name>
</scope>
<clientHandle/>
<extendedAttributes/>
</switch>
<mtu>1600</mtu>
<promiscuousMode>false</promiscuousMode>
<backingType>portgroup</backingType>
<backingValue>dvportgroup-107</backingValue>
</vdsContextWithBacking>
<vdnId>5001</vdnId>
<guestVlanAllowed>false</guestVlanAllowed>
<controlPlaneMode>UNICAST_MODE</controlPlaneMode>
</virtualWire>
<virtualWire>
<objectId>virtualwire-13</objectId>
<objectTypeName>VirtualWire</objectTypeName>
<vsmUuid>4219BF6F-AA46-6F6D-C86A-0F2996AB7F4A</vsmUuid>
<revision>2</revision>
<type>
<typeName>VirtualWire</typeName>
</type>
<name>App-Tier-01</name>
<description/>
<clientHandle/>
<extendedAttributes/>
<tenantId>virtual wire tenant</tenantId>
<vdnScopeId>vdnscope-2</vdnScopeId>
<vdsContextWithBacking>
<switch>
<objectId>dvs-16</objectId>
<objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName>
<vsmUuid>4219BF6F-AA46-6F6D-C86A-0F2996AB7F4A</vsmUuid>
<revision>53</revision>
<type>
<typeName>VmwareDistributedVirtualSwitch</typeName>
</type>
<name>vDS_MGMT</name>
<scope>
<id>datacenter-2</id>
<objectTypeName>Datacenter</objectTypeName>
<name>Datacenter A</name>
</scope>
<clientHandle/>
<extendedAttributes/>
</switch>
<mtu>1600</mtu>
<promiscuousMode>false</promiscuousMode>
<backingType>portgroup</backingType>
<backingValue>dvportgroup-108</backingValue>
</vdsContextWithBacking>
<vdnId>5002</vdnId>
<guestVlanAllowed>false</guestVlanAllowed>
<controlPlaneMode>UNICAST_MODE</controlPlaneMode>
</virtualWire>
<virtualWire>
<objectId>virtualwire-14</objectId>
<objectTypeName>VirtualWire</objectTypeName>
<vsmUuid>4219BF6F-AA46-6F6D-C86A-0F2996AB7F4A</vsmUuid>
<revision>2</revision>
<type>
<typeName>VirtualWire</typeName>
</type>
<name>DB-Tier-01</name>
<description/>
<clientHandle/>
<extendedAttributes/>
<tenantId>virtual wire tenant</tenantId>
<vdnScopeId>vdnscope-2</vdnScopeId>
<vdsContextWithBacking>
<switch>
<objectId>dvs-16</objectId>
<objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName>
<vsmUuid>4219BF6F-AA46-6F6D-C86A-0F2996AB7F4A</vsmUuid>
<revision>53</revision>
<type>
<typeName>VmwareDistributedVirtualSwitch</typeName>
</type>
<name>vDS_MGMT</name>
<scope>
<id>datacenter-2</id>
<objectTypeName>Datacenter</objectTypeName>
<name>Datacenter A</name>
</scope>
<clientHandle/>
<extendedAttributes/>
</switch>
<mtu>1600</mtu>
<promiscuousMode>false</promiscuousMode>
<backingType>portgroup</backingType>
<backingValue>dvportgroup-109</backingValue>
</vdsContextWithBacking>
<vdnId>5003</vdnId>
<guestVlanAllowed>false</guestVlanAllowed>
<controlPlaneMode>UNICAST_MODE</controlPlaneMode>
</virtualWire>
<virtualWire>
<objectId>virtualwire-25</objectId>
<objectTypeName>VirtualWire</objectTypeName>
<vsmUuid>4219BF6F-AA46-6F6D-C86A-0F2996AB7F4A</vsmUuid>
<revision>3</revision>
<type>
<typeName>VirtualWire</typeName>
</type>
<name>Load-Balancer-Tier-01</name>
<description/>
<clientHandle/>
<extendedAttributes/>
<tenantId>virtual wire tenant</tenantId>
<vdnScopeId>vdnscope-2</vdnScopeId>
<vdsContextWithBacking>
<switch>
<objectId>dvs-16</objectId>
<objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName>
<vsmUuid>4219BF6F-AA46-6F6D-C86A-0F2996AB7F4A</vsmUuid>
<revision>53</revision>
<type>
<typeName>VmwareDistributedVirtualSwitch</typeName>
</type>
<name>vDS_MGMT</name>
<scope>
<id>datacenter-2</id>
<objectTypeName>Datacenter</objectTypeName>
<name>Datacenter A</name>
</scope>
<clientHandle/>
<extendedAttributes/>
</switch>
<mtu>1600</mtu>
<promiscuousMode>false</promiscuousMode>
<backingType>portgroup</backingType>
<backingValue>dvportgroup-175</backingValue>
</vdsContextWithBacking>
<vdnId>5006</vdnId>
<guestVlanAllowed>false</guestVlanAllowed>
<controlPlaneMode>UNICAST_MODE</controlPlaneMode>
</virtualWire>
<virtualWire>
<objectId>virtualwire-28</objectId>
<objectTypeName>VirtualWire</objectTypeName>
<vsmUuid>4219BF6F-AA46-6F6D-C86A-0F2996AB7F4A</vsmUuid>
<revision>2</revision>
<type>
<typeName>VirtualWire</typeName>
</type>
<name>LS-TestTransportZone</name>
<description/>
<clientHandle/>
<extendedAttributes/>
<tenantId>virtual wire tenant</tenantId>
<vdnScopeId>vdnscope-3</vdnScopeId>
<vdsContextWithBacking>
<switch>
<objectId>dvs-16</objectId>
<objectTypeName>VmwareDistributedVirtualSwitch</objectTypeName>
<vsmUuid>4219BF6F-AA46-6F6D-C86A-0F2996AB7F4A</vsmUuid>
<revision>53</revision>
<type>
<typeName>VmwareDistributedVirtualSwitch</typeName>
</type>
<name>vDS_MGMT</name>
<scope>
<id>datacenter-2</id>
<objectTypeName>Datacenter</objectTypeName>
<name>Datacenter A</name>
</scope>
<clientHandle/>
<extendedAttributes/>
</switch>
<mtu>1600</mtu>
<promiscuousMode>false</promiscuousMode>
<backingType>portgroup</backingType>
<backingValue>dvportgroup-302</backingValue>
</vdsContextWithBacking>
<vdnId>5005</vdnId>
<guestVlanAllowed>false</guestVlanAllowed>
<controlPlaneMode>UNICAST_MODE</controlPlaneMode>
</virtualWire>
</dataPage>
</virtualWires>
You can see the configuration of all virtual wires listed. What we are interested in is the vdsScopeID value .
This is the value you must provide in the Transport zone id filed in the Create Logical Switch workflow.
In this case the vdsScopeID value is vdnscope-2. This is taken from the configuration of a logical switch which is connected to my Global-Transport-Zone. This Is the first Transport Zone I’ve created in NSX. So find a switch which you have already created and attached to the transport zone where you want to create a new switch and take the vdnScopeID value from there. If you have only one Transport Zone value should be the same. For every new transport zone value increments, for example: vdnscope-3 (2nd Transport Zone), vdnscope-4 (3rd Transport Zone), ect..
In my case I have a LS-TestTransportZone attached to the second Transport Zone I’ve created which is Test-Transport-Zone. If I query the configuration of the LS, I see that it is associated with vdnScopeID (or Transport Zone): dnscope-3:
If you do not enter correct value to the Transport Zone id filed you will receive error similar to the following in vRO:
[I] VSM response error (202): The requested object : <MyTransprotZone> could not be found. Object identifiers are case sensitive. (Workflow:Create logical switch / Scriptable task (item1)#4)
DISCLAIMER; This is a personal blog. Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated. Any views or opinions are not intended to malign any religion, ethnic group, club, organization, company, or individual.
All content provided on this blog is for informational purposes only. The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site. The owner will not be liable for any errors or omissions in this information nor for the availability of this information. The owner will not be liable for any losses, injuries, or damages from the display or use of this information.
Photos
Unless stated, all photos are the work of the blog owner and are licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License. If used with watermark, no need to credit to the blog owner. For any edit to photos, including cropping, please contact me first.
Recipes
Unless stated, all recipes are the work of the blog owner and are licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License. Please credit all recipes to the blog owner and link back to the original blog post.
Downloadable Files
Any downloadable file, including but not limited to pdfs, docs, jpegs, pngs, is provided at the user’s own risk. The owner will not be liable for any losses, injuries, or damages resulting from a corrupted or damaged file.
Comments
Comments are welcome. However, the blog owner reserves the right to edit or delete any comments submitted to this blog without notice due to
– Comments deemed to be spam or questionable spam
– Comments including profanity
– Comments containing language or concepts that could be deemed offensive
– Comments containing hate speech, credible threats, or direct attacks on an individual or group
The blog owner is not responsible for the content in comments.
This policy is subject to change at anytime.