Hello Guys,

I am trying to create a network in KVM using openvswitch. network-scripts
are deprecated CentOS8. So need to use NetworkManager with openvswitch. I
have created ovs bridge like below.

======
[root@c8kvm ~]# nmcli conn add con-name ovs-br1 type ovs-bridge
conn.interface ovs-br1


[root@c8kvm ~]# nmcli conn add con-name ovs-br1-port0 type ovs-port
conn.interface ovs-br1-port0 master ovs-br1


[root@c8kvm ~]# nmcli conn add con-name ovs-br1-ens4 type ovs-interface
slave-type ovs-port conn.interface ovs-br1-ens4 master ovs-br1-port0
ipv4.method manual ipv4.address 192.168.0.10/24


[root@c8kvm ~]# nmcli conn add con-name ovs-br1-port1 type ovs-port
conn.interface ovs-br1-port1 master ovs-br1


[root@c8kvm ~]# nmcli conn add con-name ens4 type ethernet conn.interface
ens4 master ovs-br1-port1


[root@c8kvm ~]#  ovs-vsctl show
ddfe4286-c080-431b-8cc7-14acb756333c
    Bridge "ovs-br1"
        Port "ovs-br1-port1"
            Interface "ens4"
                type: system
        Port "ovs-br1-port0"
            Interface "ovs-br1-ens4"
                type: internal
    ovs_version: "2.12.0"

[root@c8kvm ~]# nmcli c s
NAME           UUID                                  TYPE           DEVICE

ovs-br1-ens4   719839f8-02fe-46f8-a68d-2157e54fb778  ovs-interface
 ovs-br1-ens4
ens4           f6a7103c-e5c3-41c4-9a45-9ecca4a1aad4  ethernet       ens4

ovs-br1        a496b994-1b78-4045-98e7-dfaffd79d54e  ovs-bridge     ovs-br1

ovs-br1-port0  9f47f7e6-b3b1-44a4-b492-afede0c16964  ovs-port
ovs-br1-port0
ovs-br1-port1  be3caec2-9bd0-4c40-b4f2-c4b7537e2cb9  ovs-port
ovs-br1-port1
======

After this, I have defined a KVM network.

=====
[root@c8kvm ~]# virsh net-list --all
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 ovs-private          active     yes           yes

[root@c8kvm ~]# virsh net-dumpxml ovs-private
<network>
  <name>ovs-private</name>
  <uuid>aa933120-6e67-4a86-bfdf-e87709da0176</uuid>
  <forward mode='bridge'/>
  <bridge name='ovs-br1'/>
  <virtualport type='openvswitch'/>
</network>
=====

The problem is when trying to create a VM using this network getting the
following error.

====
[root@c8kvm ~]# virt-install --name test-c8 --vcpus 2 --memory 2048
--autostart --disk path=/var/lib/libvirt/images/test-c8.qcow2 --os-variant
centos7.0 --network network:ovs-private  --graphics
vnc,listen=0.0.0.0,port=5999,password='hello123' --console
pty,target_type=serial --cdrom
/var/lib/libvirt/images/CentOS-8-x86_64-1905-dvd1.iso
WARNING  Unable to connect to graphical console: virt-viewer not installed.
Please install the 'virt-viewer' package.
WARNING  No console to launch for the guest, defaulting to --wait -1

Starting install...
ERROR    Cannot get interface MTU on 'ovs-br1': No such device
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect qemu:///system start test-c8
otherwise, please restart your installation.
====

While inspecting /var/log/messages, can see errors.

====
Feb 12 04:03:35 c8kvm NetworkManager[24403]: <info>  [1581498215.5522]
manager: (vnet0): new Tun device
(/org/freedesktop/NetworkManager/Devices/10)
Feb 12 04:03:35 c8kvm systemd-udevd[24953]: link_config: autonegotiation is
unset or enabled, the speed and duplex are not writable.
Feb 12 04:03:35 c8kvm libvirtd[13725]: 2020-02-12 09:03:35.557+0000: 13727:
error : virNetDevGetMTU:430 : Cannot get interface MTU on 'ovs-br1': No
such device
Feb 12 04:03:35 c8kvm libvirtd[13725]: 2020-02-12 09:03:35.569+0000: 13747:
error : virFileReadAll:1460 : Failed to open file
'/sys/class/net/vnet0/operstate': No such file or directory
Feb 12 04:03:35 c8kvm libvirtd[13725]: 2020-02-12 09:03:35.569+0000: 13747:
error : virNetDevGetLinkInfo:2552 : unable to read:
/sys/class/net/vnet0/operstate: No such file or directory
Feb 12 04:03:35 c8kvm ovs-vsctl[24962]:
ovs|00001|db_ctl_base|ERR|'del-port' command requires at least 1 arguments
Feb 12 04:03:35 c8kvm libvirtd[13725]: 2020-02-12 09:03:35.629+0000: 13727:
error : virCommandWait:2678 : internal error: Child process (ovs-vsctl
--timeout=5 -- --if-exists del-port) unexpected exit status 1: ovs-vsctl:
'del-port' command requires at least 1 arguments
Feb 12 04:03:35 c8kvm libvirtd[13725]: 2020-02-12 09:03:35.629+0000: 13727:
error : virNetDevOpenvswitchRemovePort:231 : internal error: Unable to
delete port (null) from OVS
====

Is there any way to fix this?

*Best Regards,*
*Arvin*
_______________________________________________
discuss mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss

Reply via email to