nvazquez opened a new pull request, #7170:
URL: https://github.com/apache/cloudstack/pull/7170

   ### Description
   
   This PR allows CloudStack to auto-disable and auto-enable KVM hosts resource 
state based on customisable host/hypervisor health checks.
   
   #### Management server changes
   
   A new cluster configuration 'enable.kvm.host.auto.enable.disable' is added, 
disabled by default.
   
   This PR extends the AgentManager to process StartupRoutingCommand and 
PingRoutingCommand with the host health check result:
    - If the host health check result is null, do nothing.
    - If the host health check result is true, enable the host resource state 
if it is Disabled.
    - If the host health check result is false, disable the host resource state 
if it is Enabled.
   
   On every automatic enable or disable event, the management server will send 
an alert to the admin and add/update an automatic annotation (comment) on the 
specific host.
   
   #### KVM host Health Check
   
   Set the path of an executable file/script for host health check on the 
property 'agent.health.check.script' on `agent.properties` 
   
   - The health check result is true, if the script is executed successfully 
and the exit code is 0
   - The health check result is false, if the script is executed successfully 
and the exit code is 1
   - The health check result is null, if 
      - Script file is not specified, or
      - Script file does not exist, or 
      - Script file is not accessible by the user of the cloudstack-agent 
process, or
      - Script file is not executable
      - There are errors when the script is executed (exit codes other than 0 
or 1)
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [x] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   2xRocky8 KVM hosts in 1 cluster -> put host1 into maintenance, test host2
   - Enable the cluster setting wihout providing a health script to the host -> 
no automatic enable/disable
   - Enable the cluster setting, set a script that doesn't have permission 
rights -> no automatic enable/disable
   - Enable the cluster setting, set a script that succeeds (ping the 
management server) -> observe the health check result is successful, but since 
the host is Enabled is not transitioned to any state
   - Enable the cluster setting, set a script that fails (ping an unreacheable 
host) -> observe the health check result is false, the host2 is put into 
Disabled state
   - Enable the host2 manually -> the host2 is set to Enabled state
   - The next failure sets the hosts2 into Disabled state again
   - Modify the script again so it succeeds, the host2 goes into Enabled state, 
then disable manually the host2 -> the future successful health checks do not 
put the host into Disabled state
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to