Skip to content

Commit

Permalink
Add virtualization metadata and move kernel to software
Browse files Browse the repository at this point in the history
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
  • Loading branch information
smalleni committed Jul 11, 2018
1 parent 4be2304 commit b1f4eae
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion browbeat/metadata.py
Expand Up @@ -40,7 +40,8 @@ def get_hardware_metadata(self, sys_data):
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[
Expand Down Expand Up @@ -102,6 +103,12 @@ def get_software_metadata(self, sys_data):
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

Expand Down

0 comments on commit b1f4eae

Please sign in to comment.