Re: [ovs-discuss] Bonding configuration for KVM guests

2023-10-12 Thread Xuo Guoto via discuss
--- Original Message ---
On Thursday, October 12th, 2023 at 9:03 PM, Ilya Maximets  
wrote:

Thanks again for the detailed reply!

> If you want to preserve these, you'll need to re-add them manually.
> Potentially as part of the same transaction, by adding more commands,
> i.e.
>
> ovs-vsctl \
> del-port vnet75 \
> -- del-port vnet78 \

I had followed your advice and used the following command to create the bond

ovs-vsctl \
  del-port vnet75 \
   -- del-port vnet78 \
   -- del-port vnet79 \
   -- del-port vnet77 \
   -- del-port vnet74 \
   -- del-port vnet76 \
   -- add-bond ovsbr-lacp0 bond0 vnet75 vnet78 vnet79 vnet77 vnet74 vnet76 
lacp=active \
   -- set Interface vnet75 \
external_ids='{attached-mac="52:54:00:0d:61:fc", iface-id="", 
iface-status=active, vm-id=""}' \
   -- set Interface vnet78 \
external_ids='{attached-mac="52:54:00:24:36:a7", iface-id="", 
iface-status=active, vm-id=""}' \
   -- set Interface vnet79 \
external_ids='{attached-mac="52:54:00:c7:90:3c", iface-id="", 
iface-status=active, vm-id=""}' \
   -- set Interface vnet77 \
external_ids='{attached-mac="52:54:00:79:8e:a0", iface-id="", 
iface-status=active, vm-id=""}' \
   -- set Interface vnet74 \
external_ids='{attached-mac="52:54:00:aa:fb:bb", iface-id="", 
iface-status=active, vm-id=""}' \
   -- set Interface vnet76 \
external_ids='{attached-mac="52:54:00:d4:cc:88", iface-id="", 
iface-status=active, vm-id=""}'

Note: iface-id and vm-id values have been removed for brevity.

Now the command was successful and I could see the bond0 port with the 
specified interfaces

Bridge ovsbr-lacp0
Port bond0
Interface vnet78
Interface vnet75
Interface vnet79
Interface vnet74
Interface vnet77
Interface vnet76
Port ovsbr-lacp0
Interface ovsbr-lacp0
type: internal
Port vnet72
Interface vnet72

But the bonding is not working correctly

$ sudo ovs-appctl bond/show bond0
 bond0 
bond_mode: active-backup
bond may use recirculation: no, Recirc-ID : -1
bond-hash-basis: 0
lb_output action: disabled, bond-id: -1
updelay: 0 ms
downdelay: 0 ms
lacp_status: configured
lacp_fallback_ab: false
active-backup primary: 
active member mac: 00:00:00:00:00:00(none)

member vnet74: disabled
  may_enable: false

member vnet75: disabled
  may_enable: false

member vnet76: disabled
  may_enable: false

member vnet77: disabled
  may_enable: false

member vnet78: disabled
  may_enable: false

member vnet79: disabled
  may_enable: false

I have configured bonding on an Ubuntu 22.04 at the other end with following 
configuration:

  bonds:
bond0:
  addresses: [192.168.201.141/24]
  interfaces:
- enp2s0
- enp3s0
- enp4s0
- enp5s0
- enp6s0
- enp7s0
  parameters:
mode: 802.3ad
mii-monitor-interval: 100

And I get this error in dmesg: bond0: Warning: No 802.3ad response from the 
link partner for any adapters in the bond

In Ubuntu the bond mode is 802.3ad, while in ovs its shows as active-backup 
could that be the reason for bond not getting online?

I am kind of stuck here!

X.
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] Bonding configuration for KVM guests

2023-10-12 Thread Ilya Maximets via discuss
On 10/12/23 15:39, Xuo Guoto via discuss wrote:
> Thanks for your reply!
> 
> --- Original Message ---
> On Thursday, October 12th, 2023 at 6:48 PM, Ilya Maximets 
>  wrote:
> 
> 
>> You currently have port vnet75 with an interface vnet75, and the
>> port vnet78 with interface vnet78.
> 
> The differentiation between port and interface was new to me! Thanks!

'ovs-vsctl show' command makes the structure a little easier to see.

