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 = ""
--> }
VMware vSphere 8.0
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
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.
vmon-cli -k vpxd
/opt/vmware/vpostgres/current/bin/psql -U postgres -d VCDB
dvs_id
and vspan_session_key
in VCDB:
select dvs_id, vspan_session_key, name from VPX_DVS_VSPAN_SESSION;
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>';
delete from VPX_DVS_VSPAN_SESSION where dvs_id='<dvsID>' and vspan_session_key='<vspan session key>';
quit
vmon-cli -i vpxd
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
net-dvs
to verify that the remaining sessions were deleted.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