#Volumes not available errors with Ansible modules

1 messages · Page 1 of 1 (latest)

crude barn
#

Hello,
So, I managed to create the volumes I need and the order I use is the following:

  1. Create export policies for my client
  2. Create "standard" Volumes for NFS export. Junction is defined
  3. Select a predefined schedule for a SnapLock volume
  4. Create the SnapLock volume
  5. Create SnapMirror for SnapLock volumes
  6. Wait for SnapMirror destination to reach idle state

HOWEVER, every now and then (and way more often than we would like, when we try to mount the NFS exports, we have failures. And those failures are after almost 15' of waiting and retries etc.
If we rerun the jobs, let's say 10 minutes everything is OK.

Which brings me back to the very basic question.
How can I be 100% sure that my newly created volumes are ready for consumption from their intended clients?
My plan is to use the netapp.ontap.na_ontap_rest_info: and ask for the state (looking for the online value).
Is that enough?
Or do I also need the junction path? And how do I get the junction path?

rustic garnet
#

Are you using load sharing mirrors on your root volumes? If so, what's the replication schedule. You might need to update the ls mirror before attempting to mount.

crude barn
#

update the ls mirror before attempting to mount...

How can I do this?

rustic garnet
#

You could use the snapmirror module to update the LS mirror. Have you confirmed that you are using LS mirrors for your root volumes?

crude barn
#

Yes, we do use LS mirror.

Currently, what we do is this:


- name: Create SnapLock volumes
  netapp.ontap.na_ontap_volume:
    hostname: "{{ cs_storage_snaplock_cluster }}"
    vserver: "{{ cs_storage_snaplock_svm }}"
    name: "{{ cs_storage_location }}_{{ __volume_name | trim }}"
    aggregate_name: "{{ cs_snaplock_aggregator }}"
    comment: "{{ item.comment | default(cs_storage_comment) | default(omit) }}"
    export_policy: "{{ cs_storage_snaplock_export_policy }}"
    junction_path: null
    language: "C.UTF-8"
    size: "{{ ((item.size | int) * (cs_storage_oversize | default(1.0))) | int }}"
    size_unit: "{{ item.size_unit | default(omit) }}"
    snapshot_policy: "none"
    snaplock:
      type: "{{ cs_storage_snaplock_volume_type }}"
    state: "{{ item.state | default(cs_storage_state) | default('present') }}"
    type: DP
    wait_for_completion: "{{ cs_storage_wait | default(true) }}"

- name: Create SnapMirror for SnapLock volumes
  netapp.ontap.na_ontap_snapmirror:
    hostname: "{{ cs_storage_snaplock_cluster }}"
    state: present
    source_endpoint:
      cluster: "{{ cs_storage_cluster }}"
      path: "{{ cs_storage_svm }}:{{ __volume_name }}"
    destination_endpoint:
      cluster: "{{ cs_storage_snaplock_cluster }}"
      path: "{{ cs_storage_snaplock_svm }}:{{ cs_storage_location }}_{{ __volume_name | trim }}"
    create_destination:
      enabled: true
    schedule: "{{ __snaplock_crontab | default('daily') }}"
    policy: "{{ cs_storage_snaplock_mirror_policy }}"
    relationship_type: extended_data_protection
rustic garnet
#

Are you getting errors when you try to mount the "standard" exports or the snaplock volumes? What's the error?

crude barn
#

The errors are for the standard volumes and the error is that the mount points do not exist.

#

My understanding is that the above code should be sufficient for the LS to be published.

rustic garnet
#

What's the schedule of your LS mirror replication? snapmir show -type LS -field sched If it's hourly, then you would have to wait up to 1 hour to allow your namespace to be replicated and have the mount point available. If you don't want to wait, then you would either need to manually update the LS mirror (snapmirror update-ls-set -source-path <source_path>) or add the LS update in your playbook.