VMware vSphere Knowledge Base

Phase 7 — Networking ⚠ Break Scenarios ✓ Fix Procedures
10
Networking Issues
4
Break Scenarios
6
Fix Procedures
Phase 7
Current Phase
61
vDS Misconfiguration — Host Network Disconnect
Changing vDS uplink or port group configuration disconnects host from vCenter — management network lost
Impact: Host becomes completely unreachable from vCenter. Management network connectivity is severed. VMs continue running but cannot be managed. Emergency console access required for recovery.
Symptoms
  • Host shows "Not Responding" in vCenter after vDS change
  • Cannot SSH or ping the ESXi management IP
  • vCenter logs: Lost connection to host
  • Other hosts on same vDS may also lose connectivity
  • VMs running but unmanageable from vCenter
Root Causes
  • Management VMkernel port migrated to vDS without a fallback NIC on vSS
  • vDS uplink removed or reassigned — physical NIC no longer bridging traffic
  • Port group VLAN changed on management port group
  • vDS configuration pushed that conflicts with physical switch trunking
  • All uplinks moved to vDS simultaneously — no rollback path

When the management VMkernel adapter (vmk0) is moved from a vSS to a vDS without keeping at least one physical NIC on the vSS, or when a vDS uplink configuration change disconnects the management VLAN, the host loses all network connectivity to vCenter. Since the vDS configuration is managed by vCenter itself, a catch-22 occurs: you need vCenter to fix the vDS, but the host can't reach vCenter. Recovery requires direct console (DCUI) or SSH if still reachable via out-of-band management.

1

Access the host via DCUI or iLO/iDRAC console

# Enable ESXi Shell from DCUI if not already enabled:
# DCUI → Troubleshooting Options → Enable ESXi Shell

# Or via iLO/iDRAC remote console, press Alt+F1 for ESXi Shell
# Login with root credentials
2

Restore management network to vSS

# List current virtual switches and uplinks:
esxcli network vswitch standard list
esxcli network vswitch dvs vmware list

# Create a new vSS if none exists:
esxcli network vswitch standard add -v vSwitch0

# Add a physical NIC back to vSS:
esxcli network vswitch standard uplink add -v vSwitch0 -u vmnic0

# Add a port group for management:
esxcli network vswitch standard portgroup add -v vSwitch0 -p "Management Network"

# Set VLAN if required:
esxcli network vswitch standard portgroup set -p "Management Network" --vlan-id 100

# Move vmk0 to vSS management port group:
esxcli network ip interface remove -i vmk0
esxcli network ip interface add -i vmk0 -p "Management Network"
esxcli network ip interface ipv4 set -i vmk0 -I 10.0.0.10 -N 255.255.255.0 -t static

# Restart management agents:
/etc/init.d/hostd restart
/etc/init.d/vpxa restart
3

Verify connectivity and reconnect host in vCenter

# Test network connectivity:
vmkping 10.0.0.1
vmkping <vcenter-ip>

# Check management network interface:
esxcli network ip interface list
esxcli network ip interface ipv4 get -i vmk0

# In vCenter: Right-click host → Connection → Reconnect
# Then re-plan vDS migration with a safe rollback strategy
🛈 Best Practice: Always keep the management VMkernel on a vSS with at least one dedicated physical NIC as a safety net. When migrating to vDS, move one NIC at a time and verify connectivity before moving the second. Never migrate all uplinks simultaneously. Test vDS changes on a single non-critical host first before rolling out cluster-wide.
62
vMotion VMkernel Network Troubleshooting
vMotion fails due to VMkernel misconfiguration — wrong VLAN, missing vMotion tag, or firewall blocking port 8000
Impact: Live migrations fail, preventing DRS load balancing, host maintenance mode, and evacuation during patching. VMs cannot be moved without downtime.
Symptoms
  • vMotion fails with "A general system error occurred: Migrate"
  • Migration stuck at 10% or 32% then times out
  • Error: The vMotion interface is not configured
  • DRS cannot balance cluster — "vMotion not available"
  • vmkping between hosts on vMotion interface fails
Root Causes
  • VMkernel adapter missing the vMotion traffic type tag
  • vMotion VMkernel on wrong VLAN — hosts can't reach each other
  • ESXi firewall blocking TCP port 8000
  • MTU mismatch between source and destination vMotion interfaces
  • Multiple default gateways conflicting with vMotion routing
1

Verify VMkernel configuration and vMotion tag

# List all VMkernel interfaces and their enabled services:
esxcli network ip interface list

# Check which VMkernel has vMotion enabled:
esxcli network ip interface tag get -i vmk1

# If vMotion is NOT listed, enable it:
# vCenter UI: Host → Configure → VMkernel adapters → vmk1 → Edit → Enable vMotion

# Verify vMotion interface IP:
esxcli network ip interface ipv4 get -i vmk1

# Check VLAN assignment:
esxcli network vswitch dvs vmware list
esxcli network vswitch standard portgroup list
2

Test vMotion network connectivity between hosts

# Ping target host vMotion IP using the vMotion VMkernel interface:
vmkping -I vmk1 <target-host-vMotion-IP>

# Test with jumbo frames (if MTU 9000 configured):
vmkping -I vmk1 -d -s 8972 <target-host-vMotion-IP>

# Check for firewall rules blocking vMotion (port 8000):
esxcli network firewall ruleset list | grep -i vmotion
esxcli network firewall ruleset set -e true -r vMotion

# Verify TCP port 8000 connectivity:
nc -z <target-host-vMotion-IP> 8000
3

Check TCP/IP stack and routing for vMotion

# List TCP/IP stacks — vMotion should use dedicated stack:
esxcli network ip netstack list

# Check routing table for vMotion stack:
esxcli network ip route ipv4 list -N vmotion

# If using default stack, ensure no conflicting default gateways:
esxcli network ip route ipv4 list -N defaultTcpipStack

# Test vMotion after fixes — migrate a test VM:
# PowerCLI:
Move-VM -VM "test-vm" -Destination "target-host" -VMotionPriority High
🛈 Best Practice: Use a dedicated VLAN and subnet for vMotion traffic, separate from management and VM traffic. Use the dedicated vMotion TCP/IP stack for proper routing isolation. Enable vMotion on exactly one VMkernel adapter per host (or multi-NIC vMotion with two). Always test with vmkping -I vmkN between all hosts before relying on DRS.
63
MTU / Jumbo Frames Mismatch
End-to-end MTU inconsistency causes vMotion failures at 32%, NFS timeouts, and iSCSI connection drops
Impact: vMotion stalls at 32% and fails. NFS datastore I/O timeouts cause VM pauses and APD events. iSCSI connections drop causing storage path failures. Performance degrades on all jumbo-frame-dependent traffic.
Symptoms
  • vMotion consistently fails at ~32% (memory pre-copy phase)
  • NFS datastore shows intermittent APD (All Paths Down)
  • iSCSI sessions drop with connection reset errors
  • vmkping -d -s 8972 fails but vmkping (default size) succeeds
  • Packet loss on large frames only — small frames pass fine
Root Causes
  • VMkernel adapter set to MTU 9000 but physical switch port at 1500
  • vDS/vSS MTU set to 9000 but one intermediate switch in path at 1500
  • Storage array NFS/iSCSI interface not configured for jumbo frames
  • Only some hosts in cluster configured for jumbo frames — mixed MTU
  • Physical switch trunk port MTU not increased to support jumbo frames
1

Test end-to-end MTU path

# Test jumbo frame connectivity (9000 MTU = 8972 payload + 28 header):
vmkping -I vmk1 -d -s 8972 <target-IP>

# -d = set Don't Fragment bit (critical for MTU testing)
# -s 8972 = payload size (9000 - 20 IP header - 8 ICMP header)

# If this fails but regular ping works, MTU mismatch exists:
vmkping -I vmk1 <target-IP>            # Should work (1500 MTU)
vmkping -I vmk1 -d -s 8972 <target-IP>  # Fails = MTU mismatch

# Binary search to find actual MTU:
vmkping -I vmk1 -d -s 4000 <target-IP>
vmkping -I vmk1 -d -s 6000 <target-IP>
vmkping -I vmk1 -d -s 7000 <target-IP>
2

Check and set MTU on all layers

# Check VMkernel adapter MTU:
esxcli network ip interface list | grep -A5 vmk1

# Check vSwitch / vDS MTU:
esxcli network vswitch standard list     # vSS
esxcli network vswitch dvs vmware list   # vDS

# Set MTU on vSS:
esxcli network vswitch standard set -v vSwitch1 -m 9000

# Set MTU on VMkernel adapter:
esxcli network ip interface set -i vmk1 -m 9000

# For vDS — set via vCenter UI:
# vDS → Configure → Properties → Advanced → MTU: 9000

# Verify physical switch MTU (example Cisco):
# show interface TenGigabitEthernet1/1 | include MTU
# configure: system jumbo mtu 9216
3

Validate end-to-end after changes

