0

I have a code block that successfully detects if a VM is a VMware VM:

if node['hostnamectl']['virtualization'].include? "vmware"
  include_recipe "system_baseline::vmware"
 ....

However if I try the same thing with AWS it does not seem to work:

if node['hostnamectl']['virtualization'].include? "xen"
  include_recipe "system_baseline::aws"
 ....

Running "ohai hostnamectl" from the VM command line, the attributes look similar:

VMware:

{
  "static_hostname": "server_vm01",
  "icon_name": "computer-vm",
  "chassis": "vm",
  "machine_id": "147ded104b3e4bf7beab2b765482dc0d",
  "boot_id": "8a68451144a8462882e194cde6188dc4",
  "virtualization": "vmware",
  "operating_system": "CentOS Linux 7 (Core)",
  "cpe_os_name": "cpe",
  "kernel": "Linux 3.10.0-693.17.1.el7.x86_64",
  "architecture": "x86-64"
}

And the AWS instance:

{
  "static_hostname": "server_vm02",
  "icon_name": "computer-vm",
  "chassis": "vm",
  "machine_id": "147ded104b3e4bf7bfab2b765482dc0d",
  "boot_id": "8a68451144a8462882e134cde6188dc4",
  "virtualization": "xen",
  "operating_system": "CentOS Linux 7 (Core)",
  "cpe_os_name": "cpe",
  "kernel": "Linux 3.10.0-693.17.1.el7.x86_64",
  "architecture": "x86-64"
}

Can anyone tell me why the xen attribute is not being picked up like the vmware attribute?

TyMac
  • 783
  • 2
  • 9
  • 32

0 Answers0