How to remediate skip releasing of IP address due to failure of VMKnic removal.
search cancel

How to remediate skip releasing of IP address due to failure of VMKnic removal.

book

Article ID: 323682

calendar_today

Updated On:

Products

VMware Cloud Foundation

Issue/Introduction

This article is required to allow users to understand what this warning means and how to remediate from it.

Symptoms:

Workload domain, cluster and host removal operations could throw a warning that says: "Due to the failure to remove VMknic [..] from ESXi Host [..], the following IP address [..] will not be released from the network pool to avoid possible IP conflicts."

This warning is thrown at task at task "Remove vmknic(s) from ESXi Hosts" with error code: "NOT_RELEASED_IP_ADDRESS_DUE_TO_FAILED_VMKNIC_REMOVAL".

 



Environment

VMware Cloud Foundation 4.5
VMware Cloud Foundation 5.0
VMware Cloud Foundation 5.0.0.1

Cause

During removal of host operation, the workflow is trying to remove the hosts VMknics and then, it releases the associated IP addresses back to the free pool. However, when there is a failure during removal of VMknics operation and those VMknics are not removed successfully, the IP addresses are not released back to the free pool.

Resolution

To recover from this state, follow the below steps:

1. Remove the VMknics address that was not removed. This can be achieved with:

  • CLI: using "esxcli network ip interface remove -i <vmknic name>" command.
  • UI: login to ESXi UI and remove it from there.
  • Re-image of the host

2. After the VMKnics are removed from the hosts, release the IP addresses so they can be used again from the network pool. This should be directly changed in the DB with the following commands:

    The database command that will update the used IP address table by removing the desired IP:
    UPDATE vcf_network SET used_ip_addresses='[<comma-separated-ip-values-used-updated>]' WHERE id ='<network-id>';
    
    The database command that will update the free IP address table by adding the desired IP:
    UPDATE vcf_network SET free_ip_addresses='[<comma-separated-ip-values-free-updated>]' WHERE id ='<network-id>';

    The information about the network ID and the already existing IP addresses in the free and used tables could be retrieved with:
    select * from vcf_network;

 Also, it is important to make sure that the affected IP address is not used anywhere because moving the IP from used to free list, will make it available for usage by other operations. If the IP is not actually available, this will lead to IP duplication issues.