我尝试使用gem ruby-libvirt连接到Hyper-V 2008 R2服务器。我一直收到以下错误:Call to virConnectOpenAuth failed: internal error: Transport error during enumeration: Could not connect (7) (Libvirt::ConnectionError)
。
但是,使用相同代码连接到Hyper-V 2012服务器可以正常工作。
我犯了错误吗? 以下是我使用的代码(遵循libvirt文档http://libvirt.org/ruby/examples/open_auth.rb)
conn = Libvirt::open_auth('hyperv://my_server/?transport=http',
[Libvirt::CRED_AUTHNAME, Libvirt::CRED_PASSPHRASE],
"") do |cred|
if cred["type"] == Libvirt::CRED_AUTHNAME
res = "username"
elsif cred["type"] == Libvirt::CRED_PASSPHRASE
res = "passwd"
else
raise "Unsupported credential #{cred['type']}"
end
res
end
最重要的是,libvirt doc说它支持Hyper-V 2008 R2(http://libvirt.org/drvhyperv.html),但是这里(https://www.redhat.com/archives/libvir-list/2014-April/msg00802。 html)据说它可能不再是由于Hyper-V 2012.这会是问题吗?
我使用ruby-libvirt 0.5.2和libvirt 1.2.2。
感谢您的帮助!