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 = ""
--> }
VMware vSphere 8.0
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
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.
select dvs_id, vspan_session_key, name from VPX_DVS_VSPAN_SESSION;
delete from VPX_DVS_VSPAN_PORTS where dvs_id='<dvsID>' and vspan_session_key='<vspan session key>';
delete from VPX_DVS_VSPAN_SESSION where dvs_id='<dvsID>' and vspan_session_key='<vspan session key>';
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
Note:
If you are using VCHA, before performing the workaround above, VCHA needs to be placed in maintenance mode or destroyed.