> 
>> But you want a port bond0 with interfaces
>> vnet75 and vnet78. In order to achieve
>> that you need to remove ports vnet75 and
>> vnet78 first, and then create a port
>> bond0.
> 
> How can I remove ports vnet75 and vnet78 without touching the underlying 
> interface? I have the VM1 running and is connected to the bridge, can the 
> ports be removed without disturbing the VM?

It might be possible by manually crafting OVSDB transactions, but
it's very prone to errors and I would not recommend that.

I'd recommend removing ports and creating a bond in a single
transaction, by chaining operations with '--':

 ovs-vsctl del-port vnet75 \
-- del-port vnet78 \
-- add-bond ovsbr-lacp0 bond0 vnet75 vnet78 lacp=active

The problem with this though is that you will loose configuration
applied to the interfaces while removing them anyway.  For example,
these interfaces will no longer have their external_ids.
If you want to preserve these, you'll need to re-add them manually.
Potentially as part of the same transaction, by adding more commands,
i.e.

 ovs-vsctl \
  del-port vnet75 \
   -- del-port vnet78 \
   -- add-bond ovsbr-lacp0 bond0 vnet75 vnet78 lacp=active \
   -- set Interface vnet75 \
external_ids='{attached-mac="52:54:00:0d:61:fc", iface-id="..", 
iface-status=active, vm-id=".."}' \
some_other_column= \
   -- set Interface vnet78
external_ids='{attached-mac="52:54:00:24:36:a7", iface-id="..", 
iface-status=active, vm-id=".."}' \
   ...

You may still have some slight network disruption though.
However, since you're enabling LACP you will have disruption anyway
until you bond these interfaces and enable LACP inside VM as well.

Best regards, Ilya Maximets.
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] Bonding configuration for KVM guests

2023-10-12 Thread Xuo Guoto via discuss
Thanks for your reply!

--- Original Message ---
On Thursday, October 12th, 2023 at 6:48 PM, Ilya Maximets  
wrote:


> You currently have port vnet75 with an interface vnet75, and the
> port vnet78 with interface vnet78.

The differentiation between port and interface was new to me! Thanks!

> But you want a port bond0 with interfaces
> vnet75 and vnet78. In order to achieve
> that you need to remove ports vnet75 and
> vnet78 first, and then create a port
> bond0.

How can I remove ports vnet75 and vnet78 without touching the underlying 
interface? I have the VM1 running and is connected to the bridge, can the ports 
be removed without disturbing the VM?

X.

___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] Bonding configuration for KVM guests

2023-10-12 Thread Ilya Maximets via discuss
On 10/12/23 14:58, Xuo Guoto via discuss wrote:
> Hello all,
> 
> I am trying to bond two interfaces connecting my running VM with OVS.
> 
> I have a bridge ovsbr-lacp0 with 7 virtio interfaces connected to two VMs, 6 
> in VM1 and one in VM2.
> 
> # ovs-vsctl list-ifaces ovsbr-lacp0
> vnet72
> vnet74
> vnet75
> vnet76
> vnet77
> vnet78
> vnet79
> 
> # ovs-vsctl -f table --columns=name,external_id list interface | grep 
> 274ce169-b166-45dc-ba1d-7faa8fea3673
> vnet75       {attached-mac="52:54:00:0d:61:fc", iface-id="..", 
> iface-status=active, vm-id=".."}
> vnet78       {attached-mac="52:54:00:24:36:a7", iface-id="..", 
> iface-status=active, vm-id=".."}
> vnet79       {attached-mac="52:54:00:c7:90:3c", iface-id="..", 
> iface-status=active, vm-id=".."}
> vnet77       {attached-mac="52:54:00:79:8e:a0", iface-id="..", 
> iface-status=active, vm-id=".."}
> vnet74       {attached-mac="52:54:00:aa:fb:bb", iface-id="..", 
> iface-status=active, vm-id=".."}
> vnet76       {attached-mac="52:54:00:d4:cc:88", iface-id="..", 
> iface-status=active, vm-id=".."}
> 
> Where 274ce169-b166-45dc-ba1d-7faa8fea3673 is the UUID of VM1
> 
> # sudo ovs-vsctl -f table --columns=name,external_id list interface | grep 
> 2075bff5-ee89-492e-b50c-36bd3b92b662
> vnet72       {attached-mac="52:54:00:fd:fe:f6", iface-id="..", 
> iface-status=active, vm-id=".."}
> 
> and 2075bff5-ee89-492e-b50c-36bd3b92b662 is the UUID of VM2. I have removed 
> the iface-id and vm-id so that the output is easy to read.
> 
> Now I want to configure bonding for all the interface in VM1.
> 
> # ovs-vsctl add-bond  ovsbr-lacp0 bond0 vnet75 vnet78 lacp=active
> ovs-vsctl: cannot create an interface named vnet75 because a port named 
> vnet75 already exists on bridge ovsbr-lacp0
> 
> # ovs-vsctl --may-exist add-bond  ovsbr-lacp0 bond0 vnet75 vnet78 lacp=active
> ovs-vsctl: cannot create an interface named vnet75 because a port named 
> vnet75 already exists on bridge ovsbr-lacp0
> 
> I am guessing I am doing some thing wrong, but not able to figure out what. 
> Any help to get this working will be much appreciated.

