#Aggregate Rename fails

1 messages · Page 1 of 1 (latest)

flint sequoia
#

Hi all,

Renaming of aggregate fails with below error even though the cluster has aggregates. If "use_rest: never" is used the playbook task completes fine.

  • name: "Rename Root Aggregates: {{ cluster }}"
    netapp.ontap.na_ontap_aggregate:
    state: present
    service_state: online
    from_name: "{{ item.name }}"
    name: "{{ item.newname }}"
    <<: *clusterlogin
    with_items: "{{ aggr_rename }}"
    tags:
    - aggr_rename

error:
failed: [localhost] (item={'name': 'aggr0_test_01_nas_01', 'newname': 'aggr0_n01'}) => changed=false
ansible_loop_var: item
invocation:
module_args:
allow_flexgroups: null
cert_filepath: null
disk_class: null
disk_count: null
disk_size: null
disk_size_with_unit: null
disk_type: null
disks: null
encryption: null
feature_flags: null
force_ontap_version: null
from_name: aggr0_test_01_nas_01
hostname: 10.114.247.244
http_port: null
https: true
ignore_pool_checks: null
is_mirrored: null
key_filepath: null
mirror_disks: null
name: aggr0_n01
nodes: null
object_store_name: null
ontapi: null
password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
raid_size: null
raid_type: null
service_state: online
snaplock_type: null
spare_pool: null
state: present
tags: null
time_out: 100
unmount_volumes: null
use_rest: auto
username: admin
validate_certs: false
wait_for_online: false
item:
name: aggr0_test_01_nas_01
newname: aggr0_n01
msg: 'Error renaming aggregate aggr0_n01: no aggregate with from_name aggr0_test_01_nas_01.'

ONTAP: 9.12.1P8
Collection: netapp.ontap 21.14.1

merry fiber
#

no aggregate with from_name aggr0_test_01_nas_01

Looks like you have a typo in your aggregate name or something. Note also that aggregate names are case sensitive, so check that as well

flint sequoia
#

There is no typo in the aggregate name. I edited the aggregates names for this post but the playbook runs fine when I use rest never parameter.

fleet cave
#

Is that a root aggregate? REST API doesn't support that.

flint sequoia
#

Yes it’s root aggregate

flint sequoia
#

I was able use the same ansible task without having to use rest never parameter and it worked fine, the cluster where I used this was on ontap 9.10.1px release and this was few months back. The cluster I’m working on right now is 9.12.1p8 and newer collections so something has changed recently.

fleet cave
#

NetApp changed the default API of the ansible collection to REST a few months back. Some genius in the REST API development decided that stuff like root aggregates and root volumes are not exposed via the REST API. Now here we are...

flint sequoia
#

Oh, that explains this behavior. Thanks @fleet cave . I’ll have to come up with a workaround now to get this work 😕

fleet cave
#

As a future proof workaround you can use the rest_cli module.

- name: rename Node root aggregates na_ontap_rest_cli: command: storage/aggregate/rename verb: PATCH params: aggregate: "{{ aggregate }}" body: newname: '{{ aggregate_newname }}'

flint sequoia
#

Yes, that was my next step to use rest cli to get over this. Appreciate you sharing this @fleet cave

reef grotto
#

I just hit this ... couldn't understand why the na_ontap_rest_info module wasn't giving me the root aggregates. Oh man, this is frustrating!