Your submission was sent successfully! Close

You have successfully unsubscribed! Close

vSphere integrator charm

This charm acts as a proxy to VMware vSphere and provides an interface to provide a set of credentials for a somewhat limited project user to the applications that are related to this charm.


When on a vSphere cloud, this charm can be deployed, granted trust via Juju to access vSphere, and then related to an application that supports the interface.

For example, Charmed Kubernetes has support for this, and can be deployed with the following bundle overlay:

    charm: cs:~containers/vsphere-integrator
    num_units: 1
  - ['vsphere-integrator', 'kubernetes-master']
  - ['vsphere-integrator', 'kubernetes-worker']

Using Juju 2.4 or later:

juju deploy cs:charmed-kubernetes --overlay ./k8s-vsphere-overlay.yaml
juju trust vsphere-integrator

To deploy with earlier versions of Juju, you will need to provide the cloud credentials via the credentials charm config option:

cat <<EOJ > /path/to/cloud.json
  "vsphere_ip": "a.b.c.d",
  "user": "joe",
  "password": "passw0rd",
  "datacenter": "dc0"

juju config vsphere-integrator credentials="$(base64 /path/to/cloud.json)"


This charm supports multiple config options that can be used to describe they vSphere environment.

The only required option is datastore, as it is not included in the Juju credential that this charm relies on. By default, this is set to datastore1. This can be changed with:

juju config vsphere-integrator datastore='mydatastore'

You may also configure a folder and resource pool path for this charm. Details about these options can be found in the vmware documentation:

juju config vsphere-integrator folder='juju-kubernetes' respool_path='foo'

As mentioned in the Usage section, credentials may be set with a base64-encoded json file. When set, this data will take precedent over all other methods of specifying credentials for this charm.

If credentials is empty, there are config options for each key that constitute a Juju credential. These can be set with:

juju config vsphere-integrator \
  vsphere_ip='a.b.c.d' \
  user='joe' \
  password='passw0rd' \

Note: If any of the credential config options are set, they must all be set.

When all of the credential config options are empty, this charm will fall back to the credential data it received with juju trust vsphere-integrator.

name type Default Description
credentials string See notes
datacenter string vSphere datacenter name. In the vCenter control panel, this can be found at Inventory Lists > Resources > Datacenters.
datastore string datastore1 Datastore to use for provisioning volumes using storage classes and persistent volume claims. Defaults to 'datastore1'.
folder string juju-kubernetes Virtual center VM folder path under the datacenter. Defaults to 'juju-kubernetes'. This value must not be empty.
password string Password of a valid vSphere user.
respool_path string Path to resource pool under the datacenter.
user string Username of a valid vSphere user.
vsphere_ip string IP address of the vSphere server.



The base64-encoded contents of a JSON file containing vSphere credentials.

The credentials must contain the following keys: vsphere_ip, user, password, datacenter, and datastore.

This can be used from bundles with 'include-base64://' (see, or from the command-line with 'juju config vsphere credentials="$(base64 /path/to/file)"'.

It is strongly recommended that you use 'juju trust' instead, if available.

Back to table

Resource Usage Note

By relating to this charm, other charms can directly allocate resources, such as PersistentDisk volumes, which could lead to cloud charges and count against quotas. Because these resources are not managed by Juju, they will not be automatically deleted when the models or applications are destroyed, nor will they show up in Juju's status or GUI. It is therefore up to the operator to manually delete these resources when they are no longer needed, using the vCenter console or API.


The following are some examples using vSphere integration with Charmed Kubernetes.

Creating a pod with a PersistentDisk-backed volume

This script creates a busybox pod with a persistent volume claim backed by vSphere's PersistentDisk.


# create a storage class using the `` provisioner
kubectl create -f - <<EOY
kind: StorageClass
  name: mystorage
  diskformat: zeroedthick

# create a persistent volume claim using that storage class
kubectl create -f - <<EOY
kind: PersistentVolumeClaim
apiVersion: v1
  name: testclaim
    - ReadWriteOnce
      storage: 100Mi
  storageClassName: mystorage

# create the busybox pod with a volume using that PVC:
kubectl create -f - <<EOY
apiVersion: v1
kind: Pod
  name: busybox
  namespace: default
    - image: busybox
        - sleep
        - "3600"
      imagePullPolicy: IfNotPresent
      name: busybox
        - mountPath: "/pv"
          name: testvolume
  restartPolicy: Always
    - name: testvolume
        claimName: testclaim