# Re-test from EVERY host to every target (storage, other hosts):
vmkping -I vmk1 -d -s 8972 <storage-IP>
vmkping -I vmk1 -d -s 8972 <host2-vMotion-IP>
vmkping -I vmk1 -d -s 8972 <host3-vMotion-IP>

# PowerCLI — Check MTU across all hosts:
Get-VMHost | ForEach-Object {
    $vmk = Get-VMHostNetworkAdapter -VMHost $_ -VMKernel | Where { $_.VMotionEnabled }
    [PSCustomObject]@{
        Host = $_.Name
        VMkernel = $vmk.Name
        MTU = $vmk.Mtu
        IP = $vmk.IP
    }
} | Format-Table -AutoSize
Best Practice: MTU must be 9000 at every hop: VMkernel adapter, vSwitch/vDS, physical NIC, every physical switch in the path, and the target device (storage array, other hosts). One link at 1500 breaks the entire jumbo frame path. Always test with vmkping -d -s 8972 — never assume MTU is correct just because small pings work.
64
NIC Teaming & Failover Policy
Configure load balancing, failover order, and network failover detection for optimal redundancy and throughput
🛈 Context: NIC teaming determines how ESXi distributes outbound traffic across multiple physical NICs and how it detects NIC failures. Incorrect policies cause traffic black holes, asymmetric routing, or no failover on NIC failure.
Load Balancing Options
  • Route based on originating virtual port: Default — each VM pinned to one uplink. Simple, works with any physical switch
  • Route based on IP hash: Distributes per flow. Requires LACP/EtherChannel on physical switch
  • Route based on source MAC hash: Per VM MAC. Rarely used
  • Route based on physical NIC load: vDS only — dynamically rebalances. Best for most workloads
  • Explicit failover order: Always uses first active NIC. No load balancing
Failover Detection
  • Link Status Only: Detects cable pull and switch port down. Does NOT detect upstream switch failure
  • Beacon Probing: Sends probe packets between NICs. Detects upstream failures but requires ≥3 NICs for reliability
  • Notify Switches: Sends RARP on failover — keep enabled for fast failover
  • Failback: Return to preferred NIC when it recovers. Can cause flapping — consider disabling
1

Check current NIC teaming policy

# vSS — Check teaming policy:
esxcli network vswitch standard policy failover get -v vSwitch0

# vDS — Check via vCenter UI:
# vDS → Port Groups → Edit → Teaming and failover

# PowerCLI — Audit NIC teaming across all hosts:
Get-VMHost | ForEach-Object {
    $vs = Get-VirtualSwitch -VMHost $_ -Standard
    foreach ($v in $vs) {
        $policy = Get-NicTeamingPolicy -VirtualSwitch $v
        [PSCustomObject]@{
            Host = $_.Name
            vSwitch = $v.Name
            LoadBalancing = $policy.LoadBalancingPolicy
            FailoverDetection = $policy.NetworkFailoverDetectionPolicy
            ActiveNic = ($policy.ActiveNic -join ",")
            StandbyNic = ($policy.StandbyNic -join ",")
        }
    }
} | Format-Table -AutoSize
2

Configure recommended teaming policy

# vSS — Set load balancing to "Route based on physical NIC load" (vDS) or "originating port" (vSS):
esxcli network vswitch standard policy failover set -v vSwitch0 \
    -l portid          # portid = originating port (default, safest)
                        # iphash = IP hash (needs LACP)
                        # mac    = source MAC hash
                        # explicit = explicit failover order

# Set failover order — Active and Standby NICs:
esxcli network vswitch standard policy failover set -v vSwitch0 \
    -a vmnic0,vmnic2 \
    -s vmnic1,vmnic3

# Enable notify switches and set failback:
esxcli network vswitch standard policy failover set -v vSwitch0 \
    -n true  \          # Notify switches on failover
    -b true             # Failback enabled

# Configure LACP on vDS (if using IP hash):
# vDS → Configure → LACP → New LAG → Mode: Active, Ports: 2
3

Test failover behavior

# Simulate NIC failure — disconnect one uplink and verify:
esxcli network nic down -n vmnic0

# Check traffic continues on standby NIC:
esxcli network nic stats get -n vmnic1
vmkping <gateway-ip>

# Restore NIC:
esxcli network nic up -n vmnic0

