Skip to content

Commit

Permalink
docs: update r/hcx_l2_extension (#41)
Browse files Browse the repository at this point in the history
Updates documentation for `r/hcx_l2_extension` to refer to use of `service_mesh_id` instead of `service_mesh_name`.

Ref: #8

Signed-off-by: Ryan Johnson <ryan.johnson@broadcom.com>
  • Loading branch information
tenthirtyam committed Jan 13, 2025
1 parent eca4af5 commit aee1c84
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 139 deletions.
207 changes: 86 additions & 121 deletions docs/guides/lab.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
page_title: "HCX Lab - Full HCX Connector configuration"
page_title: "HCX Lab - Full HCX Connector Configuration"
---

This TF file automates the configuration of a HCX lab. It manages creation/update/deletion of :
* Site pairing
* Network profiles (Management, vMotion and Uplink)
* Compute profile
This example file automates the configuration of an HCX lab, managing the:

* Site Pairing
* Network Profiles (Management, vMotion, and Uplink)
* Compute Profile
* Service Mesh
* L2 Extension

## Usage example
## Usage Example

```hcl
terraform {
required_providers {
hcx = {
Expand All @@ -21,171 +21,136 @@ terraform {
}
}
provider hcx {
hcx = "https://192.168.110.70"
username = "administrator@vsphere.local"
password = "VMware1!"
provider "hcx" {
hcx = "https://192.168.110.70"
username = "administrator@vsphere.local"
password = "VMware1!"
}
resource "hcx_site_pairing" "site1" {
url = "https://hcx-cloud-01b.corp.local"
username = "administrator@vsphere.local"
password = "VMware1!"
url = "https://hcx-cloud-01b.corp.local"
username = "administrator@vsphere.local"
password = "VMware1!"
}
resource "hcx_network_profile" "net_management" {
vcenter = hcx_site_pairing.site1.local_vc
network_name = "HCX-Management-RegionA01"
name = "HCX-Management-RegionA01-profile"
mtu = 1500
vcenter = hcx_site_pairing.site1.local_vc
network_name = "HCX-Management-RegionA01"
name = "HCX-Management-RegionA01-profile"
mtu = 1500
ip_range {
start_address = "192.168.110.151"
end_address = "192.168.110.155"
}
gateway = "192.168.110.1"
prefix_length = 24
primary_dns = "192.168.110.10"
secondary_dns = ""
dns_suffix = "corp.local"
start_address = "192.168.110.151"
end_address = "192.168.110.155"
}
gateway = "192.168.110.1"
prefix_length = 24
primary_dns = "192.168.110.10"
secondary_dns = ""
dns_suffix = "corp.local"
}
resource "hcx_network_profile" "net_uplink" {
vcenter = hcx_site_pairing.site1.local_vc
network_name = "HCX-Uplink-RegionA01"
name = "HCX-Uplink-RegionA01-profile"
mtu = 1600
vcenter = hcx_site_pairing.site1.local_vc
network_name = "HCX-Uplink-RegionA01"
name = "HCX-Uplink-RegionA01-profile"
mtu = 1600
ip_range {
start_address = "192.168.110.156"
end_address = "192.168.110.160"
}
gateway = "192.168.110.1"
prefix_length = 24
primary_dns = "192.168.110.1"
secondary_dns = ""
dns_suffix = "corp.local"
start_address = "192.168.110.156"
end_address = "192.168.110.160"
}
gateway = "192.168.110.1"
prefix_length = 24
primary_dns = "192.168.110.1"
secondary_dns = ""
dns_suffix = "corp.local"
}
resource "hcx_network_profile" "net_vmotion" {
vcenter = hcx_site_pairing.site1.local_vc
network_name = "HCX-vMotion-RegionA01"
name = "HCX-vMotion-RegionA01-profile"
mtu = 1500
vcenter = hcx_site_pairing.site1.local_vc
network_name = "HCX-vMotion-RegionA01"
name = "HCX-vMotion-RegionA01-profile"
mtu = 1500
ip_range {
start_address = "10.10.30.151"
end_address = "10.10.30.155"
}
gateway = ""
prefix_length = 24
primary_dns = ""
secondary_dns = ""
dns_suffix = ""
start_address = "10.10.30.151"
end_address = "10.10.30.155"
}
gateway = ""
prefix_length = 24
primary_dns = ""
secondary_dns = ""
dns_suffix = ""
}
resource "hcx_compute_profile" "compute_profile_1" {
name = "comp1"
datacenter = "RegionA01-ATL"
cluster = "RegionA01-COMP01"
datastore = "RegionA01-ISCSI01-COMP01"
management_network = hcx_network_profile.net_management.id
replication_network = hcx_network_profile.net_management.id
uplink_network = hcx_network_profile.net_uplink.id
vmotion_network = hcx_network_profile.net_vmotion.id
dvs = "RegionA01-vDS-COMP"
name = "comp1"
datacenter = "RegionA01-ATL"
cluster = "RegionA01-COMP01"
datastore = "RegionA01-ISCSI01-COMP01"
management_network = hcx_network_profile.net_management.id
replication_network = hcx_network_profile.net_management.id
uplink_network = hcx_network_profile.net_uplink.id
vmotion_network = hcx_network_profile.net_vmotion.id
dvs = "RegionA01-vDS-COMP"
service {
name = "INTERCONNECT"
name = "INTERCONNECT"
}
service {
name = "WANOPT"
name = "WANOPT"
}
service {
name = "VMOTION"
name = "VMOTION"
}
service {
name = "BULK_MIGRATION"
name = "BULK_MIGRATION"
}
service {
name = "RAV"
name = "RAV"
}
service {
name = "NETWORK_EXTENSION"
name = "NETWORK_EXTENSION"
}
service {
name = "DISASTER_RECOVERY"
name = "DISASTER_RECOVERY"
}
service {
name = "SRM"
name = "SRM"
}
}
resource "hcx_service_mesh" "service_mesh_1" {
name = "sm1"
site_pairing = hcx_site_pairing.site1
local_compute_profile = hcx_compute_profile.compute_profile_1.name
remote_compute_profile = "Compute-RegionB01"
app_path_resiliency_enabled = false
tcp_flow_conditioning_enabled = false
uplink_max_bandwidth = 10000
name = "sm1"
site_pairing = hcx_site_pairing.site1
local_compute_profile = hcx_compute_profile.compute_profile_1.name
remote_compute_profile = "Compute-RegionB01"
app_path_resiliency_enabled = false
tcp_flow_conditioning_enabled = false
uplink_max_bandwidth = 10000
service {
name = "INTERCONNECT"
name = "INTERCONNECT"
}
service {
name = "VMOTION"
name = "VMOTION"
}
service {
name = "BULK_MIGRATION"
name = "BULK_MIGRATION"
}
service {
name = "RAV"
name = "RAV"
}
service {
name = "NETWORK_EXTENSION"
name = "NETWORK_EXTENSION"
}
service {
name = "DISASTER_RECOVERY"
name = "DISASTER_RECOVERY"
}
}
resource "hcx_l2_extension" "l2_extension_1" {
site_pairing = hcx_site_pairing.site1
service_mesh_name = hcx_service_mesh.service_mesh_1.name
source_network = "VM-RegionA01-vDS-COMP"
destination_t1 = "T1-GW"
gateway = "2.2.2.2"
netmask = "255.255.255.0"
site_pairing = hcx_site_pairing.site1
service_mesh_id = hcx_service_mesh.service_mesh_1.id
source_network = "VM-RegionA01-vDS-COMP"
destination_t1 = "T1-GW"
gateway = "2.2.2.2"
netmask = "255.255.255.0"
}
```
29 changes: 11 additions & 18 deletions docs/resources/l2_extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,31 @@ You can bridge local network segments between HCX-enabled data centers with HCX

With VMware HCX Network Extension (HCX-NE), a High-Performance (4–6 Gbps) service, you can extend the Virtual Machine networks to a VMware HCX-enabled remote site. Virtual Machines that are migrated or created on the extended segment at the remote site are Layer 2 next to virtual machines placed on the origin network. Using Network Extension a remote site's resources can be quickly consumed. With Network Extension , the default gateway for the extended network only exists at the source site. Traffic from virtual machines (on remote extended networks) that must be routed returns to the source site gateway.



## Example Usage

```hcl
resource "hcx_l2_extension" "l2_extension_1" {
site_pairing = hcx_site_pairing.site1
service_mesh_name = hcx_service_mesh.service_mesh_1.name
source_network = "VM-RegionA01-vDS-COMP"
NsxtSegment = ""
destination_t1 = "T1-GW"
gateway = "2.2.2.2"
netmask = "255.255.255.0"
egress_optimization = false
mon = true
appliance_id = hcx_service_mesh.service_mesh_1.appliances_id[1].id
site_pairing = hcx_site_pairing.site1
service_mesh_id = hcx_service_mesh.service_mesh_1.id
source_network = "VM-RegionA01-vDS-COMP"
NsxtSegment = ""
destination_t1 = "T1-GW"
gateway = "2.2.2.2"
netmask = "255.255.255.0"
egress_optimization = false
mon = true
appliance_id = hcx_service_mesh.service_mesh_1.appliances_id[1].id
}
output "l2_extension_1" {
value = hcx_l2_extension.l2_extension_1
}
```

## Argument Reference

* `site_pairing` - (Required) Site pairing used by this service mesh.
* `service_mesh_name` - (Required) Name of the Service Mesh to be used for this L2 extension.
* `service_mesh_id` - (Required) ID of the Service Mesh to be used for this L2 extension.
* `source_network` - (Required) Source Network. Must be a dvpg which is vlan tagged.
* `destination_t1` - (Required) Name of the T1 NSX-T router at destination.
* `gateway` - (Required) Gateway address to configure on the T1. Should be equal to the existing default gateway at source site.
Expand Down

0 comments on commit aee1c84

Please sign in to comment.