From 09ada73c777be72ca2dfe0847df2eabcedd6e748 Mon Sep 17 00:00:00 2001 From: linhuali Date: Tue, 15 Aug 2023 05:52:15 +0000 Subject: [PATCH] fix the dh_depoly_vm failure for Linux with power-on after rebase on #489 Signed-off-by: linhuali --- .../linux/dh_deploy_vm/deploy_vm_from_iso.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/desktop_hypervisor/linux/dh_deploy_vm/deploy_vm_from_iso.yml b/desktop_hypervisor/linux/dh_deploy_vm/deploy_vm_from_iso.yml index 7494e6507..a88e63dc9 100644 --- a/desktop_hypervisor/linux/dh_deploy_vm/deploy_vm_from_iso.yml +++ b/desktop_hypervisor/linux/dh_deploy_vm/deploy_vm_from_iso.yml @@ -180,7 +180,24 @@ vm_wait_log_delay: 30 vm_wait_log_retries: 120 - - name: "Wait 60s for OS rebooting" + - name: "Get VM existence status" + include_tasks: ../../common/dh_host_check_vm_exists.yml + - name: "Set fact of VM existence status" + ansible.builtin.set_fact: + dh_vm_exists: "{{ dh_vm_check_exist }}" + - name: "Power on VM" + when: not dh_vm_exists + include_tasks: ../../common/dh_host_power_vm.yml + vars: + vm_power_option: "start" + - name: "Reset guest OS" + when: dh_vm_exists + include_tasks: ../../common/dh_host_power_vm.yml + vars: + vm_power_option: "reset" + vmrun_extra_option: "hard" + + - name: "Wait 60s for OS powered on" ansible.builtin.pause: seconds: 60