Code Monkey home page Code Monkey logo

puppet-virt's People

Contributors

binbash12 avatar blkperl avatar carlasouza avatar cbliard avatar codec avatar dieb avatar drt24 avatar hakamadare avatar jedi4ever avatar maxdml avatar mroswald avatar ody avatar pecastro avatar rockpapergoat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-virt's Issues

First run error

Puppet version: 0.25.4
Facter version: 1.5.8
Ruby version: 1.8.7

info: Retrieving plugin
notice: /File[/var/puppet/lib/puppet/feature]/ensure: created
notice: /File[/var/puppet/lib/puppet/feature/libvirt.rb]/ensure: content changed '{md5}3c6bbc5d7e9d7aeac9778bd2f5661b1e' to '{md5}3c6bbc5d7e9d7aeac9778bd2f5661b1e'
notice: /File[/var/puppet/lib/puppet/provider/virt]/ensure: created
notice: /File[/var/puppet/lib/puppet/provider/virt/libvirt.rb]/ensure: content changed '{md5}bedca1909c21bbd2114c5c7a9ae64726' to '{md5}bedca1909c21bbd2114c5c7a9ae64726'
notice: /File[/var/puppet/lib/puppet/type/virt.rb]/ensure: content changed '{md5}e7fb62c7f989cfdf6fa682d9f9e6096f' to '{md5}e7fb62c7f989cfdf6fa682d9f9e6096f'
info: Loading downloaded plugin /var/puppet/lib/puppet/feature/libvirt.rb
info: Loading downloaded plugin /var/puppet/lib/puppet/provider/virt/libvirt.rb
Could not autoload virt: undefined method newvalue' for Puppet::Type::Virt::ParameterPxe:Class err: Could not load downloaded file /var/puppet/lib/puppet/provider/virt/libvirt.rb: undefined methodprovide' for nil:NilClass
info: Loading downloaded plugin /var/puppet/lib/puppet/type/virt.rb
info: Redefining virt in Puppet::Type
err: Could not load downloaded file /var/puppet/lib/puppet/type/virt.rb: undefined method `newvalue' for Puppet::Type::Virt::ParameterPxe:Class

inactive domains are not listed (virt_domains_inactive)

Hello carlasouza,

first, thank you for this module ! :o)
The puppet fact "virt_domains_inactive" does not list inactive kvm-domains.
I guess the search fail, because inactive domains do not have an "domid"

See here:

root@kvm-host:~# virsh list --inactive
 Id    Name                           Status
----------------------------------------------------
 -     VM_01                 switched-off
 -     VM_02                   switched-off
 -     VM_03                     switched-off

I`ve changed the search-base to "name", please see my diff from libvirt.rb:

<       libvirt_connect.list_defined_domains.each do |domid|
<         domains.concat([ libvirt_connect.lookup_domain_by_id(domid.to_i).name ])
<       end

---
>       libvirt_connect.list_defined_domains.each do |name|
>       domains.concat([ name ])
>     end

For my purposes this change works:

facter --puppet | grep virt_domains_inactive
virt_domains_inactive => VM_01,VM_02,VM_03

There are also other inactive objects in libvirt that have no ID,
but these should be recognized by this custom fact.

To reflect this there is a need to change from ID to Name at several places.

Best regards,
Stefan L.-S.

Fedora not a supported platform?

Hi Carla,

This module looks like a terrific piece of work and I would like to get actively involved, if I may. However I am having problems getting my first VM going using this module. Both my puppet master and client are running Fedora (16 and 15, respectively) and have had no problems creating VMs manually.

I have this in my node's class:

virt { 'test':
    autoboot        => false,
    ensure          => 'running',
    memory          => '1024',
    os_template     => 'fedora11',
    os_type         => 'linux',
    provider        => 'libvirt',
    virt_path       => '/var/lib/libvirt/images/test.img',
    virt_type       => 'kvm',
}

When I run my 'puppetd --test' for the first time, I get:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload virt: Could not autoload /etc/puppet/modules/puppet-virt/lib/puppet/provider/virt/openvz.rb: Sorry, this provider is not supported for your Operation System, yet :) at /etc/puppet/modules/doubledog/manifests/classes/droopy-f15.pp:31 on node droopy-f15.doubledog.org

Repeated runs result in no errors, but no VM is created either. I am not sure why I only see the error just the first time -- unless I restart the puppetmaster service. However, I am most confused as to why openvz.rb is involved if libvirt is supposed to be my provider. Is this a bug or mistake/misunderstanding that I have? Any help would be most appreciated.

Failed to load library 'libvirt'

Module Version: bb33fa9
Puppet version: 2.6.2
OS: Debian GNU/Linux sqeeze
Installed Packages: libvirt-bin, libvirt0, python-libvirt, virt-viewer, virtinst, vzctl, vzquota

Seeing the following error during a puppet run:

debug: Failed to load library 'libvirt' for feature 'libvirt'
debug: Puppet::Type::Virt::ProviderLibvirt: feature libvirt is missing
err: Could not run Puppet configuration client: Could not find a default provider for virt

Addition information: The module is located in my source tree as modules/virt

Duplicate declaration: Service[undef] is already declared in file virt/manifests/init.pp.

Hi,

puppet: 2.7.18
ubuntu: 12.04 LTS
puppet-virt: git, today

I had a issue with virt/manifests/init.pp

"err: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Service[undef] is already declared in file /etc/puppet/modules/virt/manifests/init.pp at line 18; cannot redeclare at /etc/puppet/modules/virt/manifests/init.pp:23 on node example.com"

