VMware Persistent Storage Path Folder

I have a small Rancher cluster which I am able to easily deploy to my vCenter. However, I did not initially set it up with a Cloud Provider as I will require persistent storage. I am in the process of doing a redeploy and have been hitting a wall getting it to locate the folder. It appears, looking through vCenter logs to be able to connect and even see the datastore.

Rancher Version: 2.2.8
vCenter: 6.7 onto a 6.5 ESXi host
CentOS7 (fully patched)

Here is the cloud provider setup I’m using and I’m hoping my mistake is small:

cloud_provider:
  name: vsphere
  vsphereCloudProvider:
    global:
      insecure-flag: true
    virtual_center:
      www.vcenterserver.com:
        user: administrator@vsphere.local  
        password: blahblahblah
        datacenters: Datacenter
    workspace:
      server: www.vcenterserver.com:
      folder: rancher-pv-01
      datacenter: Datacenter
      default-datastore: SC02
    disk:
      scsicontrollertype: pvscsi
    network:
      public-network: DHCP

Forgot to include the error:

I0924 18:03:04.603132 1 event.go:209] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"vol-01", UID:"0cfbd0ec-def5-11e9-8275-005056b17f97", APIVersion:"v1", ResourceVersion:"7961", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' Failed to provision volume with StorageClass "vcenter-storage-class": folder 'rancher-pv-01' not found

Hello Bryan, I’m in the exact same boat and wondering if you ever solved this? I’ve tried manually creating the vmdk, storage class, very basic pods, etc… and many different combinations of configurations, yet I can not get the volume to mount in my pod. Any help would be appreciated. I’m on 6.7u3 esxi hosts with a vsan.

We are also having this issue. Our situation is identical. The “workspace.folder” setting is where the VM itself is kept in our vCenter hierarchy, and cannot be changed.

Our default storage class was created to use the vSphere cloud provider. Creating a PVC results in the same error as OP. What is confusing is that the vSphere volume fails its attempt to be created in the same folder that the VM is created in. Why is this the location for the volume, and why isn’t there a config option to change this?

What would sense is for the VM to be created in “workspace.folder” while volumes are created in “workspace.default-datastore/workspace.volume-folder” or something like that.

Note that this was not an issue in previous versions of Rancher (or maybe this is a k8s issue?). Before upgrading to the latest Rancher (v2.3.5) and k8s (v1.17), our deployment placed the VM in “workspace.folder” and the volumes in “workspace.default-datastore/kubevols/”