• Symptom:

    When you create a VM instance, you may discover that one VM instance has attached multiple networks. At this time, you can see multiple NICs on the VM instance via the console, but no IP addresses are found.

  • Cause:

    For a VM instance, each network is exactly one NIC. Attaching a network to a VM instance is equal to connecting a physical NIC to a server. By running ifconfig, you can see the eth device. If no IP addresses are found, this NIC has been actually connected but is not configured properly.

  • Solution:
    Ensure that you create a configuration file for this new NIC by incurring through the eth configuration file as follows:
    1. Make a copy of eth0: (The following is an example of a CentOS 7.2 environment. Notice that other versions of Linux path and file may be slightly different.)
      # Replace eth0 to eth1 in your configuration file, and delete the UUID.
      cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1 
      sed -i 's/eth0/eth1/g' ifcfg-eth0
      sed -i '/UUID*/d' /etc/sysconfig/network-scripts/ifcfg-eth1
    2. Restart the network to take effect:
      /etc/init.d/network restart
    3. By running ifconfig, you will see the IP addresses of the second NIC. If you attach multiple NICs to one VM instance, run the preceding commands.