我已经为虚拟机克隆了一个模块,但是当我尝试将虚拟机应用到节点时,我得到了Error: Could not find a suitable provider for virt
,这是可以理解的,因为 init.pp 的内容指定一个支持虚拟化的内核应该已经在运行(一个 Xen或 OpenVZ 内核)。
但是,对于包含的 init.pp,我希望puppet agent --test --debug
在节点上运行时某处出现失败消息:
class virt {
fail "testfail"
case $::virtual {
/^xen/: { include virt::xen }
#/^kvm/: { include virt::kvm }
/^openvzhn/: { include virt::openvz }
}
}
但它因上述错误而失败,Error: Could not find a suitable provider for virt
. 我的节点定义:
node 'hostname' {
# common is a custom module including SSH keys, works fine
include common
virt { "1001":
memory => 1024,
cpus => 4,
tmpl_cache => "debian-6.0-x86_64",
ensure => running,
virt_type => "openvz"
}
}