Module: Ohai::Mixin::DmiDecode

Defined in:
lib/ohai/mixin/dmi_decode.rb

Overview

Instance Method Summary collapse

Instance Method Details

#guest_from_dmi_data(manufacturer, product, version) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/ohai/mixin/dmi_decode.rb', line 21

def guest_from_dmi_data(manufacturer, product, version)
  case manufacturer
  when /OpenStack/
    return "openstack"
  when /Xen/
    return "xen"
  when /VMware/
    return "vmware"
  when /Microsoft/
    return "hyperv" if product.include?("Virtual Machine")
  when /Amazon EC2/
    return "amazonec2"
  when /QEMU/
    return "kvm"
  when /Veertu/
    return "veertu"
  when /Parallels/
    return "parallels"
  end

  case product
  when /VirtualBox/
    return "vbox"
  when /OpenStack/ # yes this is here twice. Product catches Red Hat's version
    return "openstack"
  when /(KVM|RHEV)/
    return "kvm"
  when /BHYVE/
    return "bhyve"
  end

  nil # doesn't look like a virt
end