Skip to content

Ability to not wait for actions to complete when creating server #725

@betelgeuse

Description

@betelgeuse
SUMMARY

As documented in the source creating servers can be rather slow

# Action should take 60 to 90 seconds on average, but can be >10m when creating a
# server from a custom images
resp.action.wait_until_finished(max_retries=362) # 362 retries >= 1802 seconds
for action in resp.next_actions:
# Starting the server or attaching to the network might take a few minutes,
# depending on the current activity in the project.
# This waits up to 30minutes for each action in series, but in the background
# the actions are mostly running in parallel, so after the first one the other
# actions are usually completed already.
action.wait_until_finished(max_retries=362) # 362 retries >= 1802 seconds

It would be useful to allow skipping the wait here and separately wait with a new hetzner.hcloud.action module later.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

server.py

ADDITIONAL INFORMATION

Example use case

    -  hetzner.hcloud.server:
          name: "new-server"
          state: "present"
          wait_for_actions: false
      register: server_result
      notify: Wait for server to be created

Here other stuff can be done like setting up the ip address to DNS while the action runs in the background. Finally the handler would wait for the action to finish:

    - name: Wait for server to be created
      hetzner.hcloud.action:
         state: "success"
         id: "{{ server_result[1].id }}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions