Remove hidden physical network cards from Windows and virtual NIC after network virtualization failed

Source: Internet
Author: User
Tags failover

first, identify all types of network equipment and network Connections

Because network virtualization adds a lot of virtual network devices (including virtual NICs) to the physical machine, the situation becomes complex, so first we need to distinguish them. Of course, if you don't have network virtualization, you can skip this section. In a networked virtualization environment, it should be visible through Device Manager: A physical network card starting with Intel (depending on the physical NIC vendor); Hyper-V Virtual Ethernet Adapter network card; Microsoft Network Adapter MULTIPLEXOR Network adapter Group (Windows Server 2012 starts to support the network card group, through the command lbfoadmin can manage the network card group, the network card group often appears in the Net virtualization environment); After displaying the hidden devices, you also see the Hyper-V Virtual Switch Extension Adapter, and so on.

The network connection in the network and the Sharing Center can be simply considered as the configuration of the network device in the image above, and its name and attribute can be customized, but the device depends on the corresponding image.

Let's look at the specific configuration of these network connections.

  1, the network connection of the physical network card

The main settings are the Tcp/ipv4, Tcp/ipv6 protocol and two link layer topology discovery protocols. The following figure is the network connection property for the physical network card named Ethernet 04.

  2, network connection of NIC Group

If you are configuring only the network adapter group, the configuration and physical Nic are basically the same, except for the Tcp/ipv4, Tcp/ipv6 protocol, and two link layer Topology discovery protocols, you also configure the use of Microsoft Load Balancing/failover Provider Agreement. The NIC group aggregates multiple physical network adapters to achieve failover and load balancing of network connections. The network connectivity of those aggregated physical network adapters is only the Microsoft Network Adapter Multiplexor Protocol protocol. On the left side of the diagram below is the network connection property named Management Nic Group, and the network connection attribute on the right side of the physical network card named Ethernet 01 (one of the converged network adapters) in the network card group.

  3, the network connection of the virtual network card

Virtual network adapters are typically created after the virtual switch is created, and additional virtual NICs can be created on the physical host via SCVMM. The network connection of the virtual network card and the network connection configuration of the physical network card are the same, so the function of the virtual network card is the same as that of the physical NIC, but the virtual NIC is built on the physical network card. The following figure is a network connection property for a virtual network adapter named Vethernet (Cluster).

  4, the Virtual Switch network connection

Here are two things:

If the virtual switch is built on a separate physical network card (this is the case for a virtual switch created directly in Hyper-V manager), then the network connection to the physical network card used to create the virtual switch is configured to use only Hyper-V extensible virtual The switch protocol. The following figure is the network connection properties of the Ethernet 01 physical network card after the virtual switch is created on the physical network card named Ethernet 01

If the virtual switch is built on top of the network card Group (a virtual switch created in the host after configuring a logical switch based on the NIC group for the host in SCVMM), then the network connection to the NIC group used to create the virtual switch is configured to only use Hyper-V extensible Virtual switch protocol, and the physical NIC configured for the network card group is described as the above Network card Group section. On the left side of the diagram below, a virtual switch named Management Logical switch is created, and the network connection properties of the NIC group with the same name are created, and on the right are the network connection properties of the physical network card (one of the converged network adapters) that is named Ethernet 01 in the network card group.

To sum up, when creating a virtual network adapter and a network card group, in addition to creating the appropriate networking device , the corresponding network connection , but the creation of a virtual switch will only create the appropriate network devices , but do not create a network connection , A virtual switch is built on a physical network card or network network connection, and is only a reconfiguration of the physical NIC and the networking connections of the network card group.

  II. Delete network devices and network connections

Once you know the relationship between the various network devices and network connections, it is more clear to delete the target, in principle, should follow:

First and foremost. First remove the top-level network device and network connection, and then remove the base. Basic according to virtual network card > Virtual Switch > Network card group > physical network Card This is the order to delete. Otherwise, the loss of reliance on the network devices and network connectivity will be the most difficult to deal with. If the cluster is involved, it is best to remove the network equipment corresponding to the cluster, if possible, to dissolve the cluster.

From the table and the inside. deleted in the GUI or deleted in PowerShell, if not, in the registry. Use the registry carefully, but often the ultimate solution is the registry.

Where to create where to delete. Created in Hyper-V manager is removed in Hyper-V Manager, created in SCVMM, and deleted in SCVMM. Of course things are not so simple, but the creation is not deleted is the problem.

Next, depending on the scenarios, let's take a look at why and how to delete.

  1, remove the virtual network card and its network connection

(1) through GUI and PowerShell

Virtual network adapters and their network connections that are created after a logical switch is configured for a host using the SCVMM console or SCVMM PowerShell, can normally be deleted in the SCVMM console or SCVMM PowerShell, but sometimes due to host hardware changes (primarily motherboard or NIC) or other unforeseen circumstances, there are exceptions to the creation process, after attempting to remove the configuration for recovery and still leave a virtual NIC or its network connection that should not exist on the host, SCVMM is helpless, and these virtual cards cannot be passed through the GUI on the host (through Device Manager or Hyper-V Manager ) are deleted directly. The suffix is incremented automatically because the new virtual NIC is named. As a result, these redundant virtual network cards do not have much nuisance, but the network connection associated with it is often the problem of naming conflicts (because the network connection name can not be duplicated, these legacy virtual network connections will occupy the name), can not be named as their own network connections, For many people it is unacceptable.

