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

Add support for vSphere volume mount/attach on Windows #80911

Merged
merged 1 commit into from Aug 28, 2019

Conversation

@gab-satchi
Copy link
Contributor

commented Aug 2, 2019

What type of PR is this?
/kind feature

What this PR does / why we need it:
Adds support for attaching and mounting vSphere volumes on Windows. Analogous to this AWS PR #79552

Special notes for your reviewer:
ReadOnly volumes do not work. It seems like other Windows-compatible volume drivers also have this limitation right now.

Does this PR introduce a user-facing change?:

Adds support for vSphere volumes on Windows
@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Aug 2, 2019

Welcome @gab-satchi!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Aug 2, 2019

Hi @gab-satchi. 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.

@gab-satchi

This comment has been minimized.

Copy link
Contributor Author

commented Aug 2, 2019

/sig windows
/sig storage
/sig vsphere

@benmoss

This comment has been minimized.

Copy link
Member

commented Aug 2, 2019

/ok-to-test
/sig vmware

@benmoss benmoss force-pushed the pivotal-k8s:vsphere-windows-volumes branch from 7d99423 to a2dc83d Aug 2, 2019
@benmoss

This comment has been minimized.

Copy link
Member

commented Aug 2, 2019

/retest

@rhockenbury

This comment has been minimized.

Copy link

commented Aug 6, 2019

/test pull-kubernetes-integration

1 similar comment
@gab-satchi

This comment has been minimized.

Copy link
Contributor Author

commented Aug 7, 2019

/test pull-kubernetes-integration

@gab-satchi

This comment has been minimized.

Copy link
Contributor Author

commented Aug 12, 2019

/assign @abrarshivani

@PatrickLang PatrickLang added this to In Progress (v1.16) in SIG-Windows Aug 15, 2019
@PatrickLang

This comment has been minimized.

Copy link
Contributor

commented Aug 15, 2019

LGTM from a SIG-Windows standpoint, but I'm not a reviewer for vsphere

@benmoss

This comment has been minimized.

Copy link
Member

commented Aug 19, 2019

@frapposelli

This comment has been minimized.

Copy link
Member

commented Aug 19, 2019

/provider vsphere

@michmike

This comment has been minimized.

Copy link
Contributor

commented Aug 22, 2019

@saad-ali would you be able to review and approve this change?
thanks!

if runtime.GOOS == "windows" {
dir = filepath.Dir(deviceMountPath)
}
if err := os.MkdirAll(dir, 0750); err != nil {

This comment has been minimized.

Copy link
@SandeepPissay

SandeepPissay Aug 22, 2019

Contributor

For Linux OS - before this change, the code was creating directory on deviceMountPath. But now, we seem to be creating directory on devicePath. Could you explain the reason?

This comment has been minimized.

Copy link
@benmoss

benmoss Aug 22, 2019

Member

I think this might be an oversight, let me confirm

This comment has been minimized.

Copy link
@benmoss

benmoss Aug 23, 2019

Member

@SandeepPissay I confirmed that this was just a mistake and fixed the error

@benmoss benmoss force-pushed the pivotal-k8s:vsphere-windows-volumes branch from a2dc83d to 4e92b1f Aug 23, 2019
@SandeepPissay

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2019

/lgtm

@SandeepPissay

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2019

@divyenpatel Can you take a look at this pull request?


import "errors"

func verifyDevicePath(path string) (string, error) {

This comment has been minimized.

Copy link
@divyenpatel

divyenpatel Aug 24, 2019

Member

I see build for this file is // +build !linux,!windows, what are other supported build platform?

This comment has been minimized.

Copy link
@benmoss

benmoss Aug 26, 2019

Member

There aren't any other supported platforms, that's why this file is called _unsupported.go. This is a common pattern in Go when introducing platform-specific files, to include an _unsupported file that will still allow things to compile on others but leaves it up to someone who wants to make it work to add the necessary code.

klog.Errorf("Failed to create directory at %#v. err: %s", deviceMountPath, err)
dir := deviceMountPath
if runtime.GOOS == "windows" {
dir = filepath.Dir(deviceMountPath)

This comment has been minimized.

Copy link
@divyenpatel

divyenpatel Aug 24, 2019

Member

later if error occurs for diskMounter.FormatAndMount
we do os.Remove(deviceMountPath), may be for windows you need os.Remove(filepath.Dir(deviceMountPath))

This comment has been minimized.

Copy link
@benmoss

benmoss Aug 26, 2019

Member

There will be a symlink at deviceMountPath, I think we want to delete that, the same as on Linux. It looks like on both platforms the directory is left?

This comment has been minimized.

Copy link
@divyenpatel

divyenpatel Aug 27, 2019

Member

In windows deviceMountPath symlink will be available after mount is successful, but if mount fails before format, there is no symlink. os.Remove will return err which are ignoring.

In linux deviceMountPath directory is created with os.MkdirAll, and later device is mounted in this directory, so if mount fails we delete deviceMountPath directory.

but I think we are ok, as os.Remove returns error, which we are ignoring, and returns mount failure back to the caller.

Can you clarify if that is not the case?

// On Windows, Mount will create the parent of dir and mklink (create a symbolic link) at dir later, so don't create a
// directory at dir now. Otherwise mklink will error: "Cannot create a file when that file already exists".
if err := os.MkdirAll(dir, 0750); err != nil {
klog.V(4).Infof("Could not create directory %s: %v", dir, err)

This comment has been minimized.

Copy link
@divyenpatel

divyenpatel Aug 24, 2019

Member

klog.V(4).Infof => klog.Errorf

@divyenpatel

This comment has been minimized.

Copy link
Member

commented Aug 24, 2019

/assign @divyenpatel

Signed-off-by: Ben Moss <bmoss@pivotal.io>
@benmoss benmoss force-pushed the pivotal-k8s:vsphere-windows-volumes branch from 4e92b1f to c7c755a Aug 26, 2019
@k8s-ci-robot k8s-ci-robot removed the lgtm label Aug 26, 2019
@divyenpatel

This comment has been minimized.

Copy link
Member

commented Aug 27, 2019

/approve

@divyenpatel

This comment has been minimized.

Copy link
Member

commented Aug 27, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Aug 27, 2019
@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Aug 27, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: divyenpatel, gab-satchi

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

@fejta-bot

This comment has been minimized.

Copy link

commented Aug 27, 2019

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@benmoss

This comment has been minimized.

Copy link
Member

commented Aug 27, 2019

/retest

@k8s-ci-robot k8s-ci-robot merged commit 77277d3 into kubernetes:master Aug 28, 2019
24 checks passed
24 checks passed
cla/linuxfoundation gab-satchi authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-conformance-kind-ipv6 Skipped.
pull-kubernetes-cross Skipped.
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-iscsi Skipped.
pull-kubernetes-e2e-gce-iscsi-serial Skipped.
pull-kubernetes-e2e-gce-storage-slow Job succeeded.
Details
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-node-e2e-containerd Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details
SIG-Windows automation moved this from In Progress (v1.16) to Done (v1.16) Aug 28, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.16 milestone Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.