virt-install 在 qemu-kvm 中创建实例时出错

virt-install 在 qemu-kvm 中创建实例时出错

操作系统:Debian 10.4 libvirtd 版本:5.0.0

你好!

我需要在 qemu-kvm 中创建一个实例。使用以下命令:

virt-install --connect qemu:///system --virt-type kvm --name test01 --ram=2048 --vcpus=2 --disk /opt/test01/test01.img,bus=virtio,size=10 --pxe --boot uefi --noautoconsole --graphics none  --hvm  --network bridge:eth0  --description "Test VM with w2k16" --os-type=windows --debug

但他回答说:

[Fri, 26 Mar 2021 10:26:07 virt-install 1172] DEBUG (cli:253)   File "/usr/share/virt-manager/virt-install", line 955, in <module>
    sys.exit(main())
  File "/usr/share/virt-manager/virt-install", line 949, in main
    start_install(guest, installer, options)
  File "/usr/share/virt-manager/virt-install", line 625, in start_install
    fail(e, do_exit=False)
  File "/usr/share/virt-manager/virtinst/cli.py", line 253, in fail
    logging.debug("".join(traceback.format_stack()))

[Fri, 26 Mar 2021 10:26:07 virt-install 1172] ERROR (cli:254) Unable to add bridge eth0 port vnet0: Operation not supported
[Fri, 26 Mar 2021 10:26:07 virt-install 1172] DEBUG (cli:256) 
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-install", line 598, in start_install
    transient=options.transient)
  File "/usr/share/virt-manager/virtinst/installer.py", line 419, in start_install
    doboot, transient)
  File "/usr/share/virt-manager/virtinst/installer.py", line 362, in _create_guest
    domain = self.conn.createXML(install_xml or final_xml, 0)
  File "/usr/lib/python3/dist-packages/libvirt.py", line 3732, in createXML
    if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)
libvirt.libvirtError: Unable to add bridge eth0 port vnet0: Operation not supported
[Fri, 26 Mar 2021 10:26:07 virt-install 1172] DEBUG (cli:267) Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect qemu:///system start test01
otherwise, please restart your installation.
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect qemu:///system start test01
otherwise, please restart your installation.
root@ctng-flc-test01:/opt/test01#   virsh --connect qemu:///system start test01
error: failed to get domain 'test01'

Debian 中的 br0 正常,他可以 ping 物理网络中的其他 IP。我可以使用 BR0 IP 建立和接收 ssh 连接。

我不明白父错误是什么:

Domain installation does not appear to have been successful.

或者

ERROR (cli:254) Unable to add bridge eth0 port vnet0: Operation not supported

以及如何修复它们。

再次感谢!

答案1

bridge=BRIDGE
  Connect to a bridge device in the host called BRIDGE.
  Use this option if the host has static networking config & the guest requires
  full outbound and inbound connectivity  to/from the LAN.
  Also use this if live migration will be used with this guest.

--network bridge=<bridge_iface_not_phys_iface>, IE。--network bridge=br0

相关内容