<commit_before>---
title: vSphere CPI
---

This topic describes cloud properties for different resources created by the vSphere CPI.

## <a id='networks'></a> Networks

Schema for `cloud_properties` section used by manual network subnet:

* **name** [String, required]: Name of the vSphere network. Example: `VM Network`.

Example of manual network:

```yaml
networks:
- name: default
  type: manual
  subnets:
  - range: 10.10.0.0/24
    gateway: 10.10.0.1
    cloud_properties:
      name: VM Network
```

vSphere CPI does not support dynamic or vip networks.

---
## <a id='resource-pools'></a> Resource Pools

Schema for `cloud_properties` section:

* **cpu** [Integer, required]: Number of CPUs. Example: `1`.
* **ram** [Integer, required]: RAM in megabytes. Example: `1024`.
* **disk** [Integer, required]: Ephemeral disk size in megabytes. Example: `10240`.
* **nested\_hardware\_virtualization** [Boolean, optional]: Exposes hardware assisted virtualization to the VM. Default: `false`.

* **datacenters** [Array, optional]: Array of datacenters to use for VM placement. Must have only one and it must match datacenter configured in global CPI options.
    * **name** [String, required]: Datacenter name.
    * **clusters** [Array, required]: Array of clusters to use for VM placement.
        * **\<cluster name\>** [String, required]: Cluster name.
            * **drs_rulers** [Array, optional]: Array of DRS rules applied to [constrain VM placement](vm-anti-affinity.html#vsphere). Must have only one.
                * **name** [String, required]: Name of a DRS rule that the Director will create.
                * **type** [String, required]: Type of a DRS rule. Currently only `separate_vms` is supported.

Example of a VM with 1 CPU, 1GB RAM, and 10GB ephemeral disk asked to be placed into a specific cluster:

```yaml
resource_pools:
- name: default
  network: default
  stemcell:
    name: bosh-vsphere-esxi-ubuntu-trusty-go_agent
    version: latest
  cloud_properties:
    cpu: 2
    ram: 1_024
    disk: 10_240

    datacenters:
    - {name: my-dc, clusters: [my-vsphere-cluster]}
```

And an example of a VM asked to be placed into a specific cluster in a specified vSphere resource pool:

```yaml
resource_pools:
- name: default
  network: default
  stemcell:
    name: bosh-vsphere-esxi-ubuntu-trusty-go_agent
    version: latest
  cloud_properties:
    cpu: 2
    ram: 1_024
    disk: 10_240

    datacenters:
    - name: my-dc
      clusters:
      - my-vsphere-cluster: {resource_pool: my-vsphere-res-pool}
```

---
## <a id='disk-pools'></a> Disk Pools

Currently the CPI does not support any cloud properties for disks.

Example of 10GB disk:

```yaml
disk_pools:
- name: default
  disk_size: 10_240
```

---
## <a id='global'></a> Global Configuration

The CPI can only talk to a single vCenter installation and manage VMs within a single vSphere datacenter.

Schema:

* **host** [String, required]: IP address of the vCenter. Example: `172.16.68.3`.
* **user** [String, required]: Username for the API access. Example: `root`.
* **password** [String, required]: Password for the API access. Example: `<PASSWORD>`

* **datacenters** [Array, optional]: Array of datacenters to use for VM placement. Must have only one.
    * **name** [String, required]: Datacenter name.

    * **vm_folder** [String, required]: Path to a folder (relative to the datacenter) for storing created VMs. Folder will be automatically created if not found.
    * **template_folder** [String, required]: Path to a folder (relative to the datacenter) for storing uploaded stemcells. Folder will be automatically created if not found.
    * **disk_path** [String, required]: Path to a *disk* folder for storing persistent disks. Folder will be automatically created in the datastore if not found.

    * **datastore_pattern** [String, required]: Pattern for selecting datastores for storing ephemeral disks and replicated stemcells.
    * **persistent\_datastore\_pattern** [String, required]: Pattern for selecting datastores for storing persistent disks.

    * **clusters** [Array, required]: Array of clusters to use for VM placement.
        * **\<cluster name\>** [String, required]: Cluster name.
            * **resource_pool** [String, optional]: Specific vSphere resource pool to use within the cluster.
<commit_msg>mention disk type for vsphere<commit_after>---
title: vSphere CPI
---

This topic describes cloud properties for different resources created by the vSphere CPI.

## <a id='networks'></a> Networks

Schema for `cloud_properties` section used by manual network subnet:

* **name** [String, required]: Name of the vSphere network. Example: `VM Network`.

Example of manual network:

```yaml
networks:
- name: default
  type: manual
  subnets:
  - range: 10.10.0.0/24
    gateway: 10.10.0.1
    cloud_properties:
      name: VM Network
```

vSphere CPI does not support dynamic or vip networks.

---
## <a id='resource-pools'></a> Resource Pools

Schema for `cloud_properties` section:

* **cpu** [Integer, required]: Number of CPUs. Example: `1`.
* **ram** [Integer, required]: RAM in megabytes. Example: `1024`.
* **disk** [Integer, required]: Ephemeral disk size in megabytes. Example: `10240`.
* **nested\_hardware\_virtualization** [Boolean, optional]: Exposes hardware assisted virtualization to the VM. Default: `false`.

* **datacenters** [Array, optional]: Array of datacenters to use for VM placement. Must have only one and it must match datacenter configured in global CPI options.
    * **name** [String, required]: Datacenter name.
    * **clusters** [Array, required]: Array of clusters to use for VM placement.
        * **\<cluster name\>** [String, required]: Cluster name.
            * **drs_rulers** [Array, optional]: Array of DRS rules applied to [constrain VM placement](vm-anti-affinity.html#vsphere). Must have only one.
                * **name** [String, required]: Name of a DRS rule that the Director will create.
                * **type** [String, required]: Type of a DRS rule. Currently only `separate_vms` is supported.

Example of a VM with 1 CPU, 1GB RAM, and 10GB ephemeral disk asked to be placed into a specific cluster:

```yaml
resource_pools:
- name: default
  network: default
  stemcell:
    name: bosh-vsphere-esxi-ubuntu-trusty-go_agent
    version: latest
  cloud_properties:
    cpu: 2
    ram: 1_024
    disk: 10_240

    datacenters:
    - {name: my-dc, clusters: [my-vsphere-cluster]}
```

And an example of a VM asked to be placed into a specific cluster in a specified vSphere resource pool:

```yaml
resource_pools:
- name: default
  network: default
  stemcell:
    name: bosh-vsphere-esxi-ubuntu-trusty-go_agent
    version: latest
  cloud_properties:
    cpu: 2
    ram: 1_024
    disk: 10_240

    datacenters:
    - name: my-dc
      clusters:
      - my-vsphere-cluster: {resource_pool: my-vsphere-res-pool}
```

---
## <a id='disk-pools'></a> Disk Pools

Schema for `cloud_properties` section:

* **type** [String, optional]: Type of the [disk](http://pubs.vmware.com/vi-sdk/visdk250/ReferenceGuide/vim.VirtualDiskManager.VirtualDiskType.html): `thick`, `thin`, `preallocated`, `eagerZeroedThick`. Defaults to `thick`. Available in v12.

Example of 10GB disk:

```yaml
disk_pools:
- name: default
  disk_size: 10_240
```

Example of disk with type eagerZeroedThick:

```yaml
disk_pools:
- name: default
  disk_size: 10_240
  cloud_properties:
    type: eagerZeroedThick
```

---
## <a id='global'></a> Global Configuration

The CPI can only talk to a single vCenter installation and manage VMs within a single vSphere datacenter.

Schema:

* **host** [String, required]: IP address of the vCenter. Example: `172.16.68.3`.
* **user** [String, required]: Username for the API access. Example: `root`.
* **password** [String, required]: Password for the API access. Example: `<PASSWORD>`

* **datacenters** [Array, optional]: Array of datacenters to use for VM placement. Must have only one.
    * **name** [String, required]: Datacenter name.

    * **vm_folder** [String, required]: Path to a folder (relative to the datacenter) for storing created VMs. Folder will be automatically created if not found.
    * **template_folder** [String, required]: Path to a folder (relative to the datacenter) for storing uploaded stemcells. Folder will be automatically created if not found.
    * **disk_path** [String, required]: Path to a *disk* folder for storing persistent disks. Folder will be automatically created in the datastore if not found.

    * **datastore_pattern** [String, required]: Pattern for selecting datastores for storing ephemeral disks and replicated stemcells.
    * **persistent\_datastore\_pattern** [String, required]: Pattern for selecting datastores for storing persistent disks.

    * **clusters** [Array, required]: Array of clusters to use for VM placement.
        * **\<cluster name\>** [String, required]: Cluster name.
            * **resource_pool** [String, optional]: Specific vSphere resource pool to use within the cluster.

{'fraction_non_alphanumeric': 0.11762104797700641, 'fraction_numerical': 0.015034269290294052, 'mean_word_length': 3.819925412892914, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1425670', 'n_tokens_mistral': 2871, 'n_tokens_neox': 2670, 'n_words': 1055}