Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inactive domains are not listed (virt_domains_inactive) #22

Open
sls83 opened this issue Feb 24, 2014 · 0 comments
Open

inactive domains are not listed (virt_domains_inactive) #22

sls83 opened this issue Feb 24, 2014 · 0 comments

Comments

@sls83
Copy link

sls83 commented Feb 24, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant