mirror of
https://github.com/ansible/awx.git
synced 2026-06-22 23:27:46 -02:30
Do not mark node READY when health check reports zero cpu or memory (#16511)
Instances reporting cpu=0 or memory=0 with no errors would be transitioned to READY state. Treat zero cpu/memory as an error so the node stays offline until a valid health check is received. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -374,6 +374,11 @@ class Instance(HasPolicyEditsMixin, BaseModel):
|
||||
self.memory = new_memory
|
||||
update_fields.append('memory')
|
||||
|
||||
# Do not mark nodes READY if cpu or memory is zero
|
||||
if not errors and self.node_type != Instance.Types.HOP and (not new_cpu or not new_memory):
|
||||
errors = _('Health check for {} reported invalid values: cpu={}, memory={}').format(self.hostname, new_cpu, new_memory)
|
||||
logger.warning(errors)
|
||||
|
||||
if not errors:
|
||||
self.refresh_capacity_fields()
|
||||
self.errors = ''
|
||||
|
||||
Reference in New Issue
Block a user