'add-bond' command creates a 'port' with two or more 'interfaces'.
These interfaces are created as part of the port creation.  So,
"add-bond  ovsbr-lacp0 bond0 vnet75 vnet78" creates a 'port' named
bond0, creates two interfaces vnet75 and vnet78, and adds them into
a port.  But interfaces vnet75 and vnet78 already exist, so the
command fails.  The 'may-exist' flag only check for existence of
the port, not interfaces in it.

You currently have port vnet75 with an interface vnet75, and the
port vnet78 with interface vnet78.  But you want a port bond0
with interfaces vnet75 and vnet78.  In order to achieve that you
need to remove ports vnet75 and vnet78 first, and then create
a port bond0.

HTH
Best regards, Ilya Maximets.
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


[ovs-discuss] Bonding configuration for KVM guests

2023-10-12 Thread Xuo Guoto via discuss
Hello all,

I am trying to bond two interfaces connecting my running VM with OVS.

I have a bridge ovsbr-lacp0 with 7 virtio interfaces connected to two VMs, 6 in 
VM1 and one in VM2.

# ovs-vsctl list-ifaces ovsbr-lacp0
vnet72
vnet74
vnet75
vnet76
vnet77
vnet78
vnet79

# ovs-vsctl -f table --columns=name,external_id list interface | grep 
274ce169-b166-45dc-ba1d-7faa8fea3673
vnet75 {attached-mac="52:54:00:0d:61:fc", iface-id="..", iface-status=active, 
vm-id=".."}
vnet78 {attached-mac="52:54:00:24:36:a7", iface-id="..", iface-status=active, 
vm-id=".."}
vnet79 {attached-mac="52:54:00:c7:90:3c", iface-id="..", iface-status=active, 
vm-id=".."}
vnet77 {attached-mac="52:54:00:79:8e:a0", iface-id="..", iface-status=active, 
vm-id=".."}
vnet74 {attached-mac="52:54:00:aa:fb:bb", iface-id="..", iface-status=active, 
vm-id=".."}
vnet76 {attached-mac="52:54:00:d4:cc:88", iface-id="..", iface-status=active, 
vm-id=".."}

Where 274ce169-b166-45dc-ba1d-7faa8fea3673 is the UUID of VM1

# sudo ovs-vsctl -f table --columns=name,external_id list interface | grep 
2075bff5-ee89-492e-b50c-36bd3b92b662
vnet72 {attached-mac="52:54:00:fd:fe:f6", iface-id="..", iface-status=active, 
vm-id=".."}

and 2075bff5-ee89-492e-b50c-36bd3b92b662 is the UUID of VM2. I have removed the 
iface-id and vm-id so that the output is easy to read.

Now I want to configure bonding for all the interface in VM1.

# ovs-vsctl add-bond ovsbr-lacp0 bond0 vnet75 vnet78 lacp=active
ovs-vsctl: cannot create an interface named vnet75 because a port named vnet75 
already exists on bridge ovsbr-lacp0

# ovs-vsctl --may-exist add-bond ovsbr-lacp0 bond0 vnet75 vnet78 lacp=active
ovs-vsctl: cannot create an interface named vnet75 because a port named vnet75 
already exists on bridge ovsbr-lacp0

I am guessing I am doing some thing wrong, but not able to figure out what. Any 
help to get this working will be much appreciated.

X.___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss