Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modul filesystem is not idempotent when using jfs2 attribute agblksize #402

Closed
pc2306 opened this issue Jan 5, 2024 · 12 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@pc2306
Copy link

pc2306 commented Jan 5, 2024

Describe the bug
When using jfs2 attribute agblksize, the first call of the module successfully creates the filesystem with crfs, but subsequent calls fail, since this attribute cannot be used with chfs command.

To Reproduce
Add the following task to a playbook:

- name: Creation of a JFS2 filesystem
  ibm.power_aix.filesystem:
    state: present
    filesystem: /mnt3
    fs_type: jfs2
    attributes: size=32768,isnapshot='no',agblksize=512
    mount_group: test
    vg: rootvg

Expected behavior
On subsequent calls it should not fail when calling chfs.

@nitismis nitismis self-assigned this Jan 20, 2024
@nitismis nitismis added the bug Something isn't working label Jan 20, 2024
@nitismis
Copy link
Member

thanks for reporting. We are working on it.

@rseabra
Copy link

rseabra commented Apr 5, 2024

How is state 'modify' something compatible with the concept of idempotency?

@schamola
Copy link
Contributor

Hi @rseabra
In #424 this issue was fixed without the use of state 'modify'
Can you confirm if it is working as per your expectations now ?

@pc2306
Copy link
Author

pc2306 commented Apr 30, 2024

Hi @schamola,
I'm afraid your change will not fix the issue. So you can better understand my problem, let me show you an example.
The first call of

- name: Creation of a JFS2 filesystem
  ibm.power_aix.filesystem:
    state: present
    filesystem: /mnt3
    fs_type: jfs2
    attributes: size=32768,isnapshot='no',agblksize=512
    mount_group: test
    vg: rooting

will create the filesystem. With your fix, repeating calls will fail, although nothing has changed, since agblksize ist not allowed with chfs. This behaviour is contrary to the concept of idempotency.

When I change the size attribute like this:

- name: Creation of a JFS2 filesystem
  ibm.power_aix.filesystem:
    state: present
    filesystem: /mnt3
    fs_type: jfs2
    attributes: size=65536,isnapshot='no',agblksize=512
    mount_group: test
    vg: rooting

I would expect the module to change just the size of the filesystem. But once again it will return an error because of the attribute agblksize.

So instead of returning an error when there are attributes like agblksize, these attributes should just be ignored when calling the chfs command.

I hope this sheds some light on my problem.

Thanks and best regards

@rseabra
Copy link

rseabra commented Apr 30, 2024

@schamola the problem exists with state: present, it tries to modify for some mysterious and incorrect reason, and then invokes chfs incorrectly. So it's like two bugs in one, cheaper by the dozen. :)

@nitismis nitismis assigned nitismis and unassigned schamola May 2, 2024
@schamola
Copy link
Contributor

schamola commented May 6, 2024

@rseabra thanks for the elaboration.
We will fix it, soon !

@schamola
Copy link
Contributor

Hi @rseabra ,
We have pushed the fix for this issue. Please check and confirm if it is working fine for you now.

@nitismis
Copy link
Member

@rseabra, We have merged the fix. Please reopen this issue if it does not address your problem.

@rseabra
Copy link

rseabra commented May 29, 2024

@schamola @nitismis

This is not fixed, it continues to "change" the filesystems.
I run once it creates, I run it again and it "changes" something (since no passed parameter changed, nothing should have changed, which means idempotency is not working yet).

It seems to have fixed only the chfs invocation, but not the required idempotency :)

@rseabra
Copy link

rseabra commented May 29, 2024

This is the task:

- name: Setup DATA Filesystems
  ibm.power_aix.filesystem:
    attributes: "{{ item.1.attributes|default(omit) }}"
    auto_mount: "{{ item.1.auto_mount|default(true) }}"
    device: "{{ item.1.lv }}"
    filesystem: "{{ item.1.filesystem|default(item.1.mount) }}"
    fs_type: "{{ item.1.fs|default('jfs2') }}"
    permissions: "{{ item.1.permissions|default('rw') }}"
    state: "{{ item.1.state|default('present') }}"
  loop: "{{ datavgs|subelements('lvs') }}"
  when: "item.1.mountfs|default(true)"
  tags:
  - datavg-fs

And this is the relevant inventory variable:

            datavgs:
              - vg: "datavg"
                lvs:
                - { lv: "fs1lv",            size: "2G", mount: "/opt/fs1" }
                - { lv: "fs2lv",                size: "2G", mount: "/opt/fs2" }

@schamola
Copy link
Contributor

schamola commented Jun 3, 2024

Hi @rseabra,
Thanks for providing the extra information, It helped us in analysing the issue properly.

We have fixed the issue, it should be working for you now. Let us know once you verify.

@schamola
Copy link
Contributor

Hi @rseabra !
Just a gentle reminder, can you please confirm if the module is working for you now ?

If yes, we will close this defect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants