Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ibm_is_snapshot - Add Support for Timeouts #69

Open
DanielFarrarCO opened this issue Aug 17, 2021 · 0 comments
Open

ibm_is_snapshot - Add Support for Timeouts #69

DanielFarrarCO opened this issue Aug 17, 2021 · 0 comments

Comments

@DanielFarrarCO
Copy link

Running this on a VSI disk with a large amount of data:

- name: Create Snapshot
  ibm.cloudcollection.ibm_is_snapshot:
    name: "snapshot-name"
    resource_group: "{{ibm_resource_group_info.resource.id}}"
    source_volume: "{{item.volume_id}}"
    region: "{{vdc_region}}"
  with_items: "{{vm_info.resource.volume_attachments}}"

Returns this error:

Error: timeout while waiting for state to become 'stable, failed' (last state: 'pending', timeout: 10m0s)

Per this thread, the Terraform module should support timeout values and that is being added to the documentation.
[(https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2989)]
Reading through the code I didn't see that timeout create/update/delete is supported in this ansible module. If we can update the module to support the backend terraform timeout that would be great!

Current workaround is to create the snapshot in async mode with polling 0, then loop check on the snapshot status until it is stable:

- name: Create Snapshot
  ibm.cloudcollection.ibm_is_snapshot:
    name: "{{item.volume_name}}-{{job_weekday}}-{{job_date}}-{{job_time_stamp}}"
    resource_group: "{{ibm_resource_group_info.resource.id}}"
    source_volume: "{{item.volume_id}}"
    region: "{{vdc_region}}"
  when: take_snapshot
  register: snapshots
  async: 3600
  poll: 0
  delegate_to: localhost
  with_items: "{{vm_info.resource.volume_attachments}}"

- name: Check Snapshots
  ibm.cloudcollection.ibm_is_snapshot_info:
    name: "{{item.volume_name}}-{{job_weekday}}-{{job_date}}-{{job_time_stamp}}"
    region: "{{vdc_region}}"
  when: take_snapshot
  register: snapshot_progress
  delay: 60
  retries: 60
  until:
    - snapshot_progress.rc == 0
    - snapshot_progress.resource.lifecycle_state == "stable"
  delegate_to: localhost
  with_items: "{{vm_info.resource.volume_attachments}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant