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

Fix disable swap failed in Centos/RHEL 7 #10751

Merged

Conversation

yankay
Copy link
Member

@yankay yankay commented Dec 28, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

After #10587 , the swap cannot be disabled in Centos/RHEL 7.
After some investigating, the swap cannot be disabled by systemctl mask swap.target in this os. And it should be disabled by modify the /etc/fstab according to https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/s1-swap-removing

Which issue(s) this PR fixes:

Fixes #10741
Fixes #10581

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Fix disable swap failed in Centos/RHEL 7

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 28, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yankay

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 28, 2023
@yankay yankay mentioned this pull request Dec 28, 2023
@VannTen
Copy link
Contributor

VannTen commented Dec 29, 2023

After some investigating, the swap cannot be disabled by systemctl mask swap.target in this os

Did you find out which version of systemd changed that ?
I found systemd/systemd@90060fa which could have explained that kind of thing but the reported version in #10741 should have it as well. I'm gonna ask on systemd mailing list if they have idea.

@yankay
Copy link
Member Author

yankay commented Jan 2, 2024

After some investigating, the swap cannot be disabled by systemctl mask swap.target in this os

Did you find out which version of systemd changed that ? I found systemd/systemd@90060fa which could have explained that kind of thing but the reported version in #10741 should have it as well. I'm gonna ask on systemd mailing list if they have idea.

Hi @VannTen

The systemds version is 219.

[root@kay18x ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"

[root@kay18x ~]# uname -r
3.10.0-1160.el7.x86_64

[root@kay18x ~]# systemctl --version
systemd 219

Because the Centos 7 is still widely used, the swap disable is important to Kubernetes.
And the PR can also fix the #10581 ,

Would you please give a lgtm to this PR :-)

@VannTen
Copy link
Contributor

VannTen commented Jan 8, 2024

/lgtm
For future ref for myself, the root cause:
It looks like .device units backing .swap units automatically get a Wants on the swap unit, not sure why (unless I missed a SYSTEMD_WANTS udev property on the blocks).

Happens with lvm, but probably without it as well.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 8, 2024
@k8s-ci-robot k8s-ci-robot merged commit 2e8b72e into kubernetes-sigs:master Jan 8, 2024
65 checks passed
@yankay
Copy link
Member Author

yankay commented Jan 9, 2024

/lgtm For future ref for myself, the root cause: It looks like .device units backing .swap units automatically get a Wants on the swap unit, not sure why (unless I missed a SYSTEMD_WANTS udev property on the blocks).

Happens with lvm, but probably without it as well.

@VannTen , Thank you for the PR review :-)

ledroide pushed a commit to ledroide/kubespray that referenced this pull request Jan 9, 2024
pedro-peter pushed a commit to pedro-peter/kubespray that referenced this pull request May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
3 participants