-
Notifications
You must be signed in to change notification settings - Fork 31
Fix locating resporce-pool specified in the vsphere.conf file #493
Comments
We have a bug here. See the following code. Call trace. Code block where fix needs to be made.
Here method accept the This can be resolved with using correct method - func (f *Finder) ResourcePoolOrDefault(ctx context.Context, path string) (*object.ResourcePool, error) I will make above change. and try to cherry pick in older releases. Regarding asking users to put |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fix locating resourcepool-path specified in the vsphere.conf file **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" ``` 2) 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" ``` 3) Verified above with having multiple clusters with the same name in one datacenter. 4) 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](https://user-images.githubusercontent.com/22985595/42792922-738e3f9c-892c-11e8-9e51-32e2328b116b.png) Current documentation describes `resourcepool-path`configuration 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**: ```release-note Fix for resourcepool-path configuration in the vsphere.conf file. ``` cc: @kubernetes/vmware
Closing this issue. PR merged to master branch. I will cherry pick this change to other release branches. |
Is this a BUG REPORT or FEATURE REQUEST?:
What happened:
We need to use
resourcepool-path
when we use SPBM policies with dynamic provisioning in vSphere Cloud Provider or the PVC provisioning fails with errorWarning ProvisioningFailed 3m (x61 over 18m) persistentvolume-controller Failed to provision volume with StorageClass "xxx": default compute resource resolves to multiple instances, please specify
resourcepool-path is the path to resource pool where dummy VMs for Storage Profile Based volume provisioning should be created. It is optional parameter.
If admin changes the name of their VC cluster with above configuration, dynamic provisioning breaks.
Failed to provision volume with StorageClass "xxx": compute resource '/datacenter-xxx/host/cluster-xxx' not found.
Using an identifier based on MoID instead of path for compute resource would be more stable.
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment:
kubectl version
): 1.10.2NAME="VMware Photon OS"
VERSION="2.0"
ID=photon
VERSION_ID=2.0
PRETTY_NAME="VMware Photon OS/Linux"
ANSI_COLOR="1;34"
HOME_URL="https://vmware.github.io/photon/"
BUG_REPORT_URL="https://github.com/vmware/photon/issues"
uname -a
):Linux 8db8581d738e41c49ec61003ea3e8f51 4.9.101-1.ph2-esx WIP: Address lack of support within Kubernetes to consume vSphere managed storage #1-photon SMP Tue May 22 01:42:59 UTC 2018 x86_64 Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz GenuineIntel GNU/Linux
The text was updated successfully, but these errors were encountered: