You can create a segment on an on-prem NSX server system by using the Invoke-PatchInfraSegment cmdlet.

To create an on-prem (flexible) segment, you must specify a transport zone and assign a subnet.

Prerequisites

  • Verify that you are connected to an on-prem NSX server system.

  • Verify that your system has Tier-1 gateway(s).

Procedure

  1. Retrieve transport zone details.
    $tzs = Invoke-ListTransportZonesForEnforcementPoint -EnforcementpointId default -SiteId default
    $tz = $tzs.Results | where {$_.DisplayName -eq $TransportZone}
  2. Prepare the input for the segment subnet.
    $segmentSubnet = Initialize-SegmentSubnet -GatewayAddress $GatewayCIDR
  3. Retrieve the Tier-1 paths.
    $t1s = Invoke-ListTier1
    $t1 = $t1s.Results | where {$_.DisplayName -eq $T1GatewayName}
  4. Prepare the input for the segment.
    $segment = Initialize-Segment -DisplayName $SegmentName -TransportZonePath $tz.Path `
               -Subnets $segmentSubnet -ConnectivityPath $t1.Path
  5. Invoke the operation.
    Invoke-PatchInfraSegment -Segment $segment -SegmentId $SegmentName