Kvm-Virtualization

在 qemu-kvm 中創建實例的 virt-install 錯誤

  • March 26, 2021

作業系統: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'

br0 在 Debian 中沒問題,他在物理網路中 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

以及如何解決它們。

再次感謝!

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.

引用自:https://serverfault.com/questions/1058402