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 the failure of minikube mount in case of KVM2 #10733

Merged
merged 1 commit into from
Mar 9, 2021
Merged

Fix the failure of minikube mount in case of KVM2 #10733

merged 1 commit into from
Mar 9, 2021

Conversation

govargo
Copy link
Contributor

@govargo govargo commented Mar 6, 2021

What type of PR is this?

/kind bug
/area mount
/kind failing-test

What this PR does / why we need it:

Since minikube v1.18.0-beta, minikube mount in case of KVM2 always fail.
This PR will fix this bug.
The detail is here #10696 (comment).

Which issue(s) this PR fixes:

Fix #10696

Does this PR introduce a user-facing change?

Yes. This PR fixes minikube mount in case of KVM2

Before this PR

$ minikube mount /tmp/mounttest215617451:/mount-9p
...
I0306 11:15:57.542156   13465 ssh_runner.go:149] Run: /bin/bash -c "sudo mount -t 9p -o dfltgid=$(grep ^docker: /etc/group | cut -d: -f3),dfltuid=$(id -u docker),msize=262144,port=45947,trans=tcp,version=9p2000.L 192.168.39.181 /mount-9p"
I0306 11:15:57.564055   13465 out.go:129] 

W0306 11:15:57.564223   13465 out.go:191] ❌  Exiting due to GUEST_MOUNT: mount with cmd /bin/bash -c "sudo mount -t 9p -o dfltgid=$(grep ^docker: /etc/group | cut -d: -f3),dfltuid=$(id -u docker),msize=262144,port=45947,trans=tcp,version=9p2000.L 192.168.39.181 /mount-9p" : /bin/bash -c "sudo mount -t 9p -o dfltgid=$(grep ^docker: /etc/group | cut -d: -f3),dfltuid=$(id -u docker),msize=262144,port=45947,trans=tcp,version=9p2000.L 192.168.39.181 /mount-9p": Process exited with status 32
stdout:

stderr:
mount: /mount-9p: mount(2) system call failed: Connection refused.

❌  Exiting due to GUEST_MOUNT: mount with cmd /bin/bash -c "sudo mount -t 9p -o dfltgid=$(grep ^docker: /etc/group | cut -d: -f3),dfltuid=$(id -u docker),msize=262144,port=45947,trans=tcp,version=9p2000.L 192.168.39.181 /mount-9p" : /bin/bash -c "sudo mount -t 9p -o dfltgid=$(grep ^docker: /etc/group | cut -d: -f3),dfltuid=$(id -u docker),msize=262144,port=45947,trans=tcp,version=9p2000.L 192.168.39.181 /mount-9p": Process exited with status 32
stdout:

stderr:
mount: /mount-9p: mount(2) system call failed: Connection refused.

After this PR

$ minikube mount /tmp/mounttest215617451:/mount-9p
...
I0306 10:57:52.161387   13297 mount.go:72] mount successful: ""
I0306 10:57:52.164488   13297 out.go:129] ✅  Successfully mounted /tmp/mounttest215617451 to /mount-9p
✅  Successfully mounted /tmp/mounttest215617451 to /mount-9p
I0306 10:57:52.166544   13297 out.go:129] 

I0306 10:57:52.168562   13297 out.go:129] 📌  NOTE: This process must stay alive for the mount to be accessible ...
📌  NOTE: This process must stay alive for the mount to be accessible ...

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

NONE

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. area/mount kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 6, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @govargo. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 6, 2021
@govargo
Copy link
Contributor Author

govargo commented Mar 6, 2021

/assign @medyagh

@govargo
Copy link
Contributor Author

govargo commented Mar 6, 2021

Hi medya,
Could you comment /ok-to-test?
I'd like to check if TestFunctional/parallel/MountCmd of KVM test works.

Thank you,

@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@medyagh
Copy link
Member

medyagh commented Mar 6, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 6, 2021
return []byte{}, errors.Wrap(err, "Error getting VM/Host IP address")
}
return net.ParseIP(ip), nil
return net.ParseIP("192.168.39.1"), nil
Copy link
Member

Choose a reason for hiding this comment

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

are u sure this is doing the right thing ? what if the KVM user has multiple minikube profiles, will they have same IP ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It was hardcoded before, but we missed to add the .1 at the end when making it more generic: d48b0a5

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed this. I wrote as the same as the vmware case.

@minikube-pr-bot
Copy link

kvm2 Driver
error collecting results for kvm2 driver: timing run 0 with Minikube (PR 10733): timing cmd: [/home/performance-monitor/.minikube/minikube-binaries/10733/minikube start --driver=kvm2]: starting cmd: fork/exec /home/performance-monitor/.minikube/minikube-binaries/10733/minikube: exec format error
docker Driver
error collecting results for docker driver: timing run 0 with Minikube (PR 10733): timing cmd: [/home/performance-monitor/.minikube/minikube-binaries/10733/minikube start --driver=docker]: starting cmd: fork/exec /home/performance-monitor/.minikube/minikube-binaries/10733/minikube: exec format error

Copy link
Collaborator

@afbjorklund afbjorklund left a comment

Choose a reason for hiding this comment

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

Leave the "GetIP", but change the last digit. That should work on most networks.

Like the VMware driver: return net.IPv4(vmIP[0], vmIP[1], vmIP[2], byte(1)), nil

@afbjorklund afbjorklund added co/kvm2-driver KVM2 driver related issues and removed co/kvm2-driver KVM2 driver related issues labels Mar 7, 2021
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 8, 2021
@govargo
Copy link
Contributor Author

govargo commented Mar 8, 2021

Thank you very much @afbjorklund !!

I changed the code as you pointed out.

@govargo
Copy link
Contributor Author

govargo commented Mar 8, 2021

I can check the multiple minikube profiles case.

$ ./out/minikube start -p profile1
$ ./out/minikube start -p profile2
$ ./out/minikube mount /tmp/mounttest215617451:/mount-9p -p profile1
📁  Mounting host path /tmp/mounttest215617451 into VM as /mount-9p ...
    ▪ Mount type:   
    ▪ User ID:      docker
    ▪ Group ID:     docker
    ▪ Version:      9p2000.L
    ▪ Message Size: 262144
    ▪ Permissions:  755 (-rwxr-xr-x)
    ▪ Options:      map[]
    ▪ Bind Address: 192.168.39.1:44523
🚀  Userspace file server: ufs starting
✅  Successfully mounted /tmp/mounttest215617451 to /mount-9p

📌  NOTE: This process must stay alive for the mount to be accessible ...
$ ./out/minikube mount /tmp/mounttest215617451:/mount-9p -p profile2
📁  Mounting host path /tmp/mounttest215617451 into VM as /mount-9p ...
    ▪ Mount type:   
    ▪ User ID:      docker
    ▪ Group ID:     docker
    ▪ Version:      9p2000.L
    ▪ Message Size: 262144
    ▪ Permissions:  755 (-rwxr-xr-x)
    ▪ Options:      map[]
    ▪ Bind Address: 192.168.39.1:42719
🚀  Userspace file server: ufs starting
✅  Successfully mounted /tmp/mounttest215617451 to /mount-9p

@sharifelgamal sharifelgamal merged commit 9425f6c into kubernetes:master Mar 9, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: govargo, sharifelgamal

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 9, 2021
@govargo govargo deleted the fix-mount-kvm2 branch March 12, 2021 07:52
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. area/mount cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

KVM failing test: TestFunctional/parallel/MountCmd
7 participants