)]}'
{"watcher/decision_engine/strategy/strategies/saving_energy.py":[{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"0642d888f7d4e2e92206715ffe082810147330db","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                )"},{"line_number":185,"context_line":"                continue"},{"line_number":186,"context_line":"            else:"},{"line_number":187,"context_line":"                running_vms \u003d len(hypervisor_node.servers or [])"},{"line_number":188,"context_line":"                if running_vms \u003d\u003d 0:"},{"line_number":189,"context_line":"                    power_state \u003d node.get_power_state()"},{"line_number":190,"context_line":"                    if power_state \u003d\u003d metal_constants.PowerState.ON:"}],"source_content_type":"text/x-python","patch_set":2,"id":"822bccd0_6e505cce","line":187,"updated":"2026-07-31 10:45:10.000000000","message":"The change replaces the old running_vms integer with len(hypervisor_node.servers or []) to count running VMs. However, the Hypervisor dataclass\u0027s servers field is populated from nova_hypervisor.servers, which is only filled when with_servers\u003dTrue is passed to the Nova API. None of the metal_helpe...\n\n**Severity**: CRITICAL | **Confidence**: 0.9\n\n**Risk**: In saving_energy strategy: all nodes will be treated as having 0 running VMs. Nodes with running VMs will be classified as free and may be powered off, causing VM downtime. In change_node_power_state action: the safety check before powering off will always pass, allowing nodes with running VMs to...\n\n**Priority**: Immediate\n**Why This Matters**: In saving_energy strategy: all nodes will be treated as having 0 running VMs. Nodes with running VMs will be classified as free and may be powered off, causing VM downtime. In change_node_power_state action: the safety check before powering off will always pass, allowing nodes with running VMs to...\n\n**Recommendation**:\nAdd a running_vms field to the Hypervisor dataclass mapped from nova_hypervisor.running_vms (which is always included in the Nova API hypervisor response). Then use hypervisor_node.running_vms directly instead of len(servers). Alternatively, ensure all metal_helper code paths pass with_servers\u003dTrue to get_compute_node_by_name/get_compute_node_list, but this adds API overhead and is less efficient than using the already-present running_vms field.","commit_id":"e5df79b9a4d92c128f006e73a70a1b30aa033e32"}]}
