Baking Clouds Ltd

Baking Clouds provide tailored IT consultancy services to small and medium-sized companies; we cover all aspects of IT without any hidden costs.

Fix Issue: “Deleting or renaming a vDS uplink port fails” error

Welcome to another Baking Clouds post. You are maybe here because you are experiencing the error Deleting or renaming a vDS uplink port fails with: Uplink name is in use by the teaming policy defined at DVPort as documented in this KB article on vCenter Server 5.5 or above.

It is unusual to experience this error in newer versions of vCenter Server, but here I am writing about it because I experienced the same issue in vCenter Server 7.0.

Before moving on to the workaround, please consider and read below.

  • Always backup your vCenter Server specially before attempting to resolve errors that involves DB changes.
  • Raise a VMware SR for this operations.
  • Read and understand the change and impact.
  • Test the workaround in a lab.
  • Use at your own risk woraround mentioned here

Deleting a vDS port from vCenter Server DB

For this example, we use the fictional DVPort name jazz-316#73667 which returns an error when trying to change the Uplinks configuration in the DVS.

Connect to vCenter Server using SSH and run a DB dump to file

Open an SSH protocol session to the vCenter Server appliance using your preferred tool, then log in and run a DB dump. Update the search to reflect the DVPort name seen in your error message.

We use the DB dump to search for DVPort jazz-316#73667 offline

/opt/vmware/vpostgres/current/bin/pg_dump -d VCDB -U postgres --exclude-table=vpx_event* --exclude-table=vpx_hist_stat* --disable-trigger --exclude-table=vpx_task --data-only > /storage/core/db.txt

Upload the file db.txt to your workstation and search for the DVPort name returning the error

less db.txt | grep -i jazz-316#73667

The search results show using the DB dump show entries found with the name jazz-316#73667

8715    0       jazz-316#73667   0       \N      1       0       0       0       0       1       0       0       0       0       1       700     \N      \N      \N      0       1       1       1       0  00       1       loadbalance_srcid       0       1       0       1       0       0       0               \N      \N      \N      1       1       1       0       0               1       349     \N      \N \N       \N      \N      \N      \N      \N      \N      \N
8715    0       jazz-316#73667   1       Uplink 1        0       3639
8715    0       jazz-316#73667   1       Uplink 3        1       3640
8715    0       jazz-316#73667   1       Uplink 2        2       3641

Return to the SSH session open in vCenter Server and run the below searches to the find uplink and dvport entries with the name jazz-316#73667

VCDB=# Select * from vpx_uplink_teaming where dvport_key = 'jazz-316#73667';

The above search shows entries for Uplink with the name jazz-316#73667

dvs_id | dvportgroup_id |  dvport_key   | active_uplink | uplink_name | uplink_index | surr_key
--------+----------------+---------------+---------------+-------------+--------------+----------
   8715 |              0 | jazz-316#73667 |             1 | Uplink 1    |            0 |     3639
   8715 |              0 | jazz-316#73667 |             1 | Uplink 3    |            1 |     3640
   8715 |              0 | jazz-316#73667 |             1 | Uplink 2    |            2 |     3641
(3 rows)

Identify the uplink name to delete for which error was returned and note the surr_key. In this case, ‘Uplink 3’ was being removed.
This value will be used for the delete command later.

VCDB=# Select * from vpx_dvport_setting where dvport_key = 'jazz-316#73667';

The above search shows entries for DVport with the name jazz-316#73667

