Host profile remediation fails with "The resource '<Port Group>' is in use" because a Port Group on the Host is still busy.
search cancel

Host profile remediation fails with "The resource '<Port Group>' is in use" because a Port Group on the Host is still busy.

book

Article ID: 407954

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • Host profile remediation fails with error "The resource '<port group>' is in use".

  • The Host profile is configured to use the distributed switch port groups.

  • Per the syslog.log of the ESXi Host on which the remediation fails, you see that there is a port group associated with the Host where the management kernel or any other VMkernel interface sits. The said port group doesn't belong to the distributed switch, rather it belongs to a standard switch on the concerned ESXi Host. For example, in the log snippets below the name of the problematic standard switch port group is "Management Network".

    Log location- /var/run/log/syslog.log

    In(14) hostprofile[2120939]: opID=<ID>: Task haTask--vim.profile.host.profileEngine.HostProfileManager.applyHostConfig-2692 started^@
    In(14) hostprofile[2120939]: opID=<ID>: ApplyHostConfig called for host profile version 8.0.3^@
    In(14) hostprofile[2120939]: opID=<ID>: Applying config first....***^@
    In(14) hostprofile[2120939]: opID=<ID>: Re-arranged "add" vnics as []^@
    In(14) hostprofile[2120939]: opID=<ID>: Refreshing hostd networking now...^@
    Er(11) hostprofile[2120939]: opID=<ID>: Exception while applying host config. Exception: (vim.fault.ResourceInUse) {
    Er(11)[+] hostprofile[2120939]:    dynamicType = <unset>,
    Er(11)[+] hostprofile[2120939]:    dynamicProperty = (vmodl.DynamicProperty) [],
    Er(11)[+] hostprofile[2120939]:    msg = "The resource '<Port Group>' is in use.",
    Er(11)[+] hostprofile[2120939]:    faultCause = <unset>,
    Er(11)[+] hostprofile[2120939]:    faultMessage = (vmodl.LocalizableMessage) [],
    Er(11)[+] hostprofile[2120939]:    type = vim.host.PortGroup,
    Er(11)[+] hostprofile[2120939]:    name = '<Port Group>'
    Er(11)[+] hostprofile[2120939]: }^@
    Wa(12) hostprofile[2120939]: opID=<ID>: Exception while applying host config. Backtrace:
    Wa(12)[+] hostprofile[2120939]: ^@
    Wa(12) hostprofile[2120939]: opID=<ID>:   File "/lib64/python3.11/site-packages/hostprofiles/pyEngine/hostprofilemanager.py", line 1820, in _ApplyHostConfig
    Wa(12)[+] hostprofile[2120939]: ^@
    Wa(12) hostprofile[2120939]: opID=<ID>:   File "/lib64/python3.11/site-packages/hostprofiles/pyEngine/applyConfigSpec.py", line 4728, in ApplyHostConfig
    Wa(12)[+] hostprofile[2120939]: ^@
    Wa(12) hostprofile[2120939]: opID=<ID>:   File "/lib64/python3.11/site-packages/hostprofiles/pyEngine/applyConfigSpec.py", line 3467, in ApplyNetworkConfigCLI
    Wa(12)[+] hostprofile[2120939]: ^@
    Wa(12) hostprofile[2120939]: opID=<ID>:   File "/lib64/python3.11/site-packages/hostprofiles/pyEngine/applyConfigSpec.py", line 3189, in RemovePortGroupConfig
    Wa(12)[+] hostprofile[2120939]: ^@
    Wa(12) hostprofile[2120939]: opID=<ID>:   File "/lib64/python3.11/site-packages/pyVmomi/VmomiSupport.py", line 618, in <lambda>
    Wa(12)[+] hostprofile[2120939]: ^@
    Wa(12) hostprofile[2120939]: opID=<ID>:   File "/lib64/python3.11/site-packages/pyVmomi/VmomiSupport.py", line 391, in _InvokeMethod
    Wa(12)[+] hostprofile[2120939]: ^@
    Wa(12) hostprofile[2120939]: opID=<ID>:   File "/lib64/python3.11/site-packages/pyVmomi/SoapAdapter.py", line 1607, in InvokeMethod
    Wa(12)[+] hostprofile[2120939]: ^@
    In(14) hostprofile[2120939]: opID=<ID>: ApplyHostConfig completed^@
    In(14) hostprofile[2120939]: opID=<ID>: Cleaned up Host Configuration^@



    Log location- /var/run/log/hostprofiletrace.log

    Er(11)[+] hostprofiletrace[2120907]:
    Er(11) hostprofiletrace[2120939]: ^^^<op-ID>-ApplyHostConfigs-error.trc^^^512^^^ <obj versionId="8.0.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:vim25" xsi:type="LocalizedMethodFault"><fault><faultCause><fault xsi:type="ResourceInUse"><type>HostPortGroup</type><name>Management Network</name></fault><localizedMessage>The resource 'Management Network' is in use.</localizedMessage></faultCause><faultMessage xsi:type="LocalizableMessage"><key>ResourceInUse.summary</key><arg><key>name</key><value xsi:type="xsd:string">Man
    Er(11) hostprofiletrace[2120939]: ^^^<opID>-ApplyHostConfigs-error.trc^^^202^^^ agement Network</value></arg><message>The resource '<Management Network>' is in use.</message></faultMessage></fault><localizedMessage>The resource 'Management Network' is in use.</localizedMessage></obj>

Environment

VMware vSphere ESXi
VMware vCenter Server

Cause

A standard switch port group in the Host is still in use. This is because the management or other vmk interfaces on it are still connected to the uplink network via this standard switch port group. As a result, the Host Profile Manager cannot tear up this configuration and push it to the distributed switch port group.

Resolution

In a setup where the host profile is configured to use the distributed switch port groups, please ensure that all the networks are migrated from the Standard Switch to the distributed switch before the host profile is used to remediate the Hosts. The detailed instructions on how to do the same can be found here- https://techdocs.broadcom.com/us/en/vmware-cis/vsan/vsan/8-0/vsan-network-design/migrating-from-standard-to-distributed-vswitch.html

Note: Please engage Broadcom Support to assist you with the standard to distributed switch migration. An incorrect migration can cause the Hosts to go unresponsive and not connect back to the vCenter server as well.