// Module included in the following assemblies:
//
// * machine_management/cluster_api_machine_management/cluster_api_provider_configurations/cluster-api-config-options-vsphere.adoc

:_mod-docs-content-type: REFERENCE
[id="capi-yaml-machine-template-vsphere_{context}"]
= Sample YAML for a Cluster API machine template resource on {vmw-full}

[role="_abstract"]
The machine template resource is provider-specific and defines the basic properties of the machines that a compute machine set creates.
The compute machine set references this template when creating machines.

[source,yaml]
----
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: VSphereMachineTemplate
metadata:
  name: <template_name>
  namespace: openshift-cluster-api
spec:
  template:
    spec:
      template: <vm_template_name>
      server: <vcenter_server_ip>
      diskGiB: 128
      cloneMode: linkedClone
      datacenter: <vcenter_data_center_name>
      datastore: <vcenter_datastore_name>
      folder: <vcenter_vm_folder_path>
      resourcePool: <vsphere_resource_pool>
      numCPUs: 4
      memoryMiB: 16384
      network:
        devices:
        - dhcp4: true
          networkName: "<vm_network_name>"
----

where:

`kind`:: Specifies the machine template kind.
This value must match the value for your platform.
`metadata.name`:: Specifies a name for the machine template.
`spec.template.spec`:: Specifies the details for your environment.
The values here are examples.
`spec.template.spec.template`:: Specifies the {vmw-short} VM template to use, such as `user-5ddjd-rhcos`.
`spec.template.spec.server`:: Specifies the vCenter server IP or fully qualified domain name.
`spec.template.spec.cloneMode`:: Specifies the type of VM clone to use.
The following values are valid:
+
--
* `fullClone`
* `linkedClone`
--
+
When using the `linkedClone` type, the disk size matches the clone source instead of using the `diskGiB` value.
For more information, see the {vmw-short} documentation about VM clone types.
`spec.template.spec.datacenter`:: Specifies the vCenter data center to deploy the compute machine set on.
`spec.template.spec.datastore`:: Specifies the vCenter datastore to deploy the compute machine set on.
`spec.template.spec.folder`:: Specifies the path to the {vmw-short} VM folder in vCenter, such as `/dc1/vm/user-inst-5ddjd`.
`spec.template.spec.resourcePool`:: Specifies the {vmw-short} resource pool for your VMs.
`spec.template.spec.network.devices.networkName`:: Specifies the {vmw-short} VM network to deploy the compute machine set to.
This VM network must be where other compute machines reside in the cluster.
