ansible-collections / netapp.ontap

Ansible collection to support NetApp ONTAP configuration.
https://galaxy.ansible.com/netapp/ontap
GNU General Public License v3.0
51 stars 34 forks source link

deleting qtrees with many files has no success. #202

Open 1hermast opened 3 months ago

1hermast commented 3 months ago

Summary

i tried to delete qtrees with the "na_ontap_qtree" Module with the options "force_delete: yes" and "wait_for_completion: false" that should actually delete the qtree and files in the background. but i get folowing message: timeout when deleting qtree

Component Name

na_ontap_qtree:

Ansible Version

$ ansible --version
Ansible version: 2.15.8

ONTAP Collection Version

$ ansible-galaxy collection list
ONTAP collection version: 22.10.0

ONTAP Version

9.12.1P10

Playbook

name: delete qtree and files
    na_ontap_qtree:
      state: absent
      name: "{{ sid }}"
      flexvol_name: "{{qtree_volume_var}}"
      force_delete: yes
      vserver: "{{ awx_vserver_name }}"
      wait_for_completion: false

Steps to Reproduce

create a qtree with thousands of files and dry to delete the directory

Expected Results

the files schould be deleted in the background, without getting a timeout message

Actual Results

timeout
1hermast commented 3 months ago

Error Message: failed: [localhost] ": "Error deleting qtree xxx: calling: storage/qtrees/5250194a-4c01-413a-8d5b-2adb2687bb86: got job reported error: Timeout error: Process still running, received {'job': {'uuid': 'd708b0a5-d197-11ee-9138-d039ea45654b', '_links': {'self': {'href': '/api/cluster/jobs/d708b0a5-d197-11ee-9138-d039ea45654b'}}}}.."

carchi8py commented 3 months ago

@1hermast sorry for the late reply, looking in to this

carchi8py commented 3 months ago

Let me have the team check what going on here. base of your playbook, and the code it looks like the initial delete is throwing the error, but we'll check why that is

    if self.use_rest:
        api = "storage/qtrees/%s" % self.volume_uuid
        query = {'return_timeout': 3}
        response, error = rest_generic.delete_async(self.rest_api, api, self.qid, query)
        if self.parameters['wait_for_completion']:
            dummy, error = rrh.check_for_error_and_job_results(api, response, error, self.rest_api)
        if error:
            self.module.fail_json(msg='Error deleting qtree %s: %s' % (self.parameters['name'], error))
csahu1 commented 1 week ago

We have story DEVOPS-6940 open for this fix.