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 locating resourcepool-path specified in the vsphere.conf file #66261

Merged

Conversation

divyenpatel
Copy link
Member

What this PR does / why we need it:
When volume is provisioned using the vsphere storage policy, resourcepool-path specified in the vsphere.conf file is used for creating a shadow/dummy VM. Dummy VM is temporarily created and then deleted once volume is created on the compatible Datastore.

At present If user specifies resourcepool-path in the vsphere.conf file, volume provisioner is not able to locate the compute resource for the given path. This is because look up is made using finder.DefaultComputeResource(ctx) and finder.ComputeResource(ctx, computePath), which is not correct. If user specifies name of the cluster or cluster path then provisioning works.

This is resolved with using correct govmomi method - func (f *Finder) ResourcePoolOrDefault(ctx context.Context, path string) (*object.ResourcePool, error)

Which issue(s) this PR fixes
Fixes # vmware-archive#493

Special notes for your reviewer:
Following testing is performed for this change.

  1. specified resource-pool path in the vsphere.conf file and verified VM is created under the specified resource pool.
resourcepool-path="ClusterFolder-1/cluster-vsan-1/Resources/ShadowVMPool"
  1. If resource pool is not available, specified cluster's default resource pool path in the vsphere.conf file and verified volume provisioning works. For this case, VM is directly created under cluster.
resourcepool-path="ClusterFolder-1/cluster-vsan-1/Resources"
  1. Verified above with having multiple clusters with the same name in one datacenter.
  2. Verified with empty resource pool path in the vsphere.conf file.
resourcepool-path=""

As expected, provisioning is failing with Failed to provision volume with StorageClass "vsan-gold-policy": no default resource pool found.

Refer to this datacenter inventory for the path specified in the resourcepool-path configuration.

image

Current documentation describes resourcepool-pathconfiguration is optional, which needs to be corrected once PR is merged. For policy based provisioning this is not an optional parameter.

Documentation link: https://vmware.github.io/vsphere-storage-for-kubernetes/documentation/existing.html

Release note:

Fix for resourcepool-path configuration in the vsphere.conf file.

cc: @kubernetes/vmware

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. 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. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 17, 2018
@divyenpatel divyenpatel changed the title Fix locating resporce-pool specified in the vsphere.conf file Fix locating resourcepool-path specified in the vsphere.conf file Jul 17, 2018
Copy link
Contributor

@SandeepPissay SandeepPissay left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@SandeepPissay
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 17, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: divyenpatel, SandeepPissay

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

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit cdc411e into kubernetes:master Jul 17, 2018
k8s-github-robot pushed a commit that referenced this pull request Jul 20, 2018
…-upstream-release-1.10

Automatic merge from submit-queue.

Automated cherry pick of #66261 to upstream release-1.10

Cherry pick of #66261 on release-1.10
#66261: Fix locating resourcepool-path specified in the vsphere.conf file

Release note:

```
Fix locating resourcepool-path specified in the vsphere.conf file
```


cc: @kubernetes/vmware
k8s-github-robot pushed a commit that referenced this pull request Jul 25, 2018
…-upstream-release-1.9

Automatic merge from submit-queue.

Automated cherry pick of #66261 to upstream release-1.9

Cherry pick of #66261 on release-1.9
#66261: Fix locating resourcepool-path specified in the vsphere.conf file

Release note:

```
Fix locating resourcepool-path specified in the vsphere.conf file
```


cc: @kubernetes/vmware
@marpaia
Copy link
Contributor

marpaia commented Jul 25, 2018

/sig vmware

@k8s-ci-robot k8s-ci-robot added the area/provider/vmware Issues or PRs related to vmware provider label Jul 25, 2018
k8s-github-robot pushed a commit that referenced this pull request Aug 2, 2018
…-upstream-release-1.11

Automatic merge from submit-queue.

Automated cherry pick of #66261 to upstream release-1.11

Cherry pick of #66261 on release-1.11
#66261: Fix locating resourcepool-path specified in the vsphere.conf file

Release note:

```
Fix locating resourcepool-path specified in the vsphere.conf file
```

cc: @kubernetes/vmware
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/provider/vmware Issues or PRs related to vmware provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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/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.

6 participants