From b1f4eaeec477eaba1548fc488bd77325634c329b Mon Sep 17 00:00:00 2001 From: Sai Sindhur Malleni Date: Wed, 11 Jul 2018 10:05:56 -0600 Subject: [PATCH] Add virtualization metadata and move kernel to software This commit adds two new fields in hardware metadata to identify if the node is baremetal/vm. This will help when running browbeat using infrared in vms or when the control plane is running on RHEV/oVirt. This commit also fixes the long known issue of having kernel details in hardware metadata. Change-Id: Ie9dd9d375125ebeae0287c624d345b272e19e459 --- browbeat/metadata.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/browbeat/metadata.py b/browbeat/metadata.py index e7340f14e..6e6924d22 100644 --- a/browbeat/metadata.py +++ b/browbeat/metadata.py @@ -40,7 +40,8 @@ class Metadata(object): hard_dict['hardware_details'] = [] hardware_dict = {} hardware_dict['label'] = item['inventory_hostname'] - hardware_dict['kernel'] = item['ansible_kernel'] + hardware_dict['virtualization_role'] = item['ansible_virtualization_role'] + hardware_dict['virtualization_type'] = item['ansible_virtualization_type'] hardware_dict['total_mem'] = item[ 'ansible_memory_mb']['real']['total'] hardware_dict['total_logical_cores'] = item[ @@ -102,6 +103,12 @@ class Metadata(object): software_dict[service_name][section] = {} software_dict[service_name][section][key] = item[soft] + node = item['inventory_hostname'] + software_dict['kernel'] = {} + software_dict['kernel']['version'] = item['ansible_kernel'] + software_dict['kernel']['architecture'] = item['ansible_architecture'] + software_dict['kernel']['node_name'] = node + soft_all_dict.append(software_dict) return soft_all_dict