# Verify failback occurred:
esxcli network vswitch standard policy failover get -v vSwitch0
🛈 Best Practice: Use "Route based on physical NIC load" on vDS for best dynamic balancing. For vSS, "Route based on originating virtual port" is the safest default. Only use IP hash if you have properly configured LACP/EtherChannel on the physical switch. Separate management, vMotion, and VM traffic onto different NIC teams or port groups with distinct failover orders.
65
Port Group VLAN Configuration Issues
VMs can't communicate — wrong VLAN ID, missing trunking, or native VLAN mismatch with physical switch
Impact: VMs lose network connectivity. Applications fail health checks. Inter-VM communication breaks. Services that depend on network reachability go down.
Symptoms
  • VMs on same port group can ping each other but not external hosts
  • VMs cannot reach their default gateway
  • New VMs get no DHCP address — APIPA (169.254.x.x) assigned
  • Intermittent connectivity — some VMs work, others don't
  • Physical switch shows VLAN mismatch or native VLAN mismatch logs
Root Causes
  • Port group VLAN ID doesn't match physical switch access/trunk VLAN
  • Physical switch port set to access mode but ESXi sending tagged frames
  • VLAN 4095 (trunk all) set on port group but physical switch not trunking
  • VLAN 0 (no VLAN) but physical switch expects tagged traffic
  • Native VLAN mismatch between ESXi uplink and physical switch trunk
1

Check current VLAN configuration

# List vSS port groups and their VLAN IDs:
esxcli network vswitch standard portgroup list

# List vDS port groups:
esxcli network vswitch dvs vmware list

# VLAN types in ESXi:
# VLAN 0     = No VLAN tagging (frames sent untagged)
# VLAN 1-4094 = Specific VLAN (ESXi tags frames with this VLAN ID)
# VLAN 4095  = VLAN Trunking (passes all VLAN tags to guest OS — guest must tag)

# Check which port group a VM is connected to:
# PowerCLI:
Get-VM "web-server" | Get-NetworkAdapter | Select NetworkName, MacAddress
2

Match ESXi VLAN with physical switch configuration

# ESXi port group VLAN must match physical switch:
#
# ESXi Port Group VLAN 100 → Physical switch: trunk allowed vlan 100
# ESXi Port Group VLAN 0   → Physical switch: access port (native vlan)
# ESXi Port Group VLAN 4095 → Physical switch: trunk all VLANs

# Set correct VLAN on vSS port group:
esxcli network vswitch standard portgroup set -p "VM Network" --vlan-id 100

# For vDS — set via vCenter:
# vDS → Port Groups → Edit → VLAN type: VLAN, VLAN ID: 100

# Verify physical switch (Cisco example):
# show interface GigabitEthernet0/1 switchport
# Expected: Trunking, Allowed VLANs: 100,200,300
# If access port: switchport access vlan 100
3

Validate connectivity after VLAN fix

# From inside the VM, test connectivity:
ping <default-gateway>
ping <external-host>

# From ESXi, use packet capture to verify VLAN tagging:
pktcap-uw --uplink vmnic0 --vlan 100 -o /tmp/vlan100.pcap

# Capture on specific port group:
pktcap-uw --switchport <port-id> --dir 0 -o /tmp/capture.pcap

# PowerCLI — Audit all port group VLANs across cluster:
Get-VDPortgroup | Select Name, VlanConfiguration | Format-Table -AutoSize
Get-VirtualPortGroup | Select Name, VLanId, VirtualSwitch | Format-Table -AutoSize
🛈 Best Practice: Document your VLAN-to-port-group mapping. Always verify the physical switch trunk configuration allows the VLAN IDs used by ESXi port groups. Use VLAN 4095 (trunk mode) only when the guest OS handles VLAN tagging (e.g., nested ESXi, router VMs). Standardize VLAN assignments across all hosts in the cluster.
66
vSS to vDS Migration Procedure
Safely migrate hosts from Standard vSwitch to Distributed vSwitch with rollback capability
Risk: Incorrect vDS migration can disconnect hosts from vCenter. Always keep one physical NIC on the vSS until the migration is fully verified. Plan a rollback strategy before starting.
Prerequisites
  • vCenter Server running and accessible (vDS requires vCenter)
  • Enterprise Plus license (or vDS-capable license)
  • Document current vSS config: port groups, VLANs, NIC teaming, MTU
  • Map vSS port groups → equivalent vDS port groups
  • Schedule maintenance window — VM networking will briefly interrupt
Migration Strategy
  • One NIC at a time: Move vmnic1 to vDS, keep vmnic0 on vSS
  • One host first: Migrate a non-critical host, verify, then proceed
  • VMkernel last: Migrate VM port groups first, then VMkernel adapters
  • Management NIC last: Management network migrated only after everything else works
  • Rollback plan: Document how to move NIC back to vSS if needed
1

Create vDS and configure port groups

