Unable to add/remove/edit port mirroring sessions in vSphere 8.0
search cancel

Unable to add/remove/edit port mirroring sessions in vSphere 8.0

book

Article ID: 375565

calendar_today

Updated On:

Products

VMware vSphere ESXi 8.0 VMware vCenter Server 8.0

Issue/Introduction

After upgrading vSphere to 8.0, adding, removing, or editing port mirroring sessions fails with the error below:

“A specified parameter was not correct: port[123] cannot be add/edit here, for it was used by same or other sessions”.

(The port number can vary, depending on the environment)

The vpxd.log file reports the error below related to the port mirroring session when trying to edit it:

2024-08-02T06:27:24.890Z error vpxd[11075] [Originator@6876 sub=Default opID=########] [VpxLRO] -- ERROR task-######## -- ################(########################) -- dvs-
######## -- vim.DistributedVirtualSwitch.reconfigure: :vmodl.fault.InvalidArgument
--> Result:
--> (vmodl.fault.InvalidArgument) {
-->    faultCause = (vmodl.MethodFault) null,
-->    faultMessage = <unset>,
-->    invalidProperty = port[123] can not be add/edit here, for it was used by same or other sessions"
-->    msg = ""
--> }

 

Environment

VMware vSphere 8.0

Cause

This is expected behavior in vSphere 8.0. "A source mirroring port cannot be used in more than one mirroring session" 

- See Create a Port Mirroring Session

 

Resolution

Workaround to manually delete the port mirroring sessions in use.

Note: Please take a backup of the VCDB and take a snapshot of the vCenter VM before performing the steps below.

  • Open an ssh session to the vCenter
  • Run the following command:
    • vmon-cli -k vpxd
  • Connect to the vCenter database using this command:
    • /opt/vmware/vpostgres/current/bin/psql -U postgres -d VCDB
  • To remove a mirror session, use the following sql select statement to find the dvs_id and vspan_session_key in VCDB:
    • select dvs_id, vspan_session_key, name from VPX_DVS_VSPAN_SESSION;
  • Remove all the rows related to this session in VPX_DVS_VSPAN_PORTS table (dvsID and vspan session key taken from the select statement above) :
    • delete from VPX_DVS_VSPAN_PORTS where dvs_id='<dvsID>' and vspan_session_key='<vspan session key>';
  • Remove the row related to this session in VPX_DVS_VSPAN_SESSION table  (dvsID and vspan session key taken from the select statement above) :
    • delete from VPX_DVS_VSPAN_SESSION where dvs_id='<dvsID>' and vspan_session_key='<vspan session key>';
  • Exit the database: quit
  • Run the following command:
    • vmon-cli -i vpxd
  • From the ESXi host ssh session, type net-dvs to check if there are remaining sessions left for ports (example output):

  com.vmware.vswitch.port.mirrorSessions:
   sid: 1
   dname: Session-1
   flags: DST_NO_OUTPUT DST_NO_INPUT DST_ORIG_VLAN DISABLED
   snapLen: -1 (full frame)
   encapVlan: 0 (no ENCAP)
   type: ERMIRROR_SRC
   samplingRate: 1

   dstEntities (0):
   srcInEntities (2): 0
   srcOutEntities (2):

   propType = CONFIG

  • Go to the VCUI, disconnect and re-connect the ESXi host.
  • On the host ssh session type net-dvs to verify that the remaining sessions were deleted.

Additional Information

Note:

If VCHA is in use, it needs to be placed in maintenance mode or destroyed before performing the workaround above.

- See Edit the vCenter HA Cluster Configuration

- See Remove a vCenter HA Configuration