停止 openvswitch-switch 服务会破坏 netplan

停止 openvswitch-switch 服务会破坏 netplan

上周我将系统升级到了 Jammy Jellyfish 22.04。现在,当我尝试执行systemctl stop openvswitch-switch该命令时,openvswitch 停止了(预期)。但这样做会破坏 netplan。

因此,在 openvswitch 停止后,如果我尝试更改 netplan 并执行以下操作,sudo netplan apply则会收到此错误:

# sudo netplan apply
ovs-vsctl: unix:/var/run/openvswitch/db.sock: database connection failed (No such file or directory)
Traceback (most recent call last):
  File "/usr/sbin/netplan", line 23, in <module>
    netplan.main()
  File "/usr/share/netplan/netplan/cli/core.py", line 50, in main
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 247, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 61, in run
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 247, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 167, in command_apply
    NetplanApply.process_ovs_cleanup(config_manager, old_files_ovs, restart_ovs, exit_on_error)
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 394, in process_ovs_cleanup
    apply_ovs_cleanup(config_manager, ovs_old, ovs_current)
  File "/usr/share/netplan/netplan/cli/ovs.py", line 138, in apply_ovs_cleanup
    out = subprocess.check_output([OPENVSWITCH_OVS_VSCTL, '--columns=name,external-ids',
  File "/usr/lib/python3.10/subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/bin/ovs-vsctl', '--columns=name,external-ids', '-f', 'csv', '-d', 'bare', '--no-headings', 'list', 'Port']' returned non-zero exit status 1.

以下是已安装的版本(我安装了 dpdk)

# sudo apt list | grep openvswitch

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

neutron-openvswitch-agent/jammy-updates 2:20.2.0-0ubuntu1 all
openvswitch-common/jammy-updates,now 2.17.2-0ubuntu0.22.04.2 amd64 [installed,automatic]
openvswitch-dbg/jammy-updates 2.17.2-0ubuntu0.22.04.2 amd64
openvswitch-doc/jammy-updates 2.17.2-0ubuntu0.22.04.2 all
openvswitch-ipsec/jammy-updates 2.17.2-0ubuntu0.22.04.2 amd64
openvswitch-pki/jammy-updates 2.17.2-0ubuntu0.22.04.2 all
openvswitch-source/jammy-updates 2.17.2-0ubuntu0.22.04.2 all
openvswitch-switch-dpdk/jammy-updates,now 2.17.2-0ubuntu0.22.04.2 amd64 [installed]
openvswitch-switch/jammy-updates,now 2.17.2-0ubuntu0.22.04.2 amd64 [installed,automatic]
openvswitch-test/jammy-updates 2.17.2-0ubuntu0.22.04.2 all
openvswitch-testcontroller/jammy-updates 2.17.2-0ubuntu0.22.04.2 amd64
openvswitch-vtep/jammy-updates 2.17.2-0ubuntu0.22.04.2 amd64
python3-openvswitch/jammy-updates,now 2.17.2-0ubuntu0.22.04.2 all [installed,automatic]

有人知道如何修复 netplan 以便它在 openvswitch 停止时继续工作?

相关内容