Having customer which is getting error Cannot modify: ['name'] when volume is offline. but when I checked the code I found following https://github.com/ansible-collections/netapp.ontap/blob/main/plugins/modules/na_ontap_volume.py#L2944 any ideas? 🙂
#Is it possible to rename offline volume?
1 messages · Page 1 of 1 (latest)
just take it online, rename, and set it offline again?
it should also work when the volume is restricted, if you want to make sure that there's no user-access during the brief window it is being renamend
Thanks, so it's not officially supported? 🙂
Let me look in to this. Can you send me the playbook that have that error
Hey Chris, thanks 🙂 Here is the example:
- name: Rename volumes exluding
na_ontap_volume:
hostname: "{{ netapp_host }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
from_name: "{{ item }}"
vserver: "{{ netapp_vserver }}"
name: test_"{{ item }}"
state: present
is_online: false
with_items: "{{ offline_volumes }}"
it should also work when the volume is restricted, if you want to make sure that there's no user-access during the brief window it is being renamend
My preferred method is to disable the junction-path if it's an NFS volume. That makes it impossible to mount from even storage root nodes.
that's not true, unmounting (or changing the junction path) does not disallow NFS access. Yes, it's impossible to mount, but since the volume ID is in the file handle, as long as the client has a valid file handle it can continue to write to a volume even if the volume is unmounted or mounted to a different path. We had customers who hit data corruption during a migration because of that
in this specific case it wouldn't matter I guess, but for migrations it can be deadly...
You're absolutely right if the volume is already mounted - disabling the junction path is not enough. Since the volume in this case was offline already, I assumed that it was unmounted. Disable the junction path and bring it back online and you're safe.
Our standard practice on volume retirement is to disable the junction path, unmount it from all of the clients, and then finally take it offline. Since we have root clients that mount /, disabling the junction path is the quickest way to prevent it from being remounted.
@neon merlin have you had time to check that? 🙂