Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Add rule to remove downtime #297

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

lizsalmon
Copy link
Contributor

Description:

This PR:

  • Adds values to the enum in hypervisor_states.py to add states for all possible machines. REBOOTED, EMPTY, DOWN
  • Adds in a rule to remove the downtime on a hypervisor being "patched and rebooted" only once it is back up (in rebooted state)

Submitter:

Have you (where applicable):

  • Added unit tests?
  • Checked the latest commit runs on Dev?
  • Updated the example config file(s) and README?

Reviewer

Does this PR:

  • Place non-StackStorm code into the lib directory?
  • Have unit tests for the action/sensor and lib layers?
  • Have clear and obvious action parameter names and descriptions?

Let the patch and reboot action end just after starting a reboot and
then use a sensor to pick up when the machine is back before removing
the downtime.
Also added "EMPTY" and "DOWN"
@lizsalmon lizsalmon changed the title Add Rule to remove downtime Add rule to remove downtime Jan 15, 2025
@lizsalmon lizsalmon changed the title Add rule to remove downtime ENH: Add rule to remove downtime Jan 15, 2025
@lizsalmon lizsalmon force-pushed the patch-reboot-complete branch from ea43ded to 713875b Compare January 15, 2025 16:45
Copy link

codecov bot commented Jan 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.15%. Comparing base (5c66bae) to head (0a23b1c).
Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #297   +/-   ##
=======================================
  Coverage   98.14%   98.15%           
=======================================
  Files         126      126           
  Lines        4575     4599   +24     
  Branches      242      244    +2     
=======================================
+ Hits         4490     4514   +24     
  Misses         76       76           
  Partials        9        9           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Update icinga downtime actions and tests to use IcingaObject enums
@lizsalmon lizsalmon force-pushed the patch-reboot-complete branch from 713875b to 2daac3b Compare January 16, 2025 09:08
@lizsalmon lizsalmon marked this pull request as ready for review January 16, 2025 09:11
lib/workflows/hv_patch_and_reboot.py Outdated Show resolved Hide resolved
sensors/hypervisor.state_change.yaml Outdated Show resolved Hide resolved
rules/hv.remove.downtime.yaml Outdated Show resolved Hide resolved
@lizsalmon lizsalmon force-pushed the patch-reboot-complete branch 2 times, most recently from 8a7496f to 6466ae4 Compare January 17, 2025 09:52
@lizsalmon lizsalmon force-pushed the patch-reboot-complete branch 10 times, most recently from 2b006fe to 6732f55 Compare January 21, 2025 12:24
Changed criteria to be either DOWN or DRAINED
Added the exception into hv_patch_and_reboot
@lizsalmon lizsalmon force-pushed the patch-reboot-complete branch from 6732f55 to 0a23b1c Compare January 21, 2025 12:27
@lizsalmon lizsalmon requested a review from gmatthews20 January 21, 2025 12:32
@lizsalmon lizsalmon requested a review from meoflynn January 21, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants