Skip to content

Commit 676d48b

Browse files
committed
fix: Try to connect to VM managemnt IP without retrieving it from host
Catch HyperVException when VM management IP address is not retrieved by host OS and try to connect to VM anyway. Fixes #8 Signed-off-by: Kacper Tokarzewski <[email protected]>
1 parent b5eeac9 commit 676d48b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mfd_hyperv/hypervisor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ def create_vm(
114114
self._connection.execute_powershell(command=command, custom_exception=HyperVExecutionException)
115115

116116
self.start_vm(vm_params.name)
117-
mng_ip = self._wait_vm_mng_ips(vm_params.name)
117+
try:
118+
mng_ip = self._wait_vm_mng_ips(vm_params.name)
119+
except HyperVException as e:
120+
logger.error(f"Failed to get VM {vm_params.name} management IP: {e}")
118121
if dynamic_mng_ip:
119122
vm_params.mng_ip = mng_ip
120123

0 commit comments

Comments
 (0)