Skip to content

Commit

Permalink
Delay poweroff
Browse files Browse the repository at this point in the history
Delay poweroff in shutdown tasks
  • Loading branch information
bl0way authored and AllRWeak committed Feb 28, 2024
1 parent 5c71e84 commit a49bbb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions nova/core/roles/powerstate/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ poweron: false
poweroff: false
restart: false
reset: false

# Delays
shutdown_shutting_retries: 5
shutdown_shutting_delay: 2
shutdown_waiting_retries: 18
shutdown_waiting_delay: 10
8 changes: 4 additions & 4 deletions nova/core/roles/powerstate/vsphere/shutdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
vm: "{{ vcenter_vm_info.value[0].vm }}"
register: vcenter_vm_stop
until: not vcenter_vm_stop.failed
retries: 5
delay: 2
retries: "{{ shutdown_shutting_retries }}"
delay: "{{ shutdown_shutting_delay }}"
when: vcenter_vm_info.value[0].power_state != "POWERED_OFF"

- name: Waiting for {{ custom_vm_name | default(vm_name) }} shutdown...
Expand All @@ -20,5 +20,5 @@
until:
- shutdown_status.value.state is defined
- shutdown_status.value.state == "NOT_RUNNING"
retries: 18
delay: 10
retries: "{{ shutdown_waiting_retries }}"
delay: "{{ shutdown_waiting_delay }}"

0 comments on commit a49bbb0

Please sign in to comment.