Terraform VMware Cloud Director Supplier v3.12.0 is on the market, introducing many new options and enhancements.
## Introducing the Container Service Extension (CSE) Kubernetes Cluster useful resource and knowledge supply
In the course of the previous releases of the supplier, we gathered an impressive quantity of suggestions from the group, and we understood that utilizing [Runtime Defined Entities][vcd_rde] to create, replace and handle a Kubernetes cluster was typically difficult and never trivial, because it required a deep understanding of the CSE inside workings.
This launch entails a giant step ahead for CSE customers, by offering **a [new resource][vcd_k8s] and [data source][vcd_k8s_ds] vcd_cse_kubernetes_cluster
**, to summary the
Kubernetes cluster authors from coping with the complexity of the generic strategies offered within the **now deprecated** [Kubernetes Cluster management guide][cse_guide_management].
The brand new vcd_cse_kubernetes_cluster
useful resource appears like this:
hcl
useful resource "vcd_cse_kubernetes_cluster" "my_cluster" {
cse_version = "4.2.0"
title = "my-cluster"
kubernetes_template_id = knowledge.vcd_catalog_vapp_template.tkg_ova.id
org = knowledge.vcd_org_vdc.vdc.org
vdc_id = knowledge.vcd_org_vdc.vdc.id
network_id = knowledge.vcd_network_routed_v2.routed.id
api_token_file = vcd_api_token.token.file_name
control_plane {
machine_count = 3
disk_size_gi = 20
sizing_policy_id = knowledge.vcd_vm_sizing_policy.tkg_small.id
storage_profile_id = knowledge.vcd_storage_profile.sp.id
}
worker_pool {
title = “worker-pool-1”
machine_count = 10
disk_size_gi = 100
sizing_policy_id = knowledge.vcd_vm_sizing_policy.tkg_small.id
storage_profile_id = knowledge.vcd_storage_profile.sp.id
}
default_storage_class {
title = “default-storage-class”
storage_profile_id = knowledge.vcd_storage_profile.sp.id
reclaim_policy = “delete”
filesystem = “ext4”
}
auto_repair_on_errors = true
node_health_check = true
operations_timeout_minutes = 0
}
Readers will observe that the accessible arguments of this useful resource are pretty just like the choices accessible in UI when making a Kubernetes cluster with the wizard. All of the RDE schemas, RDE Varieties, and YAML information will not be used explicitly anymore.
Likewise, customers will expertise a extra comfy mechanism to replace their clusters, as they received´t want to govern JSON information neither. The useful resource helps all of the updateable components which might be additionally achievable utilizing the UI: Resize the management airplane, the employee swimming pools, allow/disable the node well being test, and switch off the “auto-repair” flag (4.1.0 solely).
This new useful resource is on the market for CSE variations **4.2.1, 4.2.0, 4.1.1(a) and 4.1.0**. It additionally helps importing current clusters, for those that have been utilizing the generic method emigrate their current ones, and customers can even learn current clusters with the information supply.
## Including help for Container Service Extension (CSE) 4.2.0 and 4.2.1
This model of the supplier updates the [installation guide][cse_guide_install] to help the latest variations of CSE, 4.2.0 and 4.2.1.
As talked about within the earlier part, the [Kubernetes Cluster management guide][cse_guide_management] is **now deprecated** in favor of the brand new vcd_cse_kubernetes_cluster
useful resource and knowledge supply.
The supplier repository comprises now all of the RDE Kind schemas required for CSE 4.2.x and a few instance configurations for each 4.2.0 and 4.2.1 (as they differ in configuration values akin to CAPVCD model, CPI model and CSI model).
## Different notable adjustments and enhancements
### Consolidating VM disks on creation to help overriding template disks
A regularly consumer requested lacking performance was overriding disk sizes in *quick provisioned VDCs*.
Terraform supplier v3.12.0 provides new subject consolidate_disks_on_create
in each sources
[vcd_vapp_vm
][vcd_vapp_vm] and [vcd_vm
][vcd_vm]. When enabled, it’ll consolidate disks throughout
VM creation. It could be helpful by itself, nevertheless it additionally permits overriding template disks when
creating VMs in quick provisioned VDCs.
hcl
useful resource "vcd_vapp_vm" "resized" {
vapp_name = vcd_vapp.net.title
title = "Resized-OS-disk-VM"
vapp_template_id = knowledge.vcd_catalog_vapp_template.lampstack.id
reminiscence = 2048
cpus = 2
cpu_cores = 1
# Quick provisioned VDCs require disks to be consolidated
# if their measurement is to be modified
consolidate_disks_on_create = true
override_template_disk {
bus_type = “paravirtual”
size_in_mb = “22384”
bus_number = 0
unit_number = 0
iops = 0
storage_profile = “*”
}
}
### VM Copy help
Each VM sources [vcd_vapp_vm
][vcd_vapp_vm] and [vcd_vm
][vcd_vm] get new subjectcopy_from_vm_id
that can be utilized to create a VM from already current one as a substitute of counting on
catalog template or an empty VM.
hcl
knowledge "vcd_vapp_vm" "current" {
vapp_name = knowledge.vcd_vapp.net.title
title = "web1"
}
useful resource “vcd_vapp_vm” “vm-copy” {
org = “org”
vdc = “vdc”
copy_from_vm_id = knowledge.vcd_vapp_vm.current.id # supply VM ID
vapp_name = knowledge.vcd_vapp_vm.current.vapp_name
title = “VM Copy”
power_on = false
}
### Creating vApp templates from vApps or standalone VMs
The final bit that ranges up VM management is that useful resource
[vcd_catalog_vapp_template
][vcd_catalog_vapp_template] introduces an choice to seize vApp
templates from current vApps or standalone VMs. One can use new capture_vapp
block that accepts supply vApp ID.
Moreover, the [vcd_vapp_vm
][vcd_vapp_vm] and [vcd_vm
][vcd_vm] sources and knowledge sources expose vapp_id
attribute
that may be specified as a supply in capture_vapp.source_id
. That is particularly helpful for standalone VMs which have hidden vApps.
hcl
knowledge "vcd_catalog" "cat" {
org = "v51"
title = "demo-catalog"
}
useful resource “vcd_catalog_vapp_template” “from-vapp” {
org = “v51”
catalog_id = knowledge.vcd_catalog.cat.id
title = “from-vapp”
capture_vapp {
source_id = vcd_vapp.net.id
customize_on_instantiate = false
}
lease {
storage_lease_in_sec = 3600 * 24 * 3
}
# Utilizing dependency to make sure that all VMs are current in vApp that
# is being captured
depends_on = [vcd_vapp_vm.emptyVM]
}
## Route commercial configuration for routed Org VDC networks
Route commercial toggle subject route_advertisement_enabled
in useful resource vcd_network_routed_v2
that enables customers to allow route commercial per routed community, which works along with IP
Area [route
advertisement](https://registry.terraform.io/suppliers/vmware/vcd/newest/docs/sources/ip_space#route_advertisement_enabled)
## Record of recent sources and knowledge sources
* 1 new useful resource:
* [vcd_cse_kubernetes_cluster
][vcd_k8s]
* 2 new knowledge sources:
* [vcd_cse_kubernetes_cluster
][vcd_k8s_ds]
* [vcd_version
](https://registry.terraform.io/suppliers/vmware/vcd/newest/docs/data-sources/model)
There are extra options and enhancements, which you’ll be able to see within the [project’s changelog][changelog].
And, as at all times, we’re awaiting your suggestions and ideas in [GitHub Issues][github_issues] and #vcd-terraform-dev Slack channel ([vmwarecode.slack.com][vmware_slack]).
[changelog]:https://github.com/vmware/terraform-provider-vcd/blob/v3.12.0/CHANGELOG.md#3120-march-22-2024
[cse_guide_install]:https://registry.terraform.io/suppliers/vmware/vcd/newest/docs/guides/container_service_extension_4_x_install
[cse_guide_management]:https://registry.terraform.io/suppliers/vmware/vcd/newest/docs/guides/container_service_extension_4_x_cluster_management
[github_issues]:https://github.com/vmware/terraform-provider-vcd/points
[vcd_rde]:https://registry.terraform.io/suppliers/vmware/vcd/newest/docs/sources/rde
[vmware_slack]:https://vmwarecode.slack.com
[vcd_k8s]:https://registry.terraform.io/suppliers/vmware/vcd/newest/docs/sources/cse_kubernetes_cluster
[vcd_k8s_ds]:https://registry.terraform.io/suppliers/vmware/vcd/newest/docs/data-sources/cse_kubernetes_cluster
[vcd_vm]:https://registry.terraform.io/suppliers/vmware/vcd/newest/docs/sources/vm
[vcd_vapp_vm]:https://registry.terraform.io/suppliers/vmware/vcd/newest/docs/sources/vapp_vm
[vcd_catalog_vapp_template]:https://registry.terraform.io/suppliers/vmware/vcd/newest/docs/sources/catalog_vapp_template