-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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 azure disk not available issue when device name changed #57549
fix azure disk not available issue when device name changed #57549
Conversation
change uuid to id
/test pull-kubernetes-unit |
1 similar comment
/test pull-kubernetes-unit |
/assign @brendanburns |
@andyzhangx: GitHub didn't allow me to assign the following users: brendanburns. Note that only kubernetes members can be assigned. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@rootfs @brendandburns @khenidak While without this PR, I have tried same scenario, since we are using
|
also @karataliu since he also hit this issue before, there is a little possibility to hit this issue for one k8s cluster, while if there are large scale usage of azure disk, this issue will certainly happen. |
@andyzhangx the azure troubleshooting guide doesn't suggest use |
Based on discussion here #57444 (comment) and this doc, it seems that udev rules are the most reliable. Any specific reason we are still falling back to crawling /dev/disk/by-id? /dev/disk/by-id looks effective in case of boot/ephemeral disks but not in case of data disks. |
@rootfs Good catch, at first I want to use |
BTW, this PR is only a part of the fix, consider following scenario:
I am working on another PR to fix this issue: check whether directory links are valid when kubelet start up. |
glog.V(12).Infof("azure disk - validating disk %q with sys disk %q", dev[0].Name(), diskName) | ||
if string(dev[0].Name()) == diskName { | ||
glog.V(12).Infof("azureDisk - validating disk %q with sys disk %q", devName, diskName) | ||
if string(devName) == diskName { |
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.
devName already string?
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.
removed
remove string conversion
5579856
to
a4786fc
Compare
/test pull-kubernetes-cross |
@andyzhangx any upcoming fixes go into this one? |
@andyzhangx Thanks I am thinking maybe we don't special handling for CoreOS if we can get Azure udev rules in CoreOs Azure images. @colemickens is possible? I am on slack the entire day today if you want to talk more. |
/test pull-kubernetes-cross |
@khenidak And as I know, there is other PAAS, e.g. cloudfoundry, they also do special handling for no |
@andyzhangx: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
@andyzhangx want to confirm with you, are virtual disk serial number unique and immutable? |
@rootfs yes, it's unique and immutable |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx, rootfs Associated issue: #57444 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 |
thanks for the review, I will cherry-pick this PR to all supported versions, from v1.7-1.9, even 1.6 if possible along with another associated PR. |
Automatic merge from submit-queue (batch tested with PRs 56382, 57549). If you want to cherry-pick this change to another branch, please follow the instructions here. |
…-fix 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 <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. fix device name change issue for azure disk: add remount logic **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](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/troubleshoot-device-names-problems), 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 kubernetes#57952 **Special notes for your reviewer**: this is a corresponding fix of kubernetes#57549, kubernetes#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 ```
Looking through the commit history, it appears that the cherry-picks landed back into 1.8.7. Currently, AKS offers upgrades only to 1.8.2. Is there any expected timeline you can give that would see this fix into an AKS offered version of Kubernetes? Aside from "rolling our own" is there any other option we have on the AKS side that would allow us to get the changes to the provisioning active into our clusters? |
@peskybp AKS use standard k8s original binary, which means the only option is wait for 1.8.7 support on AKS. Did you hit this issue recently? |
I did hit the issue, using an ACS based Kubernetes cluster running 1.7.7. We are already in the process of moving over to AKS based clusters, so was simply hoping that there would be some escalated effort to bring 1.8.7 into AKS given that the azure-disk provisioner is the default StorageClass. Not sure if you are looking for any more debug info at this time, but I still have the affected pod active and should be able to get you some more information, so just let me know. |
What this PR does / why we need it:
There is possibility that device name(
/dev/sd*
) would change when attach/detach data disk in Azure VM according to Troubleshoot Linux VM device name change.And We did hit this issue, see customer case.
This PR would use
/dev/disk/by-id
instead of/dev/sd*
for azure disk and/dev/disk/by-id
would not change even device name changed.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 #57444
Special notes for your reviewer:
In a customer case, customer is unable to use azure disk in StatefulSet since /dev/sd* changed after detach/attach disk.
we are using
/dev/sd*
(code is here) to "mount -bind" k8s path, while/dev/sd*
could be changed when VM is attach/detaching data disks, see Troubleshoot Linux VM device name changeAnd I have also checked related AWS, GCE code, they are using
/dev/disk/by-id/
other than/dev/sd*
, see aws codegce code
Release note:
/sig azure
/assign @rootfs
@karataliu @brendandburns @khenidak