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 azure file plugin failure issue on Windows after node restart #60625

Merged
merged 1 commit into from
Mar 1, 2018

Conversation

andyzhangx
Copy link
Member

What this PR does / why we need it:
azure file plugin on Windows does not work after node restart, this is due to New-SmbGlobalMapping powershell cmdlet has lost account name/key after reboot, we should remove the invalid link and do the mount again after kubelet restart.
add remount logic for azure file plugin in this PR

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 #60624

Special notes for your reviewer:

Release note:

fix azure file plugin failure issue on Windows after node restart

/sig azure
/sig windows
/assign @karataliu
@feiskyer pls mark this PR as v1.10 milestone, thanks

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/azure sig/windows Categorizes an issue or PR as relevant to SIG Windows. 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 Mar 1, 2018
@k8s-ci-robot k8s-ci-robot requested review from feiskyer and rootfs March 1, 2018 06:18
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 1, 2018
@andyzhangx
Copy link
Member Author

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 1, 2018
@feiskyer feiskyer added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Mar 1, 2018
@feiskyer feiskyer added this to the v1.10 milestone Mar 1, 2018
@feiskyer
Copy link
Member

feiskyer commented Mar 1, 2018

Added to v1.10 milestone since it is a critical bug fix.

cc @jdumars

@@ -241,8 +242,20 @@ func (b *azureFileMounter) SetUpAt(dir string, fsGroup *int64) error {
return err
}
if !notMnt {
return nil
// testing original mount point, make sure the mount link is valid
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this for windows only? consider applying 'if runtime.GOOS == "windows" '

Copy link
Member Author

Choose a reason for hiding this comment

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

I would like to make it generic, same logic as azure-disk mount: https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/azure_dd/azure_mounter.go#L88-L100

return nil
// testing original mount point, make sure the mount link is valid
if _, err := ioutil.ReadDir(dir); err == nil {
glog.V(2).Infof("azureFile - already mounted to target %s", dir)
Copy link
Contributor

Choose a reason for hiding this comment

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

level V(2) maybe to high for the hint, probably <=4 as Line#240

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

glog.Errorf("azureFile - Unmount directory %s failed with %v", dir, err)
return err
}
notMnt = true
Copy link
Contributor

Choose a reason for hiding this comment

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

this notMnt val is not used later

Copy link
Member Author

Choose a reason for hiding this comment

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

notMnt should set as true since it's not a mounting point after unmount, same logic as azure disk

Copy link
Member Author

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

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

@karataliu fixed comments

@@ -241,8 +242,20 @@ func (b *azureFileMounter) SetUpAt(dir string, fsGroup *int64) error {
return err
}
if !notMnt {
return nil
// testing original mount point, make sure the mount link is valid
Copy link
Member Author

Choose a reason for hiding this comment

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

I would like to make it generic, same logic as azure-disk mount: https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/azure_dd/azure_mounter.go#L88-L100

return nil
// testing original mount point, make sure the mount link is valid
if _, err := ioutil.ReadDir(dir); err == nil {
glog.V(2).Infof("azureFile - already mounted to target %s", dir)
Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

glog.Errorf("azureFile - Unmount directory %s failed with %v", dir, err)
return err
}
notMnt = true
Copy link
Member Author

Choose a reason for hiding this comment

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

notMnt should set as true since it's not a mounting point after unmount, same logic as azure disk

Copy link
Contributor

@karataliu karataliu 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 Mar 1, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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-github-robot
Copy link

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

@k8s-github-robot k8s-github-robot merged commit 6a7135b into kubernetes:master Mar 1, 2018
k8s-github-robot pushed a commit that referenced this pull request Mar 17, 2018
…0625-upstream-release-1.8

Automatic merge from submit-queue.

Automated cherry pick of #60625

Cherry pick of #60625 on release-1.8.

#60625: add remount logic for azure file plugin
k8s-github-robot pushed a commit that referenced this pull request Mar 22, 2018
…0625-upstream-release-1.9

Automatic merge from submit-queue.

Automated cherry pick of #60625

Cherry pick of #60625 on release-1.9.

#60625: add remount logic for azure file plugin
@andyzhangx andyzhangx deleted the azurefile-remount branch May 8, 2018 07:17
andyzhangx added a commit to andyzhangx/kubernetes that referenced this pull request May 16, 2018
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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/windows Categorizes an issue or PR as relevant to SIG Windows. 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.

azure file plugin on Windows does not work after node restart
6 participants