The NcHostAgent Service Cannot be Located on the Computer

This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Tech Community.

Hello everyone, my name is John Clyburn and I am a Sr. consultant in MCS. I’ve recently been working with Software Defined Networking (SDNv2). I’ve been primarily working with Windows Server 2019 and VMM 2019, deploying the solution using VMM SDN Express from the GitHub site. To learn more about this solution see the following link: SDNExpress. 

 

I ran into a problem that I would like to share with everyone in hopes that this will save you some time if you ever run into it while troubleshooting. 

 

PROBLEM: 

After running the VMM SDN Express PowerShell script on a host group with two Hyper-V host, it finished successfully. I then entered the VMM console and noticed an error on one of the Hyper-V host. I noticed if you viewed the status of the Hyper-V host by right clicking Properties-Status, the Host Agent Overall-Network Controller Host Agent has the following: 

 

Error 20505  

The NcHostAgent service cannot be located on the computer ‘HYPERV.CONTOSO.LOCAL’ 

 

If you click Repair All, below the window, you get the following error: 

 

Error 50124 – Plugin for network service ‘Network Controller threw an exception: ‘Service NcHostAgent is not present on ‘HYPERV.CONTOSO.LOCAL’ 

 

I then noticed the Hyper-V host did not have a logical switch assigned. I attempted to add a logical switch to the Hyper-V host and the process failed with the following error: 

 

Error 438  

Service NcHostAgent is not Present on HYPERV.CONTOSO.LOCAL 

 

After troubleshooting it for several hours, I decided to move the Hyper-V host to a new host group. When I attempted to move it, it failed with the following error: 

 

Error (26874) 

This operation is not permitted since uplink port <uplinkName> physical adapter (Intel(R) Ethernet 10G 4P X520/I350 rNDC$$$Microsoft:{81C9C7A9-CA99-4F03-BE79-E5E075771017}) on host (HYPERV.CONTOSO.LOCAL) would go out of scope for host 

 

Recommended Action 

Delete the logical switch instance on the affected host(s) and retry the operation 

 

Note you receive the error above even though there is no logical switch or virtual adapters assigned to the Hyper-V(HYPERV.CONTOSO.LOCAL)  host. 

 

You may also observe the following: 

·         The NC Host Agent service is missing from the Hyper-V host. 

·         There is no NcHostAgent.dll file in the …System32 folder on the Hyper-V host. 

·         There is no HKLM\System\CurentControlSet\Service\NcHostAgent key in the registry on the Hyper-V host. 

 

SOLUTION: 

At some point, the Network Controller services was removed or did not install properly when the Hyper-V host was added to VMM. Follow the steps below to reinstall them properly. 

 

Note the following services are added when you add the Hyper-V host to the VMM console. Not when the NC logical switch is added to the Hyper-V host. 

·         NC Host Agent (Disabled by default) 

·         Software Load Balancer Host Agent (Manual by default) 

 

Note there may be other solutions, but the one below solved my problem. 

 

Steps: 

1.      In the VMM console, disconnect the Network Adapter in the VMs on the Hyper-V host from their assigned VM Network/Logical Network. 

a.       Note you need to remove the logical switch. 

2.      In the VMM console, Remove all the Virtual Switch from the Hyper-V host with the error. 

3.      Remove the Hyper-V host from the VMM console. 

a.       Right click the host and select Remove. 

b.      Reboot the Hyper-V host when completed. 

4.      Re-add the Hyper-V host to VMM Console 

a.       Right click All Hosts and select Add Hyper-V Hosts and Clusters 

b.      Follow the prompts to completion. 

c.       Add the host to the <NCManaged> host group. 

                                                              i.Note NCManaged is the Network Controller host group the Hyper-V host is a member of. 

5.      On the Hyper-V host, launch Services and confirm the existence of the following: 

a.       NC Host Agent (Disabled by default) 

b.      Software Load Balancer Host Agent (Manual by default) 

6.      Add the NC logical switch to the new Hyper-V host. 

7.      Done. 

 

And that’s it. The steps above are common VMM task/steps. The key to correcting this problem is the sequence the steps are performed. I hope this post saves you time if you ever encounter these errors.  

  

 

 

 

REMEMBER: these articles are REPUBLISHED. Your best bet to get a reply is to follow the link at the top of the post to the ORIGINAL post! BUT you're more than welcome to start discussions here:

This site uses Akismet to reduce spam. Learn how your comment data is processed.