https://rancher.com/ logo
Title
d

dry-addition-50211

07/05/2022, 3:48 PM
Hi, I’ve had success with Rancher on vSphere prior but now I receive an error saying “Unable to access the virtual machine configuration: Unable to access file [Datastore]“. I’m not sure what has changed as I was able to deploy clusters through this method before. For testing, the cloud credential user has full permissions to access all resources on vSphere. Any suggestions?
m

modern-television-79263

07/05/2022, 7:14 PM
Between versions 2.2 and 2.4 and later the yaml changed. The vSphere Cloud Provider config now goes under
rancher_kubernetes_engine_config:
If you’re using the in-tree provider, the
default-datastore
section in the yaml needs to have the name of the datastore for the vSphere storage class. The
folder
section needs to have the path of the folder structure in vSphere where the node VMs will keep their data.
My example:
rancher_kubernetes_engine_config:
  addon_job_timeout: 30
  authentication:
    strategy: x509
  bastion_host:
    ssh_agent_auth: false
  cloud_provider:
    name: vsphere
    vsphere_cloud_provider:
      global:
        datacenters: 'DC1, DC2'
        insecure-flag: true
        soap-roundtrip-count: 0
        user: rancher_superuser
      virtual_center:
        <http://vsphere.org|vsphere.org>:
          datacenters: 'DC1, DC2'
          soap-roundtrip-count: 0
      workspace:
        datacenter: DC1
        default-datastore: kube_vol_dc1
        folder: /DC1/vm/Operations/Linux
        server: <http://vsphere.org|vsphere.org>
  ignore_docker_version: true
d

dry-addition-50211

07/06/2022, 6:23 PM
Hi @modern-television-79263! Thanks for the response. I’m deploying RKE2 (RKE1 has the same behavior) via the Rancher Cluster Management GUI. When I view the YAML through there, I don’t see any mention of
rancher_kubernetes_engine_config
.
m

modern-television-79263

07/06/2022, 7:59 PM
Ah, RKE2 is quite a bit different.
It should still let you deploy the out-of-tree provider though if you’re using newer versions of vSphere, and config it thru Helm: https://rancher.com/docs/rancher/v2.6/en/cluster-provisioning/rke-clusters/cloud-providers/vsphere/out-of-tree/