Terraform VMware Cloud Director Provider v3.12.0 is obtainable, introducing many new options and enhancements.
Introducing the Container Service Extension (CSE) Kubernetes Cluster useful resource and information supply
During the previous releases of the supplier, we gathered an excellent quantity of suggestions from the neighborhood, and we understood that utilizing Runtime Defined Entities to create, replace and handle a Kubernetes cluster was generally difficult and never trivial, because it required a deep understanding of the CSE internal workings.
This launch entails an enormous step ahead for CSE customers, by offering a new useful resource and information supply vcd_cse_kubernetes_cluster, to summary the Kubernetes cluster authors from coping with the complexity of the generic strategies supplied within the now deprecated Kubernetes Cluster administration information.
The new vcd_cse_kubernetes_cluster useful resource seems to be like this:
control_plane {
machine_count = 3
disk_size_gi = 20
sizing_policy_id = information.vcd_vm_sizing_policy.tkg_small.id
storage_profile_id = information.vcd_storage_profile.sp.id
}
worker_pool {
identify = “worker-pool-1”
machine_count = 10
disk_size_gi = 100
sizing_policy_id = information.vcd_vm_sizing_policy.tkg_small.id
storage_profile_id = information.vcd_storage_profile.sp.id
}
default_storage_class {
identify = “default-storage-class”
storage_profile_id = information.vcd_storage_profile.sp.id
reclaim_policy = “delete”
filesystem = “ext4”
}
auto_repair_on_errors = true
node_health_check = true
operations_timeout_minutes = 0
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
useful resource “vcd_cse_kubernetes_cluster” “my_cluster” { cse_version = “4.2.0” identify = “my-cluster” kubernetes_template_id = information.vcd_catalog_vapp_template.tkg_ova.id org = information.vcd_org_vdc.vdc.org vdc_id = information.vcd_org_vdc.vdc.id network_id = information.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 = information.vcd_vm_sizing_policy.tkg_small.id storage_profile_id = information.vcd_storage_profile.sp.id }
worker_pool { identify = “worker-pool-1” machine_count = 10 disk_size_gi = 100 sizing_policy_id = information.vcd_vm_sizing_policy.tkg_small.id storage_profile_id = information.vcd_storage_profile.sp.id }
default_storage_class { identify = “default-storage-class” storage_profile_id = information.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 the RDE schemas, RDE Types, and YAML recordsdata usually are not used explicitly anymore.
Likewise, customers will expertise a extra comfy mechanism to replace their clusters, as they gained´t want to govern JSON recordsdata both. The useful resource helps all of the updateable parts which can be additionally achievable utilizing the UI: Resize the management airplane, the employee swimming pools, allow/disable the node well being verify, and switch off the “auto-repair” flag (4.1.0 solely).
This new useful resource is obtainable for CSE variations 4.2.1, 4.2.0, 4.1.1(a) and 4.1.0. It additionally helps importing present clusters, for those that had been utilizing the generic method emigrate their present ones, and customers may also learn present clusters with the information supply.
Adding assist for Container Service Extension (CSE) 4.2.0 and 4.2.1
This model of the supplier updates the installation information to assist the latest variations of CSE, 4.2.0 and 4.2.1.
As talked about within the earlier part, the Kubernetes Cluster administration information is now deprecated in favor of the brand new vcd_cse_kubernetes_cluster useful resource and information supply.
The supplier repository comprises now all of the RDE Type 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 comparable to CAPVCD model, CPI model and CSI model).
Other notable modifications and enhancements
Consolidating VM disks on creation to assist overriding template disks
A frequent consumer requested lacking performance was overriding disk sizes in quick provisioned VDCs. Terraform supplier v3.12.0 provides new area consolidate_disks_on_create in each assets vcd_vapp_vm and vcd_vm. When enabled, it would consolidate disks throughout VM creation. It could also be helpful by itself, but it surely additionally permits overriding template disks when creating VMs in quick provisioned VDCs.
# Fast provisioned VDCs require disks to be consolidated
# if their dimension 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 = “*”
}
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
useful resource “vcd_vapp_vm” “resized” { vapp_name = vcd_vapp.net.identify identify = “Resized-OS-disk-VM” vapp_template_id = information.vcd_catalog_vapp_template.lampstack.id reminiscence = 2048 cpus = 2 cpu_cores = 1
# Fast provisioned VDCs require disks to be consolidated # if their dimension 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 assist
Both VM assets vcd_vapp_vm and vcd_vm get new area copy_from_vm_id that can be utilized to create a VM from already present one as a substitute of counting on catalog template or an empty VM.
useful resource “vcd_vapp_vm” “vm-copy” {
org = “org”
vdc = “vdc”
copy_from_vm_id = information.vcd_vapp_vm.present.id # supply VM ID
vapp_name = information.vcd_vapp_vm.present.vapp_name
identify = “VM Copy”
power_on = false
}
|
information “vcd_vapp_vm” “present” { vapp_name = information.vcd_vapp.net.identify identify = “web1” }
useful resource “vcd_vapp_vm” “vm-copy” { org = “org” vdc = “vdc”
copy_from_vm_id = information.vcd_vapp_vm.present.id # supply VM ID vapp_name = information.vcd_vapp_vm.present.vapp_name identify = “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 introduces an choice to seize vApp templates from present vApps or standalone VMs. One can use a brand new capture_vapp block that accepts supply vApp ID. Additionally, the vcd_vapp_vm and vcd_vm assets and information sources expose vapp_id attributes that may be specified as a supply in capture_vapp.source_id. This is particularly helpful for standalone VMs which have hidden vApps.
useful resource “vcd_catalog_vapp_template” “from-vapp” {
org = “v51”
catalog_id = information.vcd_catalog.cat.id
identify = “from-vapp”
capture_vapp {
source_id = vcd_vapp.net.id
customize_on_instantiate = false
}
lease {
storage_lease_in_sec = 3600 * 24 * 3
}
# Using dependency to make sure that all VMs are current in vApp that
# is being captured
depends_on = [vcd_vapp_vm.emptyVM]
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
information “vcd_catalog” “cat” { org = “v51” identify = “demo-catalog” }
useful resource “vcd_catalog_vapp_template” “from-vapp” { org = “v51” catalog_id = information.vcd_catalog.cat.id
identify = “from-vapp”
capture_vapp { source_id = vcd_vapp.net.id customize_on_instantiate = false }
lease { storage_lease_in_sec = 3600 * 24 * 3 }
# Using 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 area route_advertisement_enabled in useful resource vcd_network_routed_v2 that permits customers to allow route commercial per routed community, which works along with IP Space route commercial
List of latest assets and information sources
- 1 new useful resource:
- 2 new information sources:
There are extra options and enhancements, which you’ll see within the project’s changelog. And, as all the time, we’re awaiting your suggestions and options in GitHub Issues and #vcd-terraform-dev Slack channel (vmwarecode.slack.com).