VMware ESXi
Updated: September 10, 2025Categories: Virtualization, Bare Metal
Printed from:
VMware ESXi Comprehensive Cheatsheet
1. Installation and Initial Setup
Pre-Installation Requirements
- Supported hardware: 64-bit x86 processors with virtualization support
- Minimum requirements:
- 2 CPU cores
- 4GB RAM (minimum), 8GB+ recommended
- 32GB+ storage for ESXi installation
- Network adapter compatible with VMware HCL
Installation Steps
Bash
123456789101112# Boot from ESXi installation media
# Follow wizard for:
# - Language selection
# - Keyboard layout
# - Installation destination
# - Root password configuration
# Post-installation initial configuration
esxcli system hostname set --host=esxi-01
esxcli network ip interface ipv4 set -i vmk0 -I 192.168.1.100 -N 255.255.255.0 -T static
esxcli network ip route ipv4 add --gateway=192.168.1.1
2. ESXi Web Interface Navigation
Access Methods
- Direct access: https://[ESXi-IP]/ui
- vCenter access: https://[vCenter-IP]/vsphere-client
Key Dashboard Sections
- Home: Overview of host resources
- Inventory: VM and host management
- Monitor: Performance and event tracking
- Configure: Host-level configurations
3. Virtual Machine Management
VM Creation
Bash
123# CLI VM creation
vmkfstools -c 40G /vmfs/volumes/datastore1/vm01/vm01.vmdk
Web UI Steps:
- File > New Virtual Machine
- Select deployment type (Create from scratch)
- Name VM and select datacenter/folder
- Select compute resource
- Select storage
- Select OS
- Customize hardware settings
VM Configuration Commands
Bash
123# PowerCLI VM modification
Set-VM -VM "VMName" -NumCPU 4 -MemoryGB 16
VM Cloning
Bash
123# CLI clone (template-based)
vmkfstools -i /path/to/template.vmdk /path/to/new-vm.vmdk
4. Storage Management
Datastore Operations
Bash
123456789# List datastores
esxcli storage filesystem list
# Mount NFS datastore
esxcli storage nfs add -h 192.168.1.50 -s /volume1/data -v nfs-datastore
# VMFS datastore creation
vmkfstools -C vmfs5 -b 1m /vmfs/devices/disks/mpx.vmhba0:C0:T0:L0
5. Networking Configuration
vSwitch Creation
Bash
123456789# Create vSwitch
esxcli network vswitch standard add -v vSwitch1
# Add physical NIC to vSwitch
esxcli network vswitch standard uplink add -v vSwitch1 -u vmnic1
# Create port group
esxcli network vswitch standard portgroup add -v vSwitch1 -p "Management Network"
VLAN Configuration
Bash
123# Set VLAN on port group
esxcli network vswitch standard portgroup set -p "VLAN10" --vlan-id 10
6. Resource Management
CPU and Memory Allocation
powercli
1234# PowerCLI CPU/Memory Reservation Set-VMHost -VMHost esxi01.domain.com -NumCPU 16 -CpuReservationMhz 8000 Set-VMHost -MemoryReservationGB 32
7. Host Management and Monitoring
System Logs
Bash
1234567# View system logs
cat /var/log/vmkernel.log
cat /var/log/hostd.log
# Log rotation management
esxcli system syslog config logger set --id=hostd --rotate=10 --size=2048
Performance Monitoring
Bash
123# Top-like performance view
esxtop
8. Backup and Snapshot Operations
Snapshot Management
Bash
123456# Create snapshot
vim-cmd vmsvc/snapshot.create [VMID] "SnapshotName" "Description"
# Revert to snapshot
vim-cmd vmsvc/snapshot.revert [VMID] [SnapshotID]
9. vCenter Integration
Adding Host to vCenter
- vCenter Web UI > Hosts and Clusters
- Actions > Add Host
- Enter host credentials
- Assign license
- Select storage and networking
10. Security Configuration
Firewall Management
Bash
123456# List firewall rules
esxcli network firewall ruleset list
# Enable/Disable specific ruleset
esxcli network firewall ruleset set --ruleset-id=sshServer --enabled=true
SSH Access
Bash
123# Enable/Disable SSH
esxcli system services ssh set --enabled=true
11. Performance Optimization
Best Practices
- Use latest ESXi build
- Enable HyperThreading
- Proper NUMA alignment
- Use SSD for caching
- Balanced resource allocation
12. Troubleshooting
Common Diagnostic Commands
Bash
123456789# Check hardware status
esxcli hardware health summary get
# Network connectivity
vmkping 192.168.1.1
# Check system time sync
ntpq -p
13. PowerCLI Automation
Sample Scripts
powercli
123456# Get all VMs with snapshots Get-VM | Get-Snapshot # Perform bulk VM actions Get-Cluster "Production" | Get-VM | Restart-VM -Confirm:$false
14. Production Environment Best Practices
- Standardize host configurations
- Implement change management
- Regular patch management
- Monitor resource utilization
- Implement robust backup strategy
- Use host profiles
- Enable logging and alerting
- Regular security audits
Disclaimer: Always test commands in a staging environment before production implementation.
Continue Learning
Discover more cheatsheets to boost your productivity