# PowerCLI — Create a new vDS:
$dc = Get-Datacenter "Production"
$vds = New-VDSwitch -Name "Production-vDS" -Location $dc `
    -NumUplinkPorts 4 -Mtu 9000 -Version "7.0.3"

# Create port groups matching your vSS port groups:
New-VDPortgroup -VDSwitch $vds -Name "VLAN100-Web" -VlanId 100
New-VDPortgroup -VDSwitch $vds -Name "VLAN200-App" -VlanId 200
New-VDPortgroup -VDSwitch $vds -Name "VLAN300-DB" -VlanId 300
New-VDPortgroup -VDSwitch $vds -Name "vMotion-VLAN500" -VlanId 500

# Add hosts to vDS (without assigning uplinks yet):
Get-VMHost "esxi-01.lab.local" | Add-VDSwitchVMHost -VDSwitch $vds
2

Migrate one uplink and VM networking

# Move ONE physical NIC from vSS to vDS (keep the other on vSS):
$vmhost = Get-VMHost "esxi-01.lab.local"
$pnic = Get-VMHostNetworkAdapter -VMHost $vmhost -Physical -Name "vmnic1"
Add-VDSwitchPhysicalNetworkAdapter -DistributedSwitch $vds `
    -VMHostPhysicalNic $pnic -Confirm:$false

# Migrate VM networking from vSS port groups to vDS port groups:
Get-VM -Location $vmhost | Where {
    ($_ | Get-NetworkAdapter).NetworkName -eq "VM Network"
} | Get-NetworkAdapter | Set-NetworkAdapter `
    -NetworkName "VLAN100-Web" -Confirm:$false

# Verify VMs can still communicate:
# Test ping from VMs to gateway and between VMs
3

Migrate VMkernel adapters and remaining uplinks

# After VM networking verified, migrate VMkernel adapters:
$vmk = Get-VMHostNetworkAdapter -VMHost $vmhost -VMKernel -Name "vmk1"
$pg = Get-VDPortgroup -Name "vMotion-VLAN500"
Set-VMHostNetworkAdapter -VirtualNic $vmk -PortGroup $pg -Confirm:$false

# Move remaining uplinks to vDS:
$pnic0 = Get-VMHostNetworkAdapter -VMHost $vmhost -Physical -Name "vmnic0"
Add-VDSwitchPhysicalNetworkAdapter -DistributedSwitch $vds `
    -VMHostPhysicalNic $pnic0 -Confirm:$false

# Remove the now-empty vSS (optional — keep for rollback):
# Remove-VirtualSwitch -VirtualSwitch (Get-VirtualSwitch -VMHost $vmhost -Name "vSwitch0")

# Repeat for remaining hosts one at a time
🛈 Best Practice: Keep the old vSS with at least one NIC as a rollback path until you've verified all hosts are stable on the vDS for at least 48 hours. Use vDS network health check (vDS → Configure → Health Check) to automatically detect VLAN and MTU mismatches between ESXi and the physical switch. Export the vDS configuration as a backup before making changes.
67
Network I/O Control (NIOC) — Traffic Shaping
Prioritize network traffic types when multiple workloads share the same physical NICs on a vDS
🛈 Context: NIOC (Network I/O Control) is a vDS feature that ensures critical traffic types (management, vMotion, NFS) get guaranteed bandwidth when physical NICs are saturated. Without NIOC, a VM backup flood can starve vMotion or management traffic.
System Traffic Types
  • Management: vCenter-to-host communication (50 shares)
  • vMotion: Live migration traffic (50 shares)
  • Fault Tolerance: FT logging traffic (50 shares)
  • vSAN: vSAN node-to-node traffic (100 shares)
  • NFS: NFS datastore I/O (50 shares)
  • iSCSI: iSCSI storage traffic (50 shares)
  • Virtual Machine: VM network traffic (varies)
NIOC v3 Features
  • Shares: Relative priority when contention occurs (25/50/100 = Low/Normal/High)
  • Reservation: Guaranteed bandwidth in Gbps per traffic type
  • Limit: Maximum bandwidth cap per traffic type
  • Per-VM reservation: Guarantee bandwidth per individual VM
  • Network Resource Pools: Custom pools for tenant isolation
1

Enable NIOC on the vDS

# vCenter UI:
# Networking → vDS → Configure → Resource Allocation → Enable Network I/O Control

# PowerCLI — Enable NIOC:
$vds = Get-VDSwitch -Name "Production-vDS"
$vds | Set-VDSwitch -EnableNetworkIOControl $true

