feat(vm_healthcheck): add VM health validation role#15
Conversation
1e55910 to
e559867
Compare
sabre1041
left a comment
There was a problem hiding this comment.
@stevefulme1 This is a very useful role. A few comments for consideration
- Are we only concerned about running VM's? Since
VirtualMachineInstancesare being targeted, only running VM's have these resources associated. All checks fail against a VM if it is not running. If the same checks can be performed against aVirtualMachineit might be a good fallback where an indicator could be added to denote VMI vs VM - For the storage checks where there are, for example, volumes listed. There is inconsistent ordering between declared vs attached. It might be nice to have the items sorted alphabetically for consistency
- What about adding a timestamp to the report to state when the report was generated
- Might be good to check that the destination that the report will be created in is writable. In one of my tests, the destination was invalid and an error arose only after the processing took place
- Attend to the conflicted files
- Handle stopped VMs gracefully: fall back to VirtualMachine data when VMI does not exist, report meaningful status instead of failing - Add source indicator (vm/vmi) to all healthcheck results - Sort declared and attached volume lists alphabetically for consistent comparison and display - Add report generation timestamp to HTML report header and footer - Validate report output directory exists and is writable before running healthcheck processing
e559867 to
d1bb24a
Compare
|
@sabre1041 Thanks for the thorough review! All five items addressed in the latest push:
|
sabre1041
left a comment
There was a problem hiding this comment.
@stevefulme1 A few comments
- Some of the logic defined in the
vm_resources.ymllook a bit weird. Especially, surrounding overcommit. It is not checking the value of the resources but checking to see if resources or limits are specified - Linting is failing mainly due to line length
Summary
Adds a new
vm_healthcheckrole that performs comprehensive health validation checks on Virtual Machines running in OpenShift Virtualization.Checks performed
Deliverables
roles/vm_healthcheck/- Full role with defaults, vars, tasks, templates, tests, meta, READMEplaybooks/vm_healthcheck.yml- Playbook to invoke the roleTesting
ansible-lint --profile productionpasses with 0 errors (warnings are yaml[line-length] which is in warn_list)__vm_healthcheck_prefix perloop_var_prefixconfigvm_lifecyclerole patterns