VMware vSphere

Supported versions

  • 6.5
  • 6.7
  • 7.0

Provider configuration

The vSphere provider accepts the following configuration parameters:

# Can also be set via the env var 'VSPHERE_USERNAME' on the machine-controller
username: "<< VSPHERE_USERNAME >>"
# Can also be set via the env var 'VSPHERE_ADDRESS' on the machine-controller
# example: 'https://your-vcenter:8443'. '/sdk' gets appended automatically
vsphereURL: "<< VSPHERE_ADDRESS >>"
# Can also be set via the env var 'VSPHERE_PASSWORD' on the machine-controller
password: "<< VSPHERE_PASSWORD >>"
# datacenter name
datacenter: datacenter1
# VM template name
templateVMName: ubuntu-template
# Optional. Sets the networks on the VM. If no network is specified, the template default will be used.
networks:
  - network1
# Optional
folder: folder1
# Optional: Force VMs to be provisioned to the specified resourcePool
# Default is to use the resourcePool of the template VM
# example: kubeone or /DC/host/Cluster01/Resources/kubeone
resourcePool: kubeone
cluster: cluster1
# either datastore or datastoreCluster have to be provided.
datastore: datastore1
datastoreCluster: datastore-cluster1
# Can also be set via the env var 'VSPHERE_ALLOW_INSECURE' on the machine-controller
allowInsecure: true
# instance resources
cpus: 2
memoryMB: 2048
# Optional: Resize the root disk to this size. Must be bigger than the existing size
# Default is to leave the disk at the same size as the template
diskSizeGB: 10

Datastore and DatastoreCluster

A Datastore is the basic unit of storage abstraction in vSphere storage (more details here).

A DatastoreCluster (sometimes referred to as StoragePod) is a logical grouping of Datastores, it provides some resource management capabilities (more details here).

vSphere provider configuration in a MachineDeployment should specify either a Datastore or a DatastoreCluster. If both are specified or if one of the two is missing the MachineDeployment validation will fail.

Note that the datastore or datastoreCluster specified in the MachineDeployment will be only used for the placement of VM and disk files related to the VMs provisioned by the machine-controller. They do not influence the placement of persistent volumes used by Pods, that only depends on the cloud configuration given to the Kubernetes cloud provider running in control plane.

Template VMs preparation

To use the machine-controller to create machines on VMware vSphere, you must first create a VM to be used as a template.

template VMs in this document refers to regular VMs and not VM Templates according to vSphere terminology. The difference is quite subtle, but VM Templates are not supported yet by machine-controller.

Information about supported OS versions can be found here.

Ubuntu

Ubuntu OVA templates can be foud at https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.ova.

Follow the dedicated Ubuntu Template VM guide.

RHEL

Red Hat Enterprise Linux 8.x KVM Guest Images can be found at Red Hat Customer Portal.

Follow the generic qcow2 guide.

RockyLinux

RockyLinux images can be found at the following link: https://rockylinux.org/download.

Follow the dedicated RockyLinux Template VM guide.