Hello everyone,
While discovering puppet, I just figured out that facter does not
recognise my server as Xen HVM DomU, at least not in virtual fact:
# facter
facterversion => 1.5.1
manufacturer => Xen
operatingsystem => Debian
operatingsystemrelease => 5.0.5
productname => HVM domU
puppetversion => 0.25.4
rubyversion => 1.8.7
type => Other
virtual => physical
My dom0 is ok: virtual => xen0
The problem is that I want to use virtual fact to manage grub menu.lst
options related to xen. For the moment, I'm trying to use virtual fact.
A quick look into virtual.rb, and a dirty hack later, I can see my HVM
domU as what they are. Now I wonder to know if I use the right fact ?
Regards,
JB
Here's my diff:
# diff -C 10 /usr/lib/ruby/1.8/facter/virtual.rb
/usr/lib/ruby/1.8/facter/virtual.rb.xen
*** /usr/lib/ruby/1.8/facter/virtual.rb 2010-08-07 14:20:31.000000000 +0200
--- /usr/lib/ruby/1.8/facter/virtual.rb.xen 2010-08-07
14:20:09.000000000 +0200
***************
*** 34,53 ****
--- 34,54 ----
end
end
if result == "physical"
output = Facter::Util::Resolution.exec('lspci')
if not output.nil?
output.each_line do |p|
# --- look for the vmware video card to determine
if it is virtual => vmware.
# --- 00:0f.0 VGA compatible controller:
VMware Inc [VMware SVGA II] PCI Display Adapter
result = "vmware" if p =~ /VM[wW]are/
+ result = "xenhvm" if p =~ /XenSource/
end
else
output = Facter::Util::Resolution.exec('dmidecode')
if not output.nil?
output.each_line do |pd|
result = "vmware" if pd =~ /VMware|Parallels/
end
else
output = Facter::Util::Resolution.exec('prtdiag')
if not output.nil?
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.