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

## AZs {: #azs }

Schema for `cloud_properties` section:

* **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.
        * **&lt;cluster name&gt;** [String, required]: Cluster name.
            * **resource_pool** [String, optional]: Name of vSphere Resource Pool to use for VM placement.
            * **drs_rules** [Array, optional]: Array of DRS rules applied to [constrain VM placement](vm-anti-affinity.md#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:

```yaml
azs:
- name: z1
  cloud_properties:
    datacenters:
    - name: my-dc
      clusters:
      - {my-vsphere-cluster: {resource_pool: my-vsphere-res-pool}}
```

---
## Networks {: #networks }

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

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

**Note:** To assign a distributed virtual portgroup when
there exists a standard virtual portgroup with the same name,
prepend the distributed virtual switch's name followed by a slash to the
distributed virtual portgroup, e.g. `dvs/distributed-portgroup-1`. This may
be required when working with VxRack. Available in v28+.

**Note:** The name may also be an NSX opaque network. Available in v40+.

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.<commit_msg>Add Managed network configuration to vSphere CPI documentation<commit_after>This topic describes cloud properties for different resources created by the vSphere CPI.

## AZs {: #azs }

Schema for `cloud_properties` section:

* **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.
        * **&lt;cluster name&gt;** [String, required]: Cluster name.
            * **resource_pool** [String, optional]: Name of vSphere Resource Pool to use for VM placement.
            * **drs_rules** [Array, optional]: Array of DRS rules applied to [constrain VM placement](vm-anti-affinity.md#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:

```yaml
azs:
- name: z1
  cloud_properties:
    datacenters:
    - name: my-dc
      clusters:
      - {my-vsphere-cluster: {resource_pool: my-vsphere-res-pool}}
```

---
## Networks {: #networks }

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

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

### Managed Networks ###
Create T1 router and attach it to T0 router. It also creates virtual switch and attaches it to T1 router.
So every subnet in network will have its own switch. Route advertisement is enabled on T1 router.

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

* **name** [String, required]: Name of the vSphere network. Example: `Subnet 1`.
* **t0_router_id** [String, required]: Id of T0 router to which T1 will be attached. Example: `7ef20c24-5adb-47bf-8553-f66c1cfd9614`.
* **transport_zone_id** [String, required]: Transport Zone id where switch is going to be created. VMs must be created at the hosts within this TZ. Example: `ee1a4cd1-701e-43f0-a2a7-110984298f7c`.
* **t1_name** [String, optional]: Name of T1 router. Example: `VM Router`.
* **switch_name** [String, optional]: Name of the switch. Example: `VM Network`.
* **ip_block_id** [String, optional]: Id of IP Block. IP block must be created beforehand. When netmask_bits is set, this is used to allocate subnet of given size. Example `53c98f6e-d6db-4652-b1ae-c85a5fcdccae` 

**Note:** To assign a distributed virtual portgroup when
there exists a standard virtual portgroup with the same name,
prepend the distributed virtual switch's name followed by a slash to the
distributed virtual portgroup, e.g. `dvs/distributed-portgroup-1`. This may
be required when working with VxRack. Available in v28+.

**Note:** The name may also be an NSX opaque network. Available in v40+.

**Note:** To use managed networks make sure enable_cpi_management is set for director
```yaml
director:
  networks:
    enable_cpi_management: true
```
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
```

Example of managed network with range:

```yaml
networks:
- name: default
  type: manual
  managed: true
  subnets:
  - name: Managed network
    range: 10.10.0.0/24
    cloud_properties:
      t0_router_id: 7ef20c24-5adb-47bf-8553-f66c1cfd9614
      transport_zone_id: ee1a4cd1-701e-43f0-a2a7-110984298f7c
      t1_name: VM Router
      switch_name: VM Network
```

Example of managed network with netmask_bits:

```yaml
networks:
- name: default
  type: manual
  managed: true
  subnets:
  - name: Managed network
    netmask_bits: 24
    cloud_properties:
      ip_block_id: 53c98f6e-d6db-4652-b1ae-c85a5fcdccae
      t0_router_id: 7ef20c24-5adb-47bf-8553-f66c1cfd9614
      transport_zone_id: ee1a4cd1-701e-43f0-a2a7-110984298f7c
      t1_name: VM Router
      switch_name: VM Network
```
vSphere CPI does not support dynamic and vip networks.
{'fraction_non_alphanumeric': 0.10227831503032289, 'fraction_numerical': 0.03474840190132765, 'mean_word_length': 3.730232558139535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 5, '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': '1964701', 'n_tokens_mistral': 2029, 'n_tokens_neox': 1891, 'n_words': 720}