OpenNebula / one

The open source Cloud & Edge Computing Platform bringing real freedom to your Enterprise Cloud 🚀
http://opennebula.io
Apache License 2.0
1.23k stars 479 forks source link

Changing the VLAN tag of virtual network caused issues with the openswitch. #6698

Open nookeist opened 1 month ago

nookeist commented 1 month ago

Description When I change the VLAN tag in the Virtual network, Nebula pushes the tag to the ports of the virtual machine and breaks the OpenvSwitch.

To Reproduce Change VLAN tag in Virtual Network

Expected behavior The tag should be changed to openvswitch and in the context of the virtual machine

Details

Additional context In affected vm log

New LCM state is HOTPLUG_NIC
Command execution fail (exit code: 1): cat << 'EOT' | /var/tmp/one/vnm/ovswitch/update_nic '7efc699f-0f5b-41a3-ae16-609f747e56bd' '215'
update_nic: Executed "sudo -n ovs-vsctl set Port one-4039-3 tag\=643".
update_nic: Executed "sudo -n ovs-vsctl --if-exists del-port ovsbr0".
update_nic: Command "sudo -n ovs-vsctl add-port ovsbr0" failed.
update_nic: ovs-vsctl: 'add-port' command requires at least 2 arguments
ovs-vsctl: 'add-port' command requires at least 2 arguments
ExitCode: 1
Failed to execute network driver operation: update_nic.
UPDATENIC: 215 ovswitch: INFO: update_nic: Executed "sudo -n ovs-vsctl set Port one-4039-3 tag\=643". INFO: update_nic: Executed "sudo -n ovs-vsctl --if-exists del-port ovsbr0". ERROR: update_nic: Command "sudo -n ovs-vsctl add-port ovsbr0" failed. ERROR: update_nic: ovs-vsctl: 'add-port' command requires at least 2 arguments ovs-vsctl: 'add-port' command requires at least 2 arguments ExitCode: 1

I think the problem here is "sudo -n ovs-vsctl --if-exists del-port ovsbr0". ERROR: update_nic: Command "sudo -n ovs-vsctl add-port ovsbr0" as the port name is not passed.

Progress Status

baby-gnu commented 1 week ago

I had the same kind of problem by just updating the network without changing any value, I make sure the network has the good configuration by updating network regularly:

Log of HOTPLUG_NIC error when updating a network ``` Fri Sep 6 09:56:42 2024 [Z0][VM][I]: New LCM state is HOTPLUG_NIC Fri Sep 6 09:56:42 2024 [Z0][VMM][I]: Command execution fail (exit code: 1): cat << 'EOT' | /var/tmp/one/vnm/ovswitch/update_nic '5672642e-0c31-4e6c-8dff-48743b0f7408' '0' Fri Sep 6 09:56:42 2024 [Z0][VMM][I]: update_nic: Executed "sudo -n ovs-vsctl --if-exists del-port vswitch". Fri Sep 6 09:56:42 2024 [Z0][VMM][E]: update_nic: Command "sudo -n ovs-vsctl add-port vswitch" failed. Fri Sep 6 09:56:42 2024 [Z0][VMM][E]: update_nic: ovs-vsctl: 'add-port' command requires at least 2 arguments Fri Sep 6 09:56:42 2024 [Z0][VMM][I]: ovs-vsctl: 'add-port' command requires at least 2 arguments Fri Sep 6 09:56:42 2024 [Z0][VMM][I]: ExitCode: 1 Fri Sep 6 09:56:42 2024 [Z0][VMM][I]: Failed to execute network driver operation: update_nic. Fri Sep 6 09:56:42 2024 [Z0][VMM][E]: UPDATENIC: 0 ovswitch: INFO: update_nic: Executed "sudo -n ovs-vsctl --if-exists del-port vswitch". ERROR: update_nic: Command "sudo -n ovs-vsctl add-port vswitch" failed. ERROR: update_nic: ovs-vsctl: 'add-port' command requires at least 2 arguments ovs-vsctl: 'add-port' command requires at least 2 arguments ExitCode: 1 Fri Sep 6 09:56:42 2024 [Z0][VM][I]: New LCM state is RUNNING ```

This issue seems solved with OpenNebula 6.10.0-1:

Log arround the update a network where nothing wrong seems to happen ``` Tue Sep 10 16:25:08 2024 [Z0][ReM][D]: Req:9584 UID:0 IP:127.0.0.1 one.vn.update invoked , 0, "NAME = "vswitch" VN_MAD...", 0 Tue Sep 10 16:25:08 2024 [Z0][ReM][D]: Req:9584 UID:0 one.vn.update result SUCCESS, 0 Tue Sep 10 16:25:09 2024 [Z0][VMM][D]: Message received: UPDATENIC SUCCESS 0 0 ovswitch: - ```

I made few tests: