Autumn brings a new Terraform VMware Cloud Director Provider release – 3.4.0 with support for latest VCD 10.3.1. We’re continuing our NSX-T journey and providers are getting attention this time.
The beginning of NSX-T ALB configuration
This release brings in three NSX-T ALB configuration resources with corresponding data sources for providers that completely cover functionality of ALB management for providers to date:
vcd_nsxt_alb_controller
vcd_nsxt_alb_cloud
vcd_nsxt_alb_service_engine_group
Additionally, there is one more data source for lookup of NSX-T ALB Importable Cloud:
vcd_nsxt_alb_importable_cloud
Here’s an example with a complete setup of a Service Engine Group for providers:
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 38 39 |
# Local variable is used to avoid direct reference and cover Terraform core # bug https://github.com/hashicorp/terraform/issues/29484 Even changing NSX-T ALB Controller name # in UI, plan will cause to recreate all resources depending on `vcd_nsxt_alb_importable_cloud` # data source if this indirect reference (via local) variable is not used. locals { controller_id = vcd_nsxt_alb_controller.first.id } resource "vcd_nsxt_alb_controller" "first" { name = "aviController1" description = "first alb controller" url = "https://controller.myXZ" username = "admin" password = "secret-password" license_type = "ENTERPRISE" } data "vcd_nsxt_alb_importable_cloud" "cld" { name = "importable-cloud-name" controller_id = local.controller_id } resource "vcd_nsxt_alb_cloud" "first" { name = "nsxt-cloud" description = "first alb cloud" controller_id = vcd_nsxt_alb_controller.first.id importable_cloud_id = data.vcd_nsxt_alb_importable_cloud.cld.id network_pool_id = data.vcd_nsxt_alb_importable_cloud.cld.network_pool_id } resource "vcd_nsxt_alb_service_engine_group" "first" { name = "demo-service-engine" description = "Service Engine for Terraform documentation" alb_cloud_id = vcd_nsxt_alb_cloud.first.id importable_service_engine_group_name = "Default-Group" reservation_model = "SHARED" sync_on_refresh = false } |
Ready for 10.3 – NSX-T Segment backed External Network
VCD 10.3 added support for NSX-T External Network backed by a Segment and 3.4.0 is ready to consume it.
In prior versions Org VDC network resource vcd_nsxt_network_imported
was the way to expose NSX-T Segment to VDC. That bound NSX-T Segment to a single VDC. The new Segment backed External Network option allows to share the same NSX-T Segment with multiple VDCs. One does it by at first creating an NSX-T Segment Backed External Network and then using vcd_network_direct
to expose it in VDCs as demonstrated in the example below:
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 |
data "vcd_nsxt_manager" "main" { name = "nsxManager" } resource "vcd_external_network_v2" "ext-net-nsxt-segment" { name = "nsxt-segment-backed-external-network" nsxt_network { nsxt_manager_id = data.vcd_nsxt_manager.main.id nsxt_segment_name = "existing-nsxt-segment-name" } ip_scope { gateway = "1.1.1.1" prefix_length = "24" static_ip_pool { start_address = "1.1.1.88" end_address = "1.1.1.100" } } } resource "vcd_network_direct" "net" { vdc = "nsxt-vdc" name = "segment-backed-direct-net" external_network = vcd_external_network_v2.ext-net-nsxt-segment.name depends_on = [vcd_external_network_v2.ext-net-nsxt-segment] } |
Improvements
In addition to new resources we also did some improvements and fixes for existing codebase:
- It is now possible to add and remove storage profiles without replacing the VDC when using resource
vcd_org_vdc
. - Resource
vcd_catalog
deletion is improved to handle failures better.
Documentation
Documentation got some attention in this release.
- Migration to Terraform registry made some documentation links broken, and they are now fixed.
- Thanks to community contribution – we now have HCL examples in documentation adjusted to newer Terraform syntax and formatted properly.
More information
As usual there is more than that – here’s the link to [complete changelog].(https://github.com/vmware/terraform-provider-vcd/blob/master/CHANGELOG.md#340-september-30-2021).