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

VSAN support for VSphere Volume Plugin #29172

Merged
merged 1 commit into from
Aug 4, 2016

Conversation

abrarshivani
Copy link
Contributor

@abrarshivani abrarshivani commented Jul 19, 2016

This PR does the following,

  • Fixes VSphere Volume doesn't unmount #28625 (VSphere Volume doesn't unmount): modified vmdk namespace path parsing so it accurately handles VMs in folders. See file pkg/volume/vsphere_volume/vsphere_volume.go.
  • Updates vmware/govmomi dependency. It was quite behind. The majority of files in the change are in this category.
  • Adds support for VSAN datastore. Handle namespace to uuid mapping to assist unmount and detach in VSAN case as well. See file pkg/cloudprovider/providers/vsphere/vsphere.go.

Tested:
- Created a K8s cluster on VSphere with VSAN datastore. Created a vmdk in VSAN datastore and created pod which uses this vmdk. Before fix (VSphere Volume doesn't unmount) it failed. After fix the volume gets successfully unmounted and detached.
- Created a K8s cluster on VSphere with VMFS datastore. Created a vmdk in subdirectory of root in VMFS datastore and created pod which uses this vmdk. Before fix (VSphere Volume doesn't unmount) it failed. After fix the volume gets successfully unmounted and detached.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@k8s-bot
Copy link

k8s-bot commented Jul 19, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

4 similar comments
@k8s-bot
Copy link

k8s-bot commented Jul 19, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-bot
Copy link

k8s-bot commented Jul 19, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-bot
Copy link

k8s-bot commented Jul 19, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-bot
Copy link

k8s-bot commented Jul 19, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-label-needed labels Jul 19, 2016
@frapposelli
Copy link
Member

Ping @googlebot as I've just added @abrarshivani in the vmware contributors group.

@abrarshivani
Copy link
Contributor Author

ping @googlebot

@googlebot
Copy link

CLAs look good, thanks!

@abrarshivani abrarshivani changed the title Updated vmware/govmomi godep VSAN support for VSphere Volume Plugin Jul 20, 2016
@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 20, 2016
return uuid
}

//Gets virtual disk uuid by datastore path. Here, datastore path can be both containing vsan object name or uuid.
Copy link

Choose a reason for hiding this comment

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

whats a vsan object name, is it a datastore vmdk path? does this mean volPath argument can be a uuid as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch @abhitap. I will adjust the comments to this:

// Gets virtual disk uuid by datastore (namespace) path
//
// volPath can be namespace path (e.g. "[vsanDatastore] volumes/test.vmdk") or 
// uuid path (e.g. "[vsanDatastore] 59427457-6c5a-a917-7997-0200103eedbc/test.vmdk").
// `volumes` in this case would be a symlink to 
// `59427457-6c5a-a917-7997-0200103eedbc`.  
//
// We want users to use namespace path. It is good for attaching the disk, 
// but for detaching the API requires uuid path.  Hence, to detach the right 
// device we have to convert the namespace path to uuid path. 

@abrarshivani
Copy link
Contributor Author

//cc @dagnello @imkin

@abrarshivani abrarshivani force-pushed the govmomidepupdate branch 4 times, most recently from 9178fce to d2c7bd7 Compare July 24, 2016 02:06
}
return "", ErrNoDiskUUIDFound
}

func getVirtualDiskID(volPath string, vmDevices object.VirtualDeviceList) (string, error) {
func formatVirtualDiskUUID(uuid string) string {

Copy link
Member

Choose a reason for hiding this comment

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

spurious newline

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the comments! The newline is not needed.

}

func getVirtualDiskID(volPath string, vmDevices object.VirtualDeviceList, dc *object.Datacenter, client *govmomi.Client) (string, error) {

Copy link
Member

Choose a reason for hiding this comment

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

spurious newline

@pmorie
Copy link
Member

pmorie commented Jul 27, 2016

Just a couple nits and this LGTM. Does it need a release note? It sounds to me like it might be worthy of release note, but I'm not certain.

@k8s-github-robot k8s-github-robot added do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. retest-not-required-docs-only and removed retest-not-required-docs-only labels Jul 28, 2016
@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 29, 2016
@abrarshivani
Copy link
Contributor Author

@pmorie This PR needs release note.

@k8s-bot
Copy link

k8s-bot commented Aug 3, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

Otherwise, if this message is too spammy, please complain to ixdy.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 3, 2016
@pmorie pmorie added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Aug 3, 2016
- Fix unmount for vsanDatastore
- Add support for vsan datastore
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 3, 2016
@pmorie pmorie added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. labels Aug 4, 2016
@pmorie
Copy link
Member

pmorie commented Aug 4, 2016

@k8s-bot ok to test

@k8s-bot
Copy link

k8s-bot commented Aug 4, 2016

GCE e2e build/test passed for commit 87e7535.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Aug 4, 2016

GCE e2e build/test passed for commit 87e7535.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit df8da19 into kubernetes:master Aug 4, 2016
k8s-github-robot pushed a commit that referenced this pull request Sep 12, 2016
Automatic merge from submit-queue

Back porting critical vSphere bug fixes to release 1.3

vSphere cloud provider plugin was first introduced in Kubernetes 1.3.0.  The two PRs listed below contain critical volume attach/detach related fixes.  Without these fixes, vSphere in 1.3 lacks the ability to consistently attach/detach volumes correctly especially in a busy cluster.

These changes only affect the vSphere cloud provider.

- #29172
- #30535
shyamjvs pushed a commit to shyamjvs/kubernetes that referenced this pull request Dec 1, 2016
…BugFixes

Automatic merge from submit-queue

Back porting critical vSphere bug fixes to release 1.3

vSphere cloud provider plugin was first introduced in Kubernetes 1.3.0.  The two PRs listed below contain critical volume attach/detach related fixes.  Without these fixes, vSphere in 1.3 lacks the ability to consistently attach/detach volumes correctly especially in a busy cluster.

These changes only affect the vSphere cloud provider.

- kubernetes#29172
- kubernetes#30535
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VSphere Volume doesn't unmount
7 participants