Created
June 12, 2018 18:03
-
-
Save jrich523/3afa7a06f87da0e61f9e2f7102cfcc53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kvms ||= Array.new | |
nodes.each do |n| | |
kvms.push( | |
site: n.dig('facts', 'ss_site'), | |
hostname: n.dig('facts', 'hostname'), | |
guest_count: (n.dig('facts', 'kvm', 'guests') || []).count, | |
mem_used: n.dig('facts', 'memory', 'system', 'used'), | |
mem_total: n.dig('facts', 'memory', 'system', 'total'), | |
mem_per_used: n.dig('facts', 'memory', 'system', 'capacity'), | |
vcpu_used: n.dig('facts', 'kvm', 'usedvcpus'), | |
vcpu_max: n.dig('facts', 'kvm', 'maxvcpus'), | |
disk_used: n.dig('facts', 'kvm', 'pool', 'default', 'allocation'), | |
disk_total: n.dig('facts', 'kvm', 'pool', 'default', 'capacity') | |
) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment