Linux

Virsh 無法連接到 ovirt 管理程序

  • June 28, 2021

我安裝了 Ovirt 並想為 NAT 添加網路介面。所以我需要通過virsh連接到hypervisor並添加nic。

Ovirt 安裝在我的本地伺服器上,主機(ovirt-engine.kvmserver.net)在同一台伺服器上。

我嘗試以可讀模式連接沒問題

# virsh -r
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
      'quit' to quit

virsh > list
Id    Name                           State
----------------------------------------------------
10    CentOS_test                    running
12    CentOS_test2                   running
16    Windows1                       running
17    Windows2                       running

在正常模式下

# virsh
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
      'quit' to quit

virsh # list
Please enter your authentication name:
Please enter your password:
error: Failed to reconnect to the hypervisor
error: no valid connection
error: authentication failed: Failed to step SASL negotiation: -1 (SASL(-1): generic failure: All-whitespace username.)

據我了解,我需要連接證書。我試過https

# virsh connect https://ovirt-engine.kvmserver.net
2013-05-12 13:21:30.004+0000: 25581: info : libvirt version: 0.10.2, package: 18.el6_4.4 (CentOS BuildSystem <http://bugs.centos.org>, 2013-04-18-16:13:45, c6b7.bsys.dev.centos.org)
2013-05-12 13:21:30.004+0000: 25581: warning : virNetTLSContextCheckCertificate:1102 : Certificate check failed Certificate [session] owner does not match the hostname ovirt-engine.kvmserver.net
error: Failed to connect to the hypervisor
error: authentication failed: Failed to verify peer's certificate

我試過80埠

# virsh connect http://ovirt-engine.kvmserver.net:80
error: Failed to connect to the hypervisor
error: authentication failed: TLS handshake failed A TLS packet with unexpected length was received.

我應該如何連接到管理程序?

我找到了解決方案!

問題出在“使用 SASL 身份驗證的遠端管理”上。我沒有為 SASL 創建特殊使用者。創建使用者命令是

# saslpasswd2 -a libvirt USERNAME
Password:
Again (for verification):

就這樣。

你也可以試試這個(在 這裡找到)

virsh -c qemu:///system?authfile=/etc/ovirt-hosted-engine/virsh_auth.conf

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