opentelekomcloud / ansible-collection-cloud

Ansible modules for using with OTC (addition to the native OpenStack modules)
Apache License 2.0
21 stars 13 forks source link

Timeout to delete RDS instance is wrongly configured in module opentelekomcloud.cloud.rds_instance #306

Closed lboka closed 6 months ago

lboka commented 6 months ago

Delete of RDS instance failed due to: "Timeout waiting for Job:917365e1-f596-446d-86ef-6f952a805e8c to transition to completed" It looks like timeout for delete RDS instance is wrongly configured in module opentelekomcloud.cloud.rds_instance. Even if I tried to use "timeout" parameter with longer time it didn't work.

ANSIBLE playbook part:

  - name: Now Delete RDS instance
    opentelekomcloud.cloud.rds_instance:
      name: "{{ test_rds_name }}"
      state: absent
      wait: true

I also tried with additional parameter "timeout: 600" but result is the same.

ANSIBLE log part:

2024-02-19 08:28:30,255 p=51856 u=lboka n=ansible | TASK [Now Delete RDS instance] ******************************************************************************************************************
2024-02-19 08:31:46,060 p=51856 u=lboka n=ansible | fatal: [localhost]: FAILED! => {"changed": false, "extra_data": {"data": null, "details": "None", "response": "None"}, "msg": "Timeout waiting for Job:917365e1-f596-446d-86ef-6f952a805e8c to transition to completed"}

Separate REQUEST to query JOB_ID task via API:

GET https://rds{{url}}/v3/{{project_id}}/jobs?id=917365e1-f596-446d-86ef-6f952a805e8c

RESPONSE:
{
    "job": {
        "id": "917365e1-f596-446d-86ef-6f952a805e8c",
        "name": "DeleteMysqlInstance",
        "status": "Completed",
        "created": "2024-02-19T08:28:31+0000",
        "ended": "2024-02-19T08:32:28+0000",
        "process": "",
        "instance": {
            "id": "858b7ab4341b4281abac9f04268c1586in01",
            "name": "rds-474726"
        },
        "entities": {}
    }
}
anton-sidelnikov commented 6 months ago

Hi @RusselSand please check rds_instance.py, line 232 must be wait_timeout attr instead of wait From sdk:

delete_rds_instance(self, instance, wait=True, wait_timeout=180, wait_interval=5)