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 device name change issue for azure disk: add remount logic #57953

Merged

Conversation

andyzhangx
Copy link
Member

@andyzhangx andyzhangx commented Jan 8, 2018

What this PR does / why we need it:
fix device name change issue for azure disk: add remount logic

Accoding to Troubleshoot Linux VM device name change, there is possibility of device name change, so when kubelet is restarted, we need to check whether the following two paths are still valid:

  1. /var/lib/kubelet/plugins/kubernetes.io/azure-disk/mounts/m358246426: in MountDevice func
  2. /var/lib/kubelet/pods/950f2eb8-d4e7-11e7-bc95-000d3a041274/volumes/kubernetes.io~azure-disk/pvc-67e4e319-d4e7-11e7-bc95-000d3a041274: in SetUpAt func

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #57952

Special notes for your reviewer:
this is a corresponding fix of #57549, #57549 uses '/dev/disk/by-id', and this PR would check whether the mountPath is valid when kubelet restart(e.g. after VM reboot since device name may change), if not valid, remount, remember '/dev/disk/by-id' will be always valid.

Release note:

fix device name change issue for azure disk: add remount logic

Update:
I tested this PR again, it works well. While there is some corner case that data disk device name may change after attach/detach data disk, in this situation, reboot that VM or run docker restart $(docker ps -q) to restart all containers on that VM.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 8, 2018
@andyzhangx
Copy link
Member Author

/assign @rootfs

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 8, 2018
@andyzhangx
Copy link
Member Author

@khenidak @karataliu

@andyzhangx
Copy link
Member Author

@karataliu @feiskyer @khenidak PTAL, thx

Copy link
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 10, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx, feiskyer

Associated issue: #57952

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 57733, 57613, 57953). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit b9a6242 into kubernetes:master Jan 10, 2018
k8s-github-robot pushed a commit that referenced this pull request Jan 11, 2018
…7953-upstream-release-1.9

Automatic merge from submit-queue.

Automated cherry pick of #57953: add remount logic if original mount path is invalid

Cherry pick of #57953 on release-1.9.

#57953: add remount logic if original mount path is invalid
k8s-github-robot pushed a commit that referenced this pull request Jan 12, 2018
…7953-upstream-release-1.7

Automatic merge from submit-queue.

Automated cherry pick of #57953

Cherry pick of #57953 on release-1.7.

#57953: add remount logic if original mount path is invalid
k8s-github-robot pushed a commit that referenced this pull request Jan 12, 2018
…7953-upstream-release-1.8

Automatic merge from submit-queue.

Automated cherry pick of #57953

Cherry pick of #57953 on release-1.8.

#57953: add remount logic if original mount path is invalid
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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix device name change issue for azure disk: add remount logic
5 participants