Sunday, June 30, 2024

Terraform script to add a new vmxnet3 network adapter to a VM in vCenter

 Using this script add a new vmxnet3 network adapter to a VM in vCenter


Replace "your-vcenter-username", "your-vcenter-password", "your-vcenter-server", "your-datacenter-name", "your-cluster-name", and "your-vm-name" with your actual vCenter details.


"network-id" should be replaced with the ID of the network to which you want to connect the new vmxnet3 adapter.


Make sure you have the required Terraform provider for vSphere installed. 

You can run the script using the terraform apply command once everything is set up


provider "vsphere" {

  user           = "your-vcenter-username"

  password       = "your-vcenter-password"

  vsphere_server = "your-vcenter-server"


  # If you have a self-signed cert

  allow_unverified_ssl = true

}


data "vsphere_datacenter" "dc" {

  name = "your-datacenter-name"

}


data "vsphere_compute_cluster" "cluster" {

  name          = "your-cluster-name"

  datacenter_id = data.vsphere_datacenter.dc.id

}


data "vsphere_virtual_machine" "vm" {

  name          = "your-vm-name"

  datacenter_id = data.vsphere_datacenter.dc.id

}


resource "vsphere_virtual_machine_network_interface" "vmxnet3" {

  type         = "vmxnet3"

  network_id   = "network-id"  # Replace with your network id

  virtual_machine_id = data.vsphere_virtual_machine.vm.id

}


Wednesday, June 5, 2024

How to check MTU settings are consistent and properly configured across your network.

 You can use the Path Maximum Transmission Unit (PMTU) command on the HCX connector to verify the MTU configuration.


Login to HCX connector.

Go to IX connector 

Run PMTU command


The PMTU command helps you determine the maximum packet size that can be transmitted without fragmentation across the network path.


This command will provide you with the Path MTU for different paths, helping you ensure that the MTU settings are consistent and properly configured across your network

RAV migration cutover was failing after sync

 Issue: HCX RAV migration was failing after base sync and while cutover the VM. Noticed below error in hcx connector app logs. TxId: 4cda256...