I solve this by changing "service { $servicename:" to "service { $virt::params::servicename:" in file /etc/puppet/modules/virt/manifests/init.pp.

Almost forgot, thnx for the work :)

fails to create openvz vm

I tried to create a VM:

        virt { guest-openvz2:
          id => 102,
          virt_type   => 'openvz',
          ensure      => 'installed',
          os_template => 'debian-7.0-x86_64-minimal',
          memory      => 512,
          autoboot    => true,
          interfaces  => ["br0"]
        } 

and somehow, the agent tries to obtain the value of memory size before creating the vm and the config file. I obtained the following backtrace:

Debug: Executing '/usr/sbin/vzlist -1 -a -N guest-openvz2'
Debug: Executing '/usr/sbin/vzctl status 102'
Debug: Executing '/usr/sbin/vzlist -1 -a -N guest-openvz2'
Debug: Executing '/usr/sbin/vzctl status 102'
Debug: Virt[guest-openvz2](provider=openvz): Getting parameter PRIVVMPAGES value
/var/lib/puppet/lib/puppet/provider/virt/openvz.rb:197: warning: class variable access from toplevel
Debug: Executing '/usr/sbin/vzlist -1 -a -N guest-openvz2'
Error: /Virt[guest-openvz2]: Could not evaluate: No such file or directory - /etc/vz/conf/102.conf
/usr/lib/ruby/1.9.1/open-uri.rb:35:in `initialize'
/usr/lib/ruby/1.9.1/open-uri.rb:35:in `open'
/usr/lib/ruby/1.9.1/open-uri.rb:35:in `open'
/var/lib/puppet/lib/puppet/provider/virt/openvz.rb:198:in `get_value'
/var/lib/puppet/lib/puppet/provider/virt/openvz.rb:233:in `memory'
/usr/lib/ruby/vendor_ruby/puppet/property.rb:471:in `retrieve'
/usr/lib/ruby/vendor_ruby/puppet/type.rb:1058:in `block in retrieve'
/usr/lib/ruby/vendor_ruby/puppet/type.rb:1053:in `each'
/usr/lib/ruby/vendor_ruby/puppet/type.rb:1053:in `retrieve'
/usr/lib/ruby/vendor_ruby/puppet/type.rb:1076:in `retrieve_resource'
/usr/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:236:in `from_resource'
/usr/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:19:in `evaluate'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:204:in `apply'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:217:in `eval_resource'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:147:in `call'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:147:in `block (2 levels) in evaluate'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:327:in `block in thinmark'
/usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:326:in `thinmark'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:147:in `block in evaluate'
/usr/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:118:in `traverse'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:138:in `evaluate'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:169:in `block in apply'
/usr/lib/ruby/vendor_ruby/puppet/util/log.rb:149:in `with_destination'
/usr/lib/ruby/vendor_ruby/puppet/transaction/report.rb:112:in `as_logging_destination'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:168:in `apply'
/usr/lib/ruby/vendor_ruby/puppet/configurer.rb:118:in `block in apply_catalog'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:161:in `block in benchmark'
/usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:160:in `benchmark'
/usr/lib/ruby/vendor_ruby/puppet/configurer.rb:117:in `apply_catalog'
/usr/lib/ruby/vendor_ruby/puppet/configurer.rb:224:in `run_internal'
/usr/lib/ruby/vendor_ruby/puppet/configurer.rb:132:in `block in run'
/usr/lib/ruby/vendor_ruby/puppet/context.rb:64:in `override'
/usr/lib/ruby/vendor_ruby/puppet.rb:244:in `override'
/usr/lib/ruby/vendor_ruby/puppet/configurer.rb:131:in `run'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:47:in `block (4 levels) in run'
/usr/lib/ruby/vendor_ruby/puppet/agent/locker.rb:20:in `lock'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:47:in `block (3 levels) in run'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:117:in `with_client'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:44:in `block (2 levels) in run'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:82:in `run_in_fork'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:43:in `block in run'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:179:in `call'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:179:in `controlled_run'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:41:in `run'
/usr/lib/ruby/vendor_ruby/puppet/application/agent.rb:356:in `onetime'
/usr/lib/ruby/vendor_ruby/puppet/application/agent.rb:322:in `run_command'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:381:in `block (2 levels) in run'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:507:in `plugin_hook'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:381:in `block in run'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:488:in `exit_on_fail'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:381:in `run'
/usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:146:in `run'
/usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:92:in `execute'
/usr/bin/puppet:8:in `<main>'

Error messages from vzlist get used as ctids

I got this error message:
Error: /Virt[test-1]: Could not evaluate: Execution of '/usr/sbin/vzctl status Unable' returned 21: Bad CT ID Unable

Looking in puppet-virt/lib/puppet/provider/virt/openvz.rb I see:

  # Returns all host's guests
  def self.instances
    guests = []
    execpipe "#{vzlist} --no-header -a -o ctid" do |process|
    process.collect do |line|
      next unless options = parse(line)
        guests << new(options)
      end
    end
    guests
  end

Unfortunately if I run:

    $ sudo vzlist --no-header -a -o ctid

I get

    Unable to open /proc/vz/veinfo: No such file or directory
    Unable to open /proc/user_beancounters: No such file or directory

(as OpenVZ is not properly set up) Unfortunately vzlist does not return an error code in this case. Perhaps some validation of its output would solve this problem and prevent garbage spreading through the code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.