VMware NSX-T Data Center 3.x
VMware NSX-T Data Center 4.x
VMware NSX
Stale ports may arise in an environment for different reasons, automatic handled is planned for a future version.
This is a known issue currently there is no resolution.
Workaround:
On NSX 3.2.1.x or above
1. Before proceeding, you must take an FTP based backup of the NSX Manager and ensure the passphrase is known
2. On 1 NSX Manager, copy the attached file, logical-migration.jar, to the location /opt/vmware/upgrade-coordinator-tomcat/temp/
3. Run the script in read only mode first to see if it identifies stale logical ports (-DStaleLogicalPortCleanUp.dryRun=true). Ensure you edit the user password in the field -DStaleLogicalPortCleanUp.password='AdminPassword'
#java -Xms5g -Xmx10g -Dcorfu-property-file-path=/opt/vmware/upgrade-coordinator-tomcat/conf/ufo-factory.properties -Djava.io.tmpdir=/opt/vmware/upgrade-coordinator-tomcat/temp -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
-Dlog4j.configurationFile=/opt/vmware/upgrade-coordinator-tomcat/conf/log4j2.xml -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/opt/vmware/upgrade-coordinator-tomcat/conf/logging.properties -Dnsx-service-type=nsx-manager -DStaleLogicalPortCleanUp.dryRun=true -DStaleLogicalPortCleanUp.userName=admin -DStaleLogicalPortCleanUp.password='AdminPassword' -DStaleLogicalPortCleanUp.maxThreads=5 -DStaleLogicalPortCleanUp.batchSize=20 -DStaleLogicalPortCleanUp.maxTimeoutMinutes=30 -cp /opt/vmware/upgrade-coordinator-tomcat/temp/logical-migration.jar com.vmware.nsx.management.migration.impl.StaleLogicalPortCleanUp
4. After identifying the stale logical ports, run the script again without the dry run flag to allow it to remove the stale logical ports(where -DStaleLogicalPortCleanUp.dryRun=false)#java -Xms5g -Xmx10g -Dcorfu-property-file-path=/opt/vmware/upgrade-coordinator-tomcat/conf/ufo-factory.properties -Djava.io.tmpdir=/opt/vmware/upgrade-coordinator-tomcat/temp -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector -Dlog4j.configurationFile=/opt/vmware/upgrade-coordinator-tomcat/conf/log4j2.xml -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/opt/vmware/upgrade-coordinator-tomcat/conf/logging.properties -Dnsx-service-type=nsx-manager -DStaleLogicalPortCleanUp.dryRun=false -DStaleLogicalPortCleanUp.userName=admin -DStaleLogicalPortCleanUp.password='AdminPassword' -DStaleLogicalPortCleanUp.maxThreads=5 -DStaleLogicalPortCleanUp.batchSize=20 -DStaleLogicalPortCleanUp.maxTimeoutMinutes=30 -cp /opt/vmware/upgrade-coordinator-tomcat/temp/logical-migration.jar com.vmware.nsx.management.migration.impl.StaleLogicalPortCleanUp
5. Confirm stale logical ports have been removed
Note that running this script on a Global Manager in a federated environment will return results saying that no stale logical ports are found.
The stale ports created for the Global segments will be automatically cleaned after cleaning the stale ports from the associated Local Manager.