A virtual machine cannot retrieve NIC information after being attached to a Distributed Port Group. How do I resolve this?
Cause
QEMU may have dynamically attached the virtual NIC to the virtual machine, but the virtual machine did not recognize it.
Solution
-
Try one of the following methods:
-
Restart the virtual machine. The NIC information is obtained automatically after restart.
-
Run the following commands inside the virtual machine operating system to manually add the NIC configuration file.
[root@localhost ~]# cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1 # Assuming the existing NIC is named eth0, copy its configuration file as a template [root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth1 # Set the following parameters TYPE=Ethernet BOOTPROTO=dhcp NAME=eth1 DEVICE=eth1 ONBOOT=yes -
Run the
service network restartcommand to restart the network.