1

I can't understand why the VMs I create using virt-install & kickstart do not have networking that can be accessed reliably from foreign hosts. The VMs I created using virt-manager can be logged into using ssh, are pingable etc. but the kickstarted ones are inaccessible.

Even if I virsh edit the kickstarted VM and change to the change did not survive reboot. kube2 was created using virt-install and kickstart. The other two were created with virt-manager.

[root@kraken msh]# virsh dumpxml kube2 |grep bridge <interface type='bridge'> <source bridge='br0'/> [root@kraken msh]# virsh dumpxml kube1 |grep bridge <interface type='bridge'> <source network='host-bridge' bridge='br0'/> [root@kraken msh]# virsh dumpxml kube0 |grep bridge <interface type='bridge'> <source network='host-bridge' bridge='br0'/> 

What syntax do I use in my virt-install script to make sure the source network (host-bridge) is built? My virt-install --network syntax has varied so much I don't even want to post it here. Sometimes I'm able to ssh to the IP of the VM but not the hostname.

Do I need "--bridge br0" in my virsh-install syntax or something else?

1
  • The VM's networking works from the VM to the Internet. I can 'dnf update' all day. Commented Oct 30, 2020 at 0:50

1 Answer 1

0

I had the wrong DEVICE= name in /etc/sysconfig/network-scripts/ifcfg-enp2s0f1 which is NIC I enslaved to br0.

I executed

nmcli connection add type bridge-slave autoconnect yes con-name enp0s8 ifname enp0s8 master br0 

instead of the correct

nmcli connection add type bridge-slave autoconnect yes con-name enp0s8 ifname enp2s0f1 master br0 

So the problem was one of copy+pasta or pebkac. Had nothing to do with virt-install. Here's my working virt-install syntax.

virt-install \ --name kube2 \ --memory 8192 \ --graphics none \ --vcpus 2 \ --disk path=/pool/libvirt/images/kube2.qcow2 \ --network bridge=br0 -w network=host-bridge \ --os-variant centos8 \ --console pty,target_type=serial \ --location http://192.168.10.2/centos8 \ --extra-args 'console=ttyS0,115200n8 serial' \ -x "ks=http://192.168.10.2/kube-centos-8.cfg" 
1
  • I don't (you don't) need to specify the network (-w network=host-bridge) if you have only one kvm network. Commented Oct 30, 2020 at 18:00

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.