oVirt-virsh需要账号密码

/ oVirt / 没有评论 / 504浏览

前提:virsh操作时,需要输入账号密码

[root@a-kvm-t-1 ~]# virsh list --all
Please enter your authentication name: root
Please enter your password: 
error: Failed to reconnect to the hypervisor
error: no valid connection
error: authentication failed: authentication failed

解决方案

[root@a-kvm-t-1 ~]# saslpasswd2 -a libvirt admin
Password:  # 输入密码
Again (for verification): # 确认密码
[root@a-kvm-t-1 ~]# virsh list --all            
Please enter your authentication name: admin
Please enter your password: #密码
 Id    Name                           State
----------------------------------------------------
 1     kvm-1                          running
 2     kvm-2                          running
 -     kvm-3                          shut off
# 可以看出创建密码后可以通过virsh正常管理kvm虚拟机