# Check NIOC status:
(Get-VDSwitch -Name "Production-vDS").ExtensionData.Config.NetworkResourceManagementEnabled
2

Configure traffic type shares and reservations

# vCenter UI:
# vDS → Configure → Resource Allocation → System Traffic
# Click each traffic type → Edit:
#   Management: Shares = High (100), Reservation = 0.5 Gbps
#   vMotion:    Shares = High (100), Reservation = 2 Gbps
#   VM Traffic: Shares = Normal (50), Reservation = 1 Gbps
#   NFS:        Shares = High (100), Reservation = 2 Gbps

# PowerCLI — Set shares for a traffic type:
$vds = Get-VDSwitch -Name "Production-vDS"

# Get current resource allocation:
$vds.ExtensionData.Config.InfrastructureTrafficResourceConfig |
    Select Key,
    @{N='Shares';E={$_.AllocationInfo.Shares.Shares}},
    @{N='Level';E={$_.AllocationInfo.Shares.Level}},
    @{N='Reservation';E={$_.AllocationInfo.Reservation}},
    @{N='Limit';E={$_.AllocationInfo.Limit}} |
    Format-Table -AutoSize
3

Create Network Resource Pools for VM traffic isolation

# Create custom resource pool for specific workloads:
# vDS → Configure → Resource Allocation → Network Resource Pools → New

# Assign a port group to a resource pool:
# vDS → Port Groups → Edit Settings → Resource Allocation → Pool

# Monitor NIOC effectiveness:
# vDS → Monitor → Resource Allocation
# Check per-host bandwidth utilization per traffic type

# PowerCLI — View network resource pools:
$vds = Get-VDSwitch -Name "Production-vDS"
$vds.ExtensionData.NetworkResourcePool | Select Key, Name,
    @{N='Shares';E={$_.AllocationInfo.Shares.Shares}},
    @{N='Limit';E={$_.AllocationInfo.Limit}} |
    Format-Table -AutoSize
🛈 Best Practice: Enable NIOC on all production vDS switches. Set higher shares and reservations for management and storage traffic — these are critical and should never be starved by VM traffic. Use reservations sparingly as total reservations across all traffic types cannot exceed physical NIC bandwidth. Monitor bandwidth allocation regularly under peak load.
68
TCP/IP Stack & VMkernel Routing
Configure custom TCP/IP stacks for vMotion and provisioning with separate routing tables and gateways
🛈 Context: ESXi provides dedicated TCP/IP stacks (default, vMotion, provisioning) each with their own routing table. This avoids the "single default gateway" problem where vMotion traffic tries to route through the management gateway instead of the vMotion gateway.
Available Stacks
  • defaultTcpipStack: Management, VM traffic, NFS — has THE default gateway
  • vmotion: Dedicated stack for vMotion — own gateway and DNS
  • vSphereProvisioning: Cold migration, snapshots, cloning — own gateway
  • Custom stacks: User-defined stacks for special use cases (API only)
Common Issues
  • vMotion VMkernel on default stack — uses management gateway, traffic can't route
  • Multiple VMkernel adapters on default stack with conflicting routes
  • No default gateway set on vMotion stack — cross-subnet vMotion fails
  • DNS not configured on vMotion stack — hostname resolution fails
1

List TCP/IP stacks and current routing

# List all TCP/IP stacks:
esxcli network ip netstack list

# Check routing table for each stack:
esxcli network ip route ipv4 list -N defaultTcpipStack
esxcli network ip route ipv4 list -N vmotion
esxcli network ip route ipv4 list -N vSphereProvisioning

# List VMkernel adapters and their TCP/IP stack assignment:
esxcli network ip interface list
# Look for "NetStack" field — shows which stack each vmk uses

# Check DNS per stack:
esxcli network ip dns server list -N defaultTcpipStack
esxcli network ip dns server list -N vmotion
2

Create VMkernel adapter on dedicated vMotion stack

# Remove existing vMotion vmk from default stack (if needed):
esxcli network ip interface remove -i vmk1

# Create VMkernel adapter on the vMotion TCP/IP stack:
# vCenter UI: Host → Configure → VMkernel Adapters → Add
#   Port Group: vMotion-PG
#   TCP/IP Stack: vMotion  (CANNOT change after creation)
#   IPv4: 10.10.50.10/24

# Set default gateway on vMotion stack:
esxcli network ip route ipv4 add -N vmotion -n default -g 10.10.50.1

# Set DNS on vMotion stack (optional):
esxcli network ip dns server add -N vmotion -s 10.0.0.53

