Hey guys,
I’d like to propose a patch/extension (or a new ohai plugin) for the
virtualization attribute.
http://img41.yfrog.com/i/rjc.png/
Code here:
# Plugin to extend the virtualization attributes in a Xen Host
require_plugin 'virtualization'
provides 'virtualization_extensions'
if not virtualization.nil? and virtualization[:role] == 'host'
# create a guest_list attributte listing all the guests running
if virtualization[:emulator] == 'xen'
virtualization[:guest_list] = Mash.new
`xm list | egrep -v '^(Domain-0|Name)'`.each_line do |g|
name, id, mem, vcpus, state, time = g.split
virtualization[:guest_list][name] = Mash.new
virtualization[:guest_list][name][:id] = id.strip
virtualization[:guest_list][name][:vcpus] = vcpus.strip
virtualization[:guest_list][name][:mem] = mem.strip
virtualization[:guest_list][name][:time] = time.strip
virtualization[:guest_list][name][:state] = state.strip
end
# create a host_info attribute with the info extracted from the xm info command
virtualization[:host_info] = Mash.new
This file has been truncated. show original
Needs better error checking, platform detection and so on, but the
basic idea is there.
What do you guys think?
Cheers!
On Tue, Sep 29, 2009 at 10:12 AM, Sergio Rubio rubiojr.ml@gmail.com wrote:
Hey guys,
Hi Sergio!
I'd like to propose a patch/extension (or a new ohai plugin) for the
virtualization attribute.
Interesting!
http://img41.yfrog.com/i/rjc.png/
Code here:
ohai-plugins/virtualization_extensions.rb at master · rubiojr/ohai-plugins · GitHub
Needs better error checking, platform detection and so on, but the
basic idea is there.
Seems to be Xen centric.. are there any plans for including KVM (or
VMware / OpenVZ)
I like the concept though
What do you guys think?
Cheers!
Joel
--
$ echo "kpfmAdpoofdufevq/dp/vl" | perl -pe 's/(.)/chr(ord($1)-1)/ge'
On Tue, Sep 29, 2009 at 11:40 AM, Joel Merrick joel.merrick@gmail.com wrote:
On Tue, Sep 29, 2009 at 10:12 AM, Sergio Rubio rubiojr.ml@gmail.com wrote:
Hey guys,
Hi Sergio!
I'd like to propose a patch/extension (or a new ohai plugin) for the
virtualization attribute.
Interesting!
http://img41.yfrog.com/i/rjc.png/
Code here:
ohai-plugins/virtualization_extensions.rb at master · rubiojr/ohai-plugins · GitHub
Needs better error checking, platform detection and so on, but the
basic idea is there.
Seems to be Xen centric.. are there any plans for including KVM (or
VMware / OpenVZ)
We are a Xen shop, dunno if I'll have the chance or the energy to
support other virt. technologies...
Anyway, the attributes are only pushed if the chef client is a Xen
host, so it could be an standalone plugin called xen_linux_host or
something similar.
Cheers!
I like the concept though
What do you guys think?
Cheers!
Joel
--
$ echo "kpfmAdpoofdufevq/dp/vl" | perl -pe 's/(.)/chr(ord($1)-1)/ge'
On Tue, Sep 29, 2009 at 2:12 AM, Sergio Rubio rubiojr.ml@gmail.com wrote:
I'd like to propose a patch/extension (or a new ohai plugin) for the
virtualization attribute.
http://img41.yfrog.com/i/rjc.png/
Code here:
ohai-plugins/virtualization_extensions.rb at master · rubiojr/ohai-plugins · GitHub
Needs better error checking, platform detection and so on, but the
basic idea is there.
What do you guys think?
I'm happy to see more data in Ohai. File a ticket, and a pointer to a
fork of ohai with the extensions integrated.
Adam
--
Opscode, Inc.
Adam Jacob, CTO
T: (206) 508-7449 E: adam@opscode.com