0

I have cloned a module for virtual machines, but when I try to apply a virtual machine to a node, I get Error: Could not find a suitable provider for virt, which is understandable given that the contents of init.pp specify that a virtualization-capable kernel should already be running (a Xen or OpenVZ kernel).

However, with the included init.pp, I'd expect a failure message somewhere when running puppet agent --test --debug on the node:

class virt {

  fail "testfail"

  case $::virtual {
    /^xen/: { include virt::xen }
    #/^kvm/: { include virt::kvm }
    /^openvzhn/: { include virt::openvz }
  }
}

But it fails with the error above, Error: Could not find a suitable provider for virt. My node definition:

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"
  }
}

1 Answer 1

3

In the node definition, you are not using the class virt, but the custom type virt.

You'll find it in modulename/lib/puppet/type.

It needs a provider, (modulename/lib/puppet/provider) but cannot find one suitable for your system.

To include the class virt, you could use one of the following:

include virt or class ( 'virt': }

The reason it's not working; you are probably missing one of these binaries: (taken from provider)

commands :virtinstall => "/usr/bin/virt-install"
commands :virsh => "/usr/bin/virsh"
commands :grep => "/bin/grep"
commands :ip => "/sbin/ip"

That; or you don't have this:

confine :feature => :libvirt
3
  • The reason it's not working; you are probably missing one of these binaries: commands :virtinstall => "/usr/bin/virt-install" commands :virsh => "/usr/bin/virsh" commands :grep => "/bin/grep" commands :ip => "/sbin/ip" # The provider is chosen by virt_type, not by operating system confine :feature => :libvirt Apr 14, 2013 at 14:24
  • I now realize what I did wrong, thank you so much! I have been banging my head on this for days.
    – Zsub
    Apr 14, 2013 at 18:12
  • I included virt in the node definition
    – Zsub
    Apr 18, 2013 at 17:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .