A CentOS 7 host installs CentOS 7 virtual machines inside itself using a virt-install command, which includes an assigned MAC address. The CentOS 7 host is connected via Ethernet to a hardware firewall/router, which has assigned a static IP address to the MAC address that is given to a specified virtual machine. Machines elsewhere in the same network are able to communicate with the virtual machine when it is installed (ping, telnet, etc.). However, several days later, the virtual machine is not able to send or receive communications with the rest of the network (no ping, no telnet, etc.) This problem is resolved when the virtual machine is destroyed, and then the same virt-install command is used to re-install a clone of the virtual machine. This indicates that the connectivity unreliability problem is caused by something INSIDE the virtual machine.

What specifically can be done in order to cause these virtual machines to be able to maintain reliable, lasting connectivity with the rest of the network?

The Code:

The virtual machines are created by running the following virt-install command on the host:

virt-install --name=first-centos7 --disk path=/tmp/firstDisk.qcow2,size=241  
--graphics none --vcpus=1 --memory=3072 --location /tmp/CentOS-7-x86_64-Minimal-1611.iso  
--network bridge=br0 --os-type=linux --os-variant=rhel7.0  
--mac=52:54:00:ma:ca:dr --initrd-inject=/tmp/vm.ks --extra-args "ks=file:/vm.ks console=ttyS0"  

Should this virt-install command be changed? Or should some command inside the resulting virtual machine be changed? Or does something in the host need to be changed in order to enforce reliability for all the guest virtual machines?

  • Are you sure that br0 is running? Try 'virsh net-list --all' – bitofagoob May 22 '17 at 21:26
  • @bitofagoob I just re-installed the virtual machines, as described in the OP. Therefore, I cannot do a valid test of what you suggest. However, I did imagine that there might be some command to check/ensure that the required elements are persistent. – CodeMed May 22 '17 at 21:45
  • If you have the console enabled/configured on the system, did you checked if the VM is responsive from the console (virsh console <vm-name>) when is not reachable through the network? – DarkVex May 22 '17 at 22:26
  • @DarkVex Yes, when the virtual machine was not reachable through the network, I typed virsh console vm-name from the host. I was able to get into the virtual machine's command line in that way. And from inside, I ran ping other.ips.on.network and got a similar error message indicating that the network was not reachable. – CodeMed May 22 '17 at 23:20
  • 1
    And when pings from the VM and to the VM were failing, did you try to run tcpdump at the bridge, the host's interface and the tap device, to see where exactly they were failing? Also, instead of reinstalling the VM did you try to reboot it, and if that didn't restore connectivity, stop/start it? – dyasny May 23 '17 at 0:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.