计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
esxi【效率与协作】Manage VMware ESXi hosts and virtual machines via SSH and vim-cmd. Use when interacting with ESXi infrastructure for VM operations (list, start, stop, snapshot), host monitoring, resource checking, or troubleshooting ESXi servers.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Interact with VMware ESXi hypervisors using native tools (vim-cmd, esxcli) over SSH. This skill provides workflows for VM lifecycle management, host monitoring, and common ESXi operations.
| Variable | Default | Description |
|---|---|---|
ESXI_USER | root | SSH username for ESXi host |
Override example:
ESXI_USER=admin ./vm-control.sh esxi-host list
List all VMs:
ssh root@esxi-host "vim-cmd vmsvc/getallvms"
Get VM power state:
ssh root@esxi-host "vim-cmd vmsvc/power.getstate <vmid>"
Power operations:
# Start VM
ssh root@esxi-host "vim-cmd vmsvc/power.on <vmid>"
# Stop VM (graceful shutdown)
ssh root@esxi-host "vim-cmd vmsvc/power.shutdown <vmid>"
# Force power off
ssh root@esxi-host "vim-cmd vmsvc/power.off <vmid>"
# Reboot VM
ssh root@esxi-host "vim-cmd vmsvc/power.reboot <vmid>"
List snapshots:
ssh root@esxi-host "vim-cmd vmsvc/snapshot.get <vmid>"
Create snapshot:
ssh root@esxi-host "vim-cmd vmsvc/snapshot.create <vmid> <snapshot-name>"
Revert to snapshot:
ssh root@esxi-host "vim-cmd vmsvc/snapshot.revert <vmid> <snapshot-id>"
Remove snapshot:
ssh root@esxi-host "vim-cmd vmsvc/snapshot.remove <vmid> <snapshot-id>"
System info:
ssh root@esxi-host "esxcli system version get"
ssh root@esxi-host "esxcli system hostname get"
Uptime and health:
ssh root@esxi-host "uptime"
ssh root@esxi-host "esxcli hardware platform get"
Storage info:
ssh root@esxi-host "esxcli storage filesystem list"
ssh root@esxi-host "esxcli storage core device list"
Network info:
ssh root@esxi-host "esxcli network ip interface ipv4 get"
ssh root@esxi-host "esxcli network vswitch standard list"
CPU/Memory usage:
ssh root@esxi-host "esxcli hardware memory get"
ssh root@esxi-host "esxtop -b -n 1 | head"
Running processes:
ssh root@esxi-host "esxcli system process list"
Create new VMs using vm-create.sh which builds VMX files directly and registers them with vim-cmd solo/registervm.
# Basic VM (1 CPU, 1GB RAM, 16GB disk)
./vm-create.sh esxi-host myvm "datastore1"
# Custom specs (2 CPUs, 4GB RAM, 50GB disk, Rocky Linux)
./vm-create.sh esxi-host myvm "datastore1" 2 4096 50 rockylinux-64 "VM Network" "[datastore1] ISOs/rocky.iso"
The script creates VMs by:
vmkfstoolsvim-cmd solo/registervmFormat varies by ESXi version. Common values:
rockylinux-64 - Rocky Linux 8/9 (ESXi 7.0+)rhel9-64 - RHEL 9centos8-64 - CentOS 8ubuntu-64 - UbuntuotherLinux64Guest - Generic Linux (universal fallback)Note: ESXi 8.x may show rockylinux_64Guest in some docs but accepts rockylinux-64.
./vm-control.sh esxi-host list./vm-control.sh esxi-host start <vmid>If SSH connections fail with permission denied or password prompts, the ESXi host may need the SSH public key configured.
On the ESXi host, add the public key:
esxcli system ssh key add -u <username> -k "<public-key-contents>"
On the local client, ensure ~/.ssh/config includes a Host entry that matches your connection string:
Host esxi-host
HostName <esxi-ip-or-hostname>
User <username>
IdentityFile ~/.ssh/id_rsa
Note: SSH config Host entries are matched literally. If you connect with the short hostname, your config must use the short hostname. If you use the FQDN, your config must match the FQDN.
vm-control.sh - Wrapper for common VM operations (supports ESXI_USER env var)vm-create.sh - Create new VMs with proper PCI bridge config (supports ESXI_USER env var)host-info.sh - Gather host statistics and health (supports ESXI_USER env var)