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 below error:

“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 reports the below error 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 an expected behavior in vSphere 8.0: a source mirroring port cannot be used in more than one mirroring session

https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-networking/GUID-68B5DD45-DD3F-4E9B-A6CD-BE97026A846A.html?hWord=N4IghgNiBcILYEsBOSD2SQF8g

Resolution

Workaround to manually delete the port mirroring sessions in use.

Take a backup of VCDB and a snapshot of the vCenter VM before performing the workaround.

  •  ssh to vc.
  •  vmon-cli -k vpxd
  •  /opt/vmware/vpostgres/current/bin/psql -U postgres -d VCDB
  •  If we want to remove a mirror session, use the following sql 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>';

  •  quit
  •  vmon-cli -i vpxd
  •  from the ESXi host ssh type net-dvs to see there is 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 type net-dvs  to verify that the remaining sessions were deleted.

Additional Information