-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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
fix device name change issue for azure disk: add remount logic #57953
Conversation
/assign @rootfs |
@karataliu @feiskyer @khenidak PTAL, thx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[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 |
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. |
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:
/var/lib/kubelet/plugins/kubernetes.io/azure-disk/mounts/m358246426
: in MountDevice func/var/lib/kubelet/pods/950f2eb8-d4e7-11e7-bc95-000d3a041274/volumes/kubernetes.io~azure-disk/pvc-67e4e319-d4e7-11e7-bc95-000d3a041274
: in SetUpAt funcWhich 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:
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.