dvs_id | dvportgroup_id |  dvport_key   | blocked_flg | nrp_key | in_shaping_object_flg | in_shaping_avg_bandwidth | in_shaping_burst_size | in_shaping_enabled | in_shaping_peak_bandwidth | out_shaping_object_flg | out_shaping_avg_bandw
idth | out_shaping_burst_size | out_shaping_enabled | out_shaping_peak_bandwidth | vlan_object_flg | vlan_id | trunk_mode_flg | pvlan_id | qos_tag | tx_uplink | ipfix_object_flg | ipfix_enabled | sec_policy_object_flg | allow_promiscuous
| forged_transmits | mac_changes | teaming_object_flg |  teaming_policy   | teaming_reverse | teaming_notify | teaming_rolling | criteria_object_flg | teaming_fail_chk_beacon | teaming_fail_chk_duplex | teaming_fail_chk_percent | teamin
g_fail_chk_speed | teaming_fail_duplex | teaming_fail_percent | teaming_fail_speed | uplink_order_object_flg | vendor_blob_object_flg | overlay_object_flg | npt_allowed_flg | lacp_enable | lacp_mode | traffic_filter_obj_flg | surr_key |
mac_mgmt_object_flg | mac_mgmt_allow_promiscuous | mac_mgmt_forged_transmits | mac_mgmt_mac_changes | mac_learning_object_flg | mac_learning_enabled | allow_unicast_flooding | mac_learning_limit | mac_learning_limit_policy | vni
--------+----------------+---------------+-------------+---------+-----------------------+--------------------------+-----------------------+--------------------+---------------------------+------------------------+----------------------
-----+------------------------+---------------------+----------------------------+-----------------+---------+----------------+----------+---------+-----------+------------------+---------------+-----------------------+------------------
-+------------------+-------------+--------------------+-------------------+-----------------+----------------+-----------------+---------------------+-------------------------+-------------------------+--------------------------+-------
-----------------+---------------------+----------------------+--------------------+-------------------------+------------------------+--------------------+-----------------+-------------+-----------+------------------------+----------+-
--------------------+----------------------------+---------------------------+----------------------+-------------------------+----------------------+------------------------+--------------------+---------------------------+-----
   8715 |              0 | jazz-316#73667 |           0 |         |                     1 | 0                        | 0                     |                  0 | 0                         |                      1 | 0
     | 0                      |                   0 | 0                          |               1 |     700 |                |          |         |         0 |                1 |             1 |                     1 |                 0
|                0 |           0 |                  1 | loadbalance_srcid |               0 |              1 |               0 |                   1 |                       0 |                       0 |                        0 |
                 |                     |                      |                    |                       1 |                      1 |                  1 |               0 |           0 |           |                      1 |      349 |
                    |                            |                           |                      |                         |                      |                        |                    |                           |
(1 row)

Let’s get all together to confirm we have what we need and then delete the entry from vpx_uplink_teaming

** Connect to your vCenter Server console or SSH.

** Connect to the DB via below command
/opt/vmware/vpostgres/current/bin/psql -U postgres -d VCDB

** Execute the command to get the Uplink entry
select from vpx_uplink_teaming where surr_key = 3640 and dvport_key = 'jazz-316#73667';

** You will see single Entry:

 8715 |              0 | jazz-316#73667 |             1 | Uplink 3    |            1 |     3640

** Execute the command to delete the Uplink entry
delete from vpx_uplink_teaming where surr_key = 3640 and dvport_key = 'jazz-316#73667';

** Execute the command to get the DVPort Entry
select from vpx_dvport_setting where dvport_key = 'jazz-316#73667'

** Execute the command to delete the DVPort entry
delete from vpx_dvport_setting where dvport_key = 'jazz-316#73667'

Remove the uplink ‘Uplink 3’ from the VDS using vCenter UI.

Deleting a vDS port from vCenter Server DB

In some scenarios, the port group blocking the uplink can be found using the MOB and deleted.
Are you new to using the vCenter MOB?.
This document provides details. This KB provides steps to navigate the MOB.
For a list of articles and documentation related to MOB this link can help.

Go to https://<vc-ip>/mob
Search for DVPort 'jazz-316#73667'
Delete DVPort 'jazz-316#73667'

We hope this post is helpful. Send us your comment using the button below if you want more information.

You can also reach out and connect with us on social media using here and here

Disclaimer
Last updated: May 17, 2018
The information contained on www.bakingclouds.com website (the “Service”) is for general information purposes only.
Baking Clouds assumes no responsibility for errors or omissions in the contents on the Service.
In no event shall Baking Clouds be liable for any special, direct, indirect, consequential, or incidental damages or any damages whatsoever, whether in an action of contract, negligence or another tort, arising out of or in connection with the use of the Service or the contents of the Service.  Baking Clouds reserves the right to make additions, deletions, or modifications to the contents on the Service at any time without prior notice.

Fix Issue: “Deleting or renaming a vDS uplink port fails” error
Scroll to top