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)
include TEMPLATEPATH."/../../../itBlogDisclaimer.php"; ?>