Skip to content

Commit fa844d4

Browse files
vsibirskmyakove
authored andcommitted
add more logging to vmi.wait_until_running() (#1352)
* add more logging to vmi.wait_until_running() * add vmi.name to log msg * add vm property and vm status to logs * add raise exception if vm not found * Remove VM object refs --------- Co-authored-by: Meni Yakove <441263+myakove@users.noreply.github.com>
1 parent 8817c8b commit fa844d4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ocp_resources/virtual_machine_instance.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,21 @@ def wait_until_running(self, timeout=TIMEOUT_4MINUTES, logs=True, stop_status=No
115115
TimeoutExpiredError: If VMI failed to run.
116116
"""
117117
try:
118+
self.logger.info(
119+
f"VMI {self.name} status before wait: {self.instance.status.phase}"
120+
)
118121
self.wait_for_status(
119122
status=self.Status.RUNNING, timeout=timeout, stop_status=stop_status
120123
)
121124
except TimeoutExpiredError:
122125
if not logs:
123126
raise
124-
127+
self.logger.error(f"VMI {self.name} status: {self.instance.status.phase}")
125128
virt_pod = self.virt_launcher_pod
126129
if virt_pod:
130+
self.logger.error(
131+
f"Status of virt-launcher pod {virt_pod.name}: {virt_pod.status}"
132+
)
127133
self.logger.debug(f"{virt_pod.name} *****LOGS*****")
128134
self.logger.debug(virt_pod.log(container="compute"))
129135

0 commit comments

Comments
 (0)