The virtual network card and its network connections can be viewed and removed by PowerShell on the host. Use the Get-netadapter command to view all network cards, use Get-vmnetworkadapter–all to view the virtual network card, use the Get-vmnetworkadapter–managementos command to view the virtual network card on the host. Use Remove-vmnetworkadapter–managementos–name to remove the specified virtual network adapter and network connection on the host.

If you cannot view and remove virtual network cards and their network connections through PowerShell, you can also try two methods: one is to use the DevCon command-line tool, and the other is to directly manipulate the registry.

(2) through the DevCon command line tool

Deleting a network device is essentially a device-deletion driver, and Microsoft's own DevCon command-line tool can replace Device Manager to manage computer devices, especially those that are hidden, and DevCon command-line tools for download and use. Placing the appropriate version Devcon.exe files in the Windows/system32 directory for invocation on the command line is not omnipotent due to versioning and compatibility issues DevCon. Use the following command to query and delete the virtual NIC, in which the path ROOT/VMS_MP is explained below.

(3) Through the registration form

As a last resort, we can also delete through the registry, this is a dangerous thing, please proceed with caution. Use the regedit command to open the registry.

Remove the network connection first. Open Node hkey_local_machine/system/currentcontrolset/control/network/{4d36e972-e325-11ce-bfc1-08002be10318}, There are many named nodes under the GUID, each node represents a network connection that exists now or existed, and the name attribute in the next connection node can tell which network connection the node is representing, and note the name of the GUID before deleting it. Deletes nodes with the same GUID name in the following path, where the detailed configuration of the network connection is visible, even including IP and subnet masks:

hkey_local_machine/system/currentcontrolset/services/tcpip/parameters/adapters/

hkey_local_machine/system/currentcontrolset/services/tcpip/parameters/interfaces/

Then remove the network device. Open the node hkey_local_machine/system/currentcontrolset/enum/root/vms_mp/, which is the virtual NIC-driven configuration path, through its child node FriendlyName properties, Locate the network clamp node that needs to be removed, which is the path that appears in the DevCon command.

But to delete this child node is not easy, because this path in the registry is the system critical path, by default, these subnodes and all of its nodes and items are under the System Account Control only, other accounts do not have the right to operate, so using Administrator admin Administrator to run the registry is useless, But the good news is that by acquiring ownership, the administrator can finally get operational privileges. Because you can set only one node or item at a time, this is a tedious task. The specific steps are as follows:

Right-permissions on the node, although the hint does not have permission, but allows to enter the modification, select the advanced advanced, the following figure to modify owner owners to obtain ownership. Note, however, that after you modify the owner, you may not be able to confirm the dialog box, but you can finally get ownership by choosing to discard Cancel.

Close all dialog boxes and permissions right again, and you can add the user Administrator and authorize it. Set from the deepest visible node until all nodes and items under it are granted permissions, the entire child node is deleted, and the host is restarted. (This step, in fact, can also be used to get permissions on files or folders that are restricted under NTFS)

(Physical network cards can also be deleted by the procedure above the registry.) It is also worth mentioning that in the registry the same level as the CurrentControlSet will have ControlSet001 or ControlSet002, and other similar named nodes, which have the same structure and data as the CurrentControlSet, There is no need to delete the corresponding nodes in the ControlSet001 or ControlSet002, they are only copies of the system configuration, and they will be overwritten by the changes in the CurrentControlSet after the system is restarted normally. )

  2. Remove Virtual Switch

In a network virtualization environment, you should first remove the logical switch or virtual switch on the host through the SCVMM console or SCVMM PowerShell to properly remove the associated configuration of the host in SCVMM, but if you find a virtual switch that still fails to be removed from the host, It can also be removed on the host via Hyper-V Manager and Hyper-V PowerShell.

If this cannot be done, you can use the DevCon command-line tool and the operations registry just as you would remove a virtual NIC, except that the virtual switch-driven configuration node is hkey_local_machine/system/currentcontrolset/enum/root/ VMS_VSMP, here is no longer to repeat.

  3, remove the network card group

In a network virtualization environment, if the logical switch configured for the host is associated with an upstream port with a network card group, the network card group is always created on the host and the virtual switch is created on the network card group. If the removal of a logical switch fails and more than the network card group is left on the host, it can be removed in the NIC group manager or PowerShell. Windows Server 2012 supports network card groups, and you can use the command lbfoadmin to open the network card Group manager to manage the network card group, or you can access the Remove-netlbfoteam command.

Here carefully use the DevCon command-line tools and registry to delete, I did not test whether there will be serious consequences, but it is easy to know the network Card Group Registry node is hkey_local_machine/system/currentcontrolset/enum/ Compositebus/ms_implat_mp.

There are also cases in the network where the library file corruption of WMI causes the network card group to be unable to manage, can try to repair as follows, more about the WMI library repair, can refer to here:

net stop WinMgmt Rename the folder%windir%/system32/wbem/repository to Repository.oldrestart the Systemwinmgmt/resetrep Ository Disable all of the network adapters remove hklm/system/currentcontrolset/control/network/config enable all the Netwo RK Adapters Enable NIC teaming

  4, remove the physical network card

Redundant physical network cards are often due to hardware changes or system recovery after the formation of the deletion of physical network card relatively simple, in the Device Manager or DevCon command line can be deleted, in the registry can also refer to the deletion of virtual network card.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.