Hi, I''ve just finished my first attempt at making anything in ruby. It ended up beeing a module to facter, which collects facts about the number of domU''s and the memory, id and vcpu facts on all of the domU''s. It''s meant to be run on the dom0, and uses the xm utility to get the information. The only thing I haven''t figured out, is how to ignore the facts if it''s run on a machine that''s not a domU... ;-) But it''s probably a trivial thing... ? Right? -- Med venlig hilsen Juri Rischel Jensen Fab:IT ApS Vesterbrogade 50 DK-1620 København Tlf: 70 202 407 / Fax: 33 313 640 www.fab-it.dk / juri@fab-it.dk _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Sun, 2007-01-21 at 22:39 +0100, Juri Rischel Jensen wrote:> I''ve just finished my first attempt at making anything in ruby. It > ended up beeing a module to facter, which collects facts about the > number of domU''s and the memory, id and vcpu facts on all of the domU''s. > > It''s meant to be run on the dom0, and uses the xm utility to get the > information.This is excellent ! Though given the unclear future of xen upstream compared to kvm and lhype, this would be even more future proof if you used virsh (from libvirt) instead of xm. The two commands you''ll probably need are ''virsh list'' and ''virsh dominfo''> The only thing I haven''t figured out, is how to ignore the facts if > it''s run on a machine that''s not a domU... ;-) But it''s probably a > trivial thing... ? Right?I am not 100% certain that that''s the official way to check, but you could check to see if the file /sys/hypervisor/uuid exists and has a uuid with all zeros in it. David
On Jan 21, 2007, at 3:39 PM, Juri Rischel Jensen wrote:> Hi, > > I''ve just finished my first attempt at making anything in ruby. It > ended up beeing a module to facter, which collects facts about the > number of domU''s and the memory, id and vcpu facts on all of the > domU''s. > > It''s meant to be run on the dom0, and uses the xm utility to get > the information. > > The only thing I haven''t figured out, is how to ignore the facts if > it''s run on a machine that''s not a domU... ;-) But it''s probably a > trivial thing... ? Right? > > <xendomains.rb>Can you file these as a feature request with the rb file attached (in the facter Trac instance, not Puppet)? I don''t have another release of Facter planned just yet, but that will at least store the file in a place where others can get to it. Thanks. -- The leader of Jamestown was "John Smith" (not his real name), under whose direction the colony engaged in a number of activities, primarily related to starving. -- Dave Barry, "Dave Barry Slept Here" --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Hi Luke On Jan 24, 2007, at 19:21, Luke Kanies wrote:> Can you file these as a feature request with the rb file attached (in > the facter Trac instance, not Puppet)?I''ve just tried to do it, but it seems that I don''t have permission to create new tickets... (my username is jrisch). -- Med venlig hilsen Juri Rischel Jensen Fab:IT ApS Vesterbrogade 50 DK-1620 København Tlf: 70 202 407 / Fax: 33 313 640 www.fab-it.dk / juri@fab-it.dk
On Jan 23, 2007, at 3:39, David Lutterkort wrote:> This is excellent ! Though given the unclear future of xen upstream > compared to kvm and lhype, this would be even more future proof if you > used virsh (from libvirt) instead of xm. The two commands you''ll > probably need are ''virsh list'' and ''virsh dominfo''Hmm, I''d like to do that. But libvirt is not a part of Debian stable - or Debian at all it seems. I''ll make the changes when libvirt becomes a part of Debian...> >> The only thing I haven''t figured out, is how to ignore the facts if >> it''s run on a machine that''s not a domU... ;-) But it''s probably a >> trivial thing... ? Right? > > I am not 100% certain that that''s the official way to check, but you > could check to see if the file /sys/hypervisor/uuid exists and has a > uuid with all zeros in it.Hmm, that doesn''t seem to be a valid check. Neither my domU''s nor my dom0''s has that file in /sys/... ?? -- Med venlig hilsen Juri Rischel Jensen Fab:IT ApS Vesterbrogade 50 DK-1620 København Tlf: 70 202 407 / Fax: 33 313 640 www.fab-it.dk / juri@fab-it.dk
On Jan 25, 2007, at 3:48 AM, Juri Rischel Jensen wrote:> Hi Luke > > On Jan 24, 2007, at 19:21, Luke Kanies wrote: >> Can you file these as a feature request with the rb file attached (in >> the facter Trac instance, not Puppet)? > > I''ve just tried to do it, but it seems that I don''t have permission > to create new tickets... (my username is jrisch).It should work now; please try again and let me know if it does not. -- The death rate on Earth is: .... (computing) .... One per person. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com