From 03362c0ecfc4b32493a938562535392754490f96 Mon Sep 17 00:00:00 2001 From: Igor Chudov Date: Wed, 20 Nov 2019 17:09:23 +0400 Subject: [PATCH] Increase timeouts on Proxmox actions --- roles/pve/tasks/create_vm.yml | 3 +++ roles/pve/tasks/destroy_vm.yml | 6 +++++- roles/pve/tasks/enable_vlans.yml | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/roles/pve/tasks/create_vm.yml b/roles/pve/tasks/create_vm.yml index bed1079..9dc9177 100644 --- a/roles/pve/tasks/create_vm.yml +++ b/roles/pve/tasks/create_vm.yml @@ -2,6 +2,8 @@ - set_fact: node_name="{{tmp_node}}" - set_fact: vm_name="{{node_name}}.{{stack.name}}" - set_fact: other_nics_to_vlan=false +- set_fact: + kvm_timeout: 500 - name: "[{{vm_name}}] clone VM" proxmox_kvm: @@ -84,6 +86,7 @@ api_host: "{{env.pve.api_url}}" name: "{{vm_name}}" state: started + timeout: "{{ kvm_timeout }}" - name: "[{{vm_name}}] wait for qemu-agent return addresses list" proxmox_qemu_agent: diff --git a/roles/pve/tasks/destroy_vm.yml b/roles/pve/tasks/destroy_vm.yml index 76102c3..16ef03d 100644 --- a/roles/pve/tasks/destroy_vm.yml +++ b/roles/pve/tasks/destroy_vm.yml @@ -1,5 +1,7 @@ - set_fact: node_name="{{tmp_node}}" - set_fact: vm_name="{{node_name}}.{{stack.name}}" +- set_fact: + kvm_timeout: 500 - name: checking that vm exists proxmox_kvm: @@ -22,7 +24,8 @@ name: "{{vm_name}}" state: stopped force: yes - timeout: 120 + timeout: "{{ kvm_timeout }}" + ignore_errors: yes - name: destroying vm proxmox_kvm: node: srv @@ -31,4 +34,5 @@ api_host: "{{env.pve.api_url}}" name: "{{vm_name}}" state: absent + timeout: "{{ kvm_timeout }}" when: vm_exists is succeeded diff --git a/roles/pve/tasks/enable_vlans.yml b/roles/pve/tasks/enable_vlans.yml index d023632..dacd6d7 100644 --- a/roles/pve/tasks/enable_vlans.yml +++ b/roles/pve/tasks/enable_vlans.yml @@ -1,6 +1,8 @@ --- - set_fact: node_name="{{inventory_hostname_short}}" - set_fact: vm_name="{{node_name}}.{{stack.name}}" +- set_fact: + kvm_timeout: 500 - name: "[{{vm_name}}] enable all VLANs" proxmox_kvm: @@ -20,6 +22,7 @@ ipconfig0: "ip={{stack.nodes[node_name].net.eth0.ipv4[0]}},gw={{stack.nodes[node_name].net.eth0.default}}" nameserver: "{{stack.nodes[node_name].net.eth0.nameservers | default(omit) | first}}" searchdomain: "{{stack.nodes[node_name].net.eth0.search | default(omit) | first}}" + timeout: "{{ kvm_timeout }}" register: vm_status until: vm_status is succeeded retries: 30