# Verify:
esxcli network ip route ipv4 list -N vmotion
3

Fix routing issues on default stack

# Problem: multiple VMkernel adapters on default stack with wrong routes
# Check current routes:
esxcli network ip route ipv4 list -N defaultTcpipStack

# Add a static route for a specific subnet:
esxcli network ip route ipv4 add -N defaultTcpipStack \
    -n 172.16.0.0/16 -g 10.0.0.1

# Remove a conflicting route:
esxcli network ip route ipv4 remove -N defaultTcpipStack \
    -n 172.16.0.0/16 -g 10.0.0.1

# Change default gateway:
esxcli network ip route ipv4 add -N defaultTcpipStack \
    -n default -g 10.0.0.1

# PowerCLI — Audit VMkernel stack assignments across hosts:
Get-VMHost | ForEach-Object {
    $vmks = Get-VMHostNetworkAdapter -VMHost $_ -VMKernel
    foreach ($vmk in $vmks) {
        [PSCustomObject]@{
            Host = $_.Name
            VMkernel = $vmk.Name
            IP = $vmk.IP
            VMotion = $vmk.VMotionEnabled
            Mtu = $vmk.Mtu
        }
    }
} | Format-Table -AutoSize
🛈 Best Practice: Always use the dedicated vMotion TCP/IP stack for vMotion VMkernel adapters — this gives vMotion its own routing table and default gateway, avoiding conflicts with management routing. Note: once a VMkernel is assigned to a TCP/IP stack, you cannot change it — you must delete and recreate. For cross-subnet vMotion, ensure the vMotion stack has a valid default gateway.
69
ESXi Firewall & Port Requirements
Manage ESXi firewall rulesets, open required ports, and configure custom firewall rules for services
🛈 Context: ESXi has a built-in firewall that controls inbound and outbound connections on the management interface. Services like NFS, syslog, SSH, and vMotion require specific firewall rulesets to be enabled. Misconfigured firewall rules can block vCenter communication, storage, or monitoring.
Inbound Ports
  • 22 (TCP): SSH access to ESXi
  • 80/443 (TCP): vSphere Client, API, SDK
  • 427 (TCP/UDP): CIM SLP service location
  • 902 (TCP/UDP): Console, heartbeat (vpxa/hostd)
  • 5989 (TCP): CIM server (hardware monitoring)
Outbound / Service Ports
  • 8000 (TCP): vMotion traffic between hosts
  • 8100/8200 (TCP/UDP): Fault Tolerance logging
  • 2049 (TCP): NFS datastore access
  • 3260 (TCP): iSCSI target connections
  • 514 (UDP) / 1514 (TCP): Syslog forwarding
  • 6999 (UDP): NSX VXLAN / Geneve overlay
1

List and manage firewall rulesets

# List all firewall rulesets and their status:
esxcli network firewall ruleset list

# Check if firewall is enabled globally:
esxcli network firewall get

# Get details of a specific ruleset (allowed IPs, ports):
esxcli network firewall ruleset rule list -r sshServer
esxcli network firewall ruleset rule list -r nfsClient
esxcli network firewall ruleset rule list -r vMotion

# List only enabled rulesets:
esxcli network firewall ruleset list | grep true
2

Enable/disable rulesets and restrict by IP

# Enable a firewall ruleset:
esxcli network firewall ruleset set -e true -r syslog
esxcli network firewall ruleset set -e true -r nfsClient
esxcli network firewall ruleset set -e true -r sshServer

# Disable a ruleset:
esxcli network firewall ruleset set -e false -r CIMSLP

# Restrict SSH to specific IPs (security hardening):
esxcli network firewall ruleset set -r sshServer -a false  # Disable "allow all"
esxcli network firewall ruleset allowedip add -r sshServer -i 10.0.0.0/24
esxcli network firewall ruleset allowedip add -r sshServer -i 192.168.1.100

# Restrict vCenter access:
esxcli network firewall ruleset set -r vpxClient -a false
esxcli network firewall ruleset allowedip add -r vpxClient -i 10.0.0.50

# Refresh firewall rules:
esxcli network firewall refresh
3

Create custom firewall rules

# Custom rules are XML files in /etc/vmware/firewall/
# Example: Allow custom monitoring agent on port 9100

cat > /etc/vmware/firewall/custom-monitor.xml << 'EOF'
<ConfigRoot>
  <service id="0050">
    <id>customMonitor</id>
    <rule id="0000">
      <direction>inbound</direction>
      <protocol>tcp</protocol>
      <porttype>dst</porttype>
      <port>9100</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
  </service>
</ConfigRoot>
EOF

# Refresh firewall to load new rules:
esxcli network firewall refresh

# Verify custom rule loaded:
esxcli network firewall ruleset list | grep customMonitor
esxcli network firewall ruleset rule list -r customMonitor
Best Practice: Never disable the ESXi firewall entirely. Instead, enable only the specific rulesets needed and restrict allowed IPs to known management networks. Custom firewall rules in /etc/vmware/firewall/ do not persist across reboots unless added to a VIB or host profile. Use host profiles to enforce consistent firewall configuration across all cluster hosts.
70
SR-IOV & DirectPath I/O Configuration
Bypass hypervisor virtual switch for maximum network performance using hardware-level NIC virtualization
Important Limitations: VMs using SR-IOV or DirectPath I/O cannot use vMotion, snapshots, Fault Tolerance, or suspend/resume. These features bypass the hypervisor virtual switch entirely. Plan accordingly — these are for performance-critical workloads only.
SR-IOV (Single Root I/O Virtualization)
  • NIC creates multiple Virtual Functions (VFs) from one Physical Function (PF)
  • Each VF assigned directly to a VM — bypasses vSwitch
  • Near bare-metal network performance with low latency
  • Multiple VMs share one physical NIC via hardware
  • Requires: compatible NIC (Intel X710, Mellanox ConnectX), VT-d/IOMMU
DirectPath I/O (PCI Passthrough)
  • Entire PCI device (NIC, GPU, etc.) passed directly to a single VM
  • Maximum performance — full device dedicated to one VM
  • No sharing — one physical device per VM
  • Used for: GPU workloads, FPGA, specialized hardware
  • Requires: Intel VT-d or AMD-Vi (IOMMU) enabled in BIOS
1

Enable IOMMU and verify hardware support

# Step 1: Enable Intel VT-d / AMD-Vi in server BIOS/UEFI
# Dell: BIOS → Processor Settings → Virtualization Technology → Intel VT-d: Enabled
# HP:   BIOS → Virtualization → Intel(R) VT-d: Enabled

# Verify IOMMU is enabled in ESXi:
esxcli system settings kernel list | grep -i iommu

# Check if passthrough-capable devices are detected:
esxcli hardware pci list | grep -i "network\|ethernet"

# vCenter UI: Host → Configure → Hardware → PCI Devices
# Devices available for passthrough will be listed
2

Configure SR-IOV Virtual Functions

# Enable SR-IOV on a compatible NIC:
# vCenter UI: Host → Configure → Hardware → PCI Devices
# Select NIC → Configure SR-IOV → Number of VFs: 8 (max varies by NIC)

# Reboot host for SR-IOV to take effect

# After reboot, verify VFs are created:
lspci | grep "Virtual Function"
esxcli network sriovnic vf list -n vmnic4

# Check SR-IOV NIC status:
esxcli network sriovnic list

# Assign VF to a VM:
# VM → Edit Settings → Add New Device → Network Adapter
# Adapter Type: SR-IOV Passthrough
# Physical Function: vmnic4
# VM will get a VF from the NIC hardware
3

Configure DirectPath I/O (PCI Passthrough)

# Mark device for passthrough:
# vCenter UI: Host → Configure → Hardware → PCI Devices
# Select device → Toggle Passthrough → Reboot host

# Assign passthrough device to VM:
# VM → Edit Settings → Add New Device → PCI Device
# Select the passthrough device

# IMPORTANT: VM settings must also have:
# - Memory Reservation: Full (all memory must be reserved)
# - VM → Edit Settings → Memory → Reserve all guest memory

# PowerCLI — Check passthrough devices:
$vmhost = Get-VMHost "esxi-01.lab.local"
$vmhost.ExtensionData.Config.PciPassthruInfo | Where { $_.PassthruEnabled } |
    Select Id, PassthruEnabled, PassthruCapable, PassthruActive |
    Format-Table -AutoSize

# Verify VM has passthrough device:
(Get-VM "perf-vm").ExtensionData.Config.Hardware.Device |
    Where { $_ -is [VMware.Vim.VirtualPCIPassthrough] } |
    Select @{N='Device';E={$_.DeviceInfo.Summary}}
🛈 Best Practice: Use SR-IOV over DirectPath I/O when possible — it allows multiple VMs to share one NIC and is more flexible. Reserve DirectPath I/O for specialized devices (GPU, FPGA). Always document which VMs use passthrough since they cannot be vMotioned. Plan for host maintenance by having application-level HA (clustering, load balancers) for passthrough VMs since hypervisor-level migration is unavailable.