-
Bug
-
Resolution: Unresolved
-
Critical
-
None
-
rhel-9.4.z
-
No
-
Low
-
rhel-ha
-
3
-
False
-
False
-
-
None
-
None
-
None
-
None
-
Unspecified
-
Unspecified
-
Unspecified
-
-
x86_64
-
None
What were you trying to do that didn't work?
The VMI object may exist and vmi.status.phase has several other valid status, different to just "Running". While some may be up to discussion on how to translate, some of those statuses mean the VM is OFF, like "Succeeded" and "Failed".
With specific settings like RunStrategy: Manual and failure to start up or manual shutdown from within, the VMI object may exist while the VM is not running, and it needs to be correctly parsed to provide the right VM status.
What is the impact of this issue to you?
Fencing does not work
Please provide the package NVR for which the bug is seen:
fence-agents-kubevirt-4.10.0-62.el9_4.10.x86_64
How reproducible is this bug?:
Always
Steps to reproduce
- Set a Kubevirt VM with "runStrategy: Manual"
- Start the VM
- SSH to the VM and shut it down from within (do not stop using virtctl/console)
- The VMI will look like this:
NAME AGE PHASE IP NODENAME READY
rhel-79 41s Succeeded green.home.arpa False
- Use fence_kubevirt to get its status
Expected results
OFF
Actual results
# fence_kubevirt --namespace homelab -o status -n rhel-79 -vvvv 2025-02-28 11:44:55,432 DEBUG: Starting get status operation 2025-02-28 11:44:55,442 ERROR: Failed: Unable to obtain correct plug status or plug is not available
Additional Information
This makes the other 2 more common status work:
--- /usr/sbin/fence_kubevirt.bak 2025-02-28 11:48:09.419860202 +1000 +++ /usr/sbin/fence_kubevirt 2025-02-28 13:03:12.934110219 +1000 @@ -63,8 +63,13 @@ fail(EC_STATUS) def translate_status(instance_status): + """ vmi.Status.Phase can be one of the below: + Running, Scheduling, Scheduled, Succeeded, Failed, Unknown + """ if instance_status == "Running": return "on" + if instance_status in ["Succeeded", "Failed"]: + return "off" return "unknown" def set_power_status(conn, options):
Not sure how to interpret Scheduling and Scheduled from a fence-agents perspective.