Get VM IP again when getting screenshot fails (#215)
In rare cases, the IP of the VM changes after it launches. We can get the IP every time we retry to ensure the correct connection.
This commit is contained in:
@@ -256,6 +256,8 @@ def _install_vm(vm_name, vms_dir, downloaded_file_name, os_type, original_vm_nam
|
|||||||
|
|
||||||
# Try downloading the screenshot until successful
|
# Try downloading the screenshot until successful
|
||||||
while not download_screenshot(vm_ip):
|
while not download_screenshot(vm_ip):
|
||||||
|
# Try to get the IP again in case it has changed
|
||||||
|
vm_ip = get_vm_ip(vm_path)
|
||||||
logger.info("Check whether the virtual machine is ready...")
|
logger.info("Check whether the virtual machine is ready...")
|
||||||
|
|
||||||
logger.info("Virtual machine is ready. Start to make a snapshot on the virtual machine. It would take a while...")
|
logger.info("Virtual machine is ready. Start to make a snapshot on the virtual machine. It would take a while...")
|
||||||
|
|||||||
Reference in New Issue
Block a user