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

filesystem.py: fix xfs growfs #137

Merged
merged 2 commits into from Jun 23, 2020
Merged

Conversation

alxgu
Copy link
Contributor

@alxgu alxgu commented Apr 9, 2020

SUMMARY

reopening of ansible/ansible#55646

xfs needs to be mounted to be expanted.

Add function to get mountpoint of filesystem.

  • Fail if xfs filesystem is not mounted

xfs growfs needs to be executed on a mountpoint. That will be enforced
now by xfsprogs-4.12.
https://bugzilla.redhat.com/show_bug.cgi?id=1477192

Fixes ansible/ansible#33979

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

filesystem.py

ADDITIONAL INFORMATION

before:

server1| FAILED! => {
    "changed": false,
    "cmd": "/usr/sbin/xfs_growfs -n /dev/vg00/work.tmp",
    "msg": "xfs_growfs: /dev/vg00/work.tmp is not a mounted XFS filesystem",
    "rc": 1,
    "stderr": "xfs_growfs: /dev/vg00/work.tmp is not a mounted XFS filesystem\n",
    "stderr_lines": [
        "xfs_growfs: /dev/vg00/work.tmp is not a mounted XFS filesystem"
    ],
    "stdout": "",
    "stdout_lines": []
}

after:

server1| SUCCESS => {
    "changed": false,
    "msg": "XFS filesystem is using the whole device /dev/vg00/work.tmp"
}

or (when mounted)

server1| SUCCESS => {
    "changed": true,
    "msg": "meta-data=/dev/mapper/vg00-work.tmp isize=512    agcount=4, agsize=32768 blks\n         =                       sectsz=512   attr=2, projid32bit=1\n         =                       crc=1        finobt=1 spinodes=0 rmapbt=0\n         =                       reflink=0\ndata     =                       bsize=4096   blocks=131072, imaxpct=25\n         =                       sunit=0      swidth=0 blks\nnaming   =version 2              bsize=4096   ascii-ci=0 ftype=1\nlog      =internal               bsize=4096   blocks=855, version=2\n         =                       sectsz=512   sunit=0 blks, lazy-count=1\nrealtime =none                   extsz=4096   blocks=0, rtextents=0\ndata blocks changed from 131072 to 134144\n"
}

or (when not mounted)


server1| FAILED! => {
    "changed": false,
    "msg": "/dev/vg00/work.tmp needs to be mounted for xfs operations"
}

xfs needs to be mounted to be expanted.

Add function to get mountpoint of filesystem.

* Fail if xfs filesystem is not mounted

xfs growfs needs to be executed on a mountpoint. That will be enforced
now by xfsprogs-4.12.
https://bugzilla.redhat.com/show_bug.cgi?id=1477192
@ansibullbot ansibullbot added backport bug This issue/PR relates to a bug module module stale_ci CI is older than 7 days, rerun before merging labels Apr 9, 2020
@gundalow gundalow removed the backport label Apr 10, 2020
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks ok. No idea about functionality itself though (can't test)...

changelogs/fragments/33979-xfs_growfs.yml Outdated Show resolved Hide resolved
@holdenSK
Copy link

Would it be possible to backport this to current 2.9 version as well?

@gundalow
Copy link
Contributor

Could a changelog/fragment file please be added

Would it be possible to backport this to current 2.9 version as well?

@holdenSK Once this has been merged, a backport PR can be raised against ansible/ansible:stable-2.9

Co-authored-by: Felix Fontein <felix@fontein.de>
@alxgu
Copy link
Contributor Author

alxgu commented May 15, 2020

@gundalow A changelog/fragment is included.

@ansibullbot ansibullbot removed the stale_ci CI is older than 7 days, rerun before merging label May 15, 2020
@anatolinicolae
Copy link

🤔

@ansibullbot ansibullbot added the stale_ci CI is older than 7 days, rerun before merging label Jun 4, 2020
@gundalow gundalow added the pr_day Has been reviewed during a PR review Day. https://github.com/ansible/community/issues/407 label Jun 17, 2020
@gundalow
Copy link
Contributor

@alxgu Thanks for adding the changelog fragment

@anatolinicolae Hi, are you able to checkout this code locally and test it?

@alessiofachechi @kbrowder @larsbu @trammel Hi, I see you commented on ansible/ansible#55646 and ansible/ansible#33979 would you possible be able to review this change so we can get it merged?

@ansibullbot ansibullbot removed the stale_ci CI is older than 7 days, rerun before merging label Jun 22, 2020
@gundalow gundalow merged commit ae3fde2 into ansible-collections:master Jun 23, 2020
@gundalow
Copy link
Contributor

@alxgu @holdenSK @anatolinicolae @larsbu Thank you all for your work in getting this done.

Would it be possible to backport this to current 2.9 version as well?

@alxgu @holdenSK As this has now been merged, if you'd like to see this fixed in Ansible 2.9 please raise a PR directly against github.com/ansible/ansible stable-2.9 branch that references this PR.

@trammel
Copy link

trammel commented Jan 11, 2021

@alessiofachechi @kbrowder @larsbu @trammel Hi, I see you commented on ansible/ansible#55646 and ansible/ansible#33979 would you possible be able to review this change so we can get it merged?

I'm sorry, but I don't have the same home lab environment anymore, so I'm not really in a position to test this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug community_review module module pr_day Has been reviewed during a PR review Day. https://github.com/ansible/community/issues/407
Projects
None yet
Development

Successfully merging this pull request may close these issues.

resizefs option in filesystem module fails with xfsprogs-4.12 (fedora 27 atomic)
9 participants