Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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"
  }
}
share|improve this question

1 Answer 1

up vote 3 down vote accepted

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
share|improve this answer
    
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 –  Ger Apeldoorn Apr 14 '13 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 '13 at 18:12
    
I included virt in the node definition –  Zsub Apr 18 '13 at 17:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.