govc Commands For vSphere VM Verification

govc is useful when Terraform says one thing and the VM behaves like something else. It gives a direct view into vSphere inventory, VM paths, NIC backing, and extra config. For virtual CD-ROM device cleanup, see vSphere CD-ROM Host Device Cleanup With govc. Load Environment Use a clearly named helper file, not vars.env if it is only for govc: source govc.env govc about Typical values: export GOVC_URL='vcenter.example.com' export GOVC_USERNAME='administrator@vsphere.local' export GOVC_PASSWORD='...' export GOVC_INSECURE=1 export GOVC_DATACENTER='DC-Site-A' Find A VM Path Search by VM name: ...

June 9, 2026 · 2 min · Trinidad Marroquin

Netplan Conflicts After VMware Guest Customization

VMware guest customization can write /etc/netplan/99-netcfg-vmware.yaml. If the template already has another active netplan file, the host can end up with multiple network authorities. That can break routing, DNS, bootstrap scripts, Kubernetes node communication, and storage initialization. Symptoms Common signs: Error: Conflicting default route declarations for IPv4 first declared in nic0 but also in ens192 or: Destination Host Unreachable or DNS search drift like: resolv_conf_search = . netplan_search = [] Inspect Netplan Ownership ls -l /etc/netplan sudo grep -R "routes:\|gateway\|search:" /etc/netplan -n If both a template file and VMware file are present, decide which one owns networking. ...

June 9, 2026 · 2 min · Trinidad Marroquin

Terraform State Moves During A Module Refactor

When an existing Terraform resource is moved into a module, Terraform sees a new resource address. If state is not moved first, the plan may try to create the module resource and destroy the old root resource. Symptom After converting a root resource to a module call, the plan shows addresses like this: # module.vm_group.vsphere_virtual_machine.vm["lb1"] will be created while the existing state still has: vsphere_virtual_machine.vm["lb1"] Check Current State Run from the environment root: ...

June 9, 2026 · 2 min · Trinidad Marroquin

Terraform Variable File Hygiene

Terraform repositories often accumulate terraform.tfvars, *.auto.tfvars, shell env files, examples, and helper scripts. That works until nobody remembers which file is authoritative. Problem A single environment directory may contain: terraform.tfvars vars.auto.tfvars vars.env terraform.tfvars.example vars.auto.tfvars.example vars.env.example That creates three problems: Terraform may load values from multiple files. shell helper files look like Terraform configuration. secrets may drift into files that should be committed safely. How Terraform Loads Values Terraform automatically loads: ...

June 9, 2026 · 2 min · Trinidad Marroquin

Terraform vSphere Clone Customization Failures

Terraform can successfully ask vSphere to clone a VM and still fail during guest customization. In that case, the problem is usually inside the guest/template, not Terraform syntax. Symptom Terraform reports an error like: Virtual machine customization failed An error occurred while customizing VM ... For details reference the log file /var/log/vmware-imc/toolsDeployPkg.log in the guest OS. Terraform may leave the VM in place to help troubleshooting. First Checks From the VM console or SSH if available: ...

June 9, 2026 · 2 min · Trinidad Marroquin

vSphere Guestinfo And Cloud-Init On Cloned VMs

Terraform can inject cloud-init data into vSphere clones through VMware guestinfo keys. That only works if the template is built to let cloud-init run on first boot. Symptom Terraform creates or replaces the VM, but the expected userdata.yaml behavior does not happen. Bootstrap does not run, SSH is not configured, or /var/log/platform-bootstrap.log is missing. Check Guestinfo From vSphere Use govc to inspect the VM extra config: source govc.env govc vm.info -e /DC-Site-A/vm/K8s-Cluster/OpsTools/cluster-a-api-lb-01 \ | grep 'guestinfo\|disk.enableUUID' Look for keys like: ...

June 9, 2026 · 2 min · Trinidad Marroquin