列出当前注册到ESXi主机的虚拟机列表:
#vmware-cmd �Cserver vcenter_ip_address �Cvihostesxi_ip_address
将虚拟机从esxi主机unregister(vCLI):
#vmware-cmd �Csersxi_ip_address unregister /vmfs/volumes/xxx/vm/x.vmx datacenter_nameresource_pool_name
将虚拟机register到ESXi主机(vCLI):
#vmware-nter_ip_address �Cvihostesxi_ip_address register /vmfs/volumes/xxx/vm/x.vmx datacenter_nameresource_pool_name
查看虚拟机操作系统平台类型:
#vmware-cmd �Cserver vcenter_ip_address �Cvihostesxi_ip_address /vmfs/volumes/xxx/vm/x.vmx getproductinfo product
Power On虚拟机:
#vmware-cmd �Cserver vcenter_ip_address �Cvihostess/xxx/vm/x.vmx start [soft|hard]
Power Off虚拟机:
#vmware-cmd �Cserver vcenter_ip_address �Cvihostesxi_ip_address /vmfs/volumes/xxx/vm/x.vmx stop [soft|hard]
Reset虚拟机:
#vmware-cmd �Cserver vcenter_ip_address �Cvihostesxi_ip_address /vmfs/v
Suspend虚拟机:
#vmware-cmd �Cserver vcenter_ip_address �Cvihostesxi_ip_address /vmfs/volumes/xxx/vm/x.vmx suspend [soft|hard]
Resum虚拟机:
#vmware-cmd �Cserver vcenter_ip_address �Cvihostesxi_ip_address /vmfs/volx.vmx resume
查看虚拟机的开机时间:
#vmware-cmd �Cserver vcenter_ip_address �Cvihostesxi_ip_address /vmfs/volumes/xxx/vm/x.vmx getuptime
备注:这个命令需要安装了VMware Tools且仅限于vCLI;
查看虚拟机
ip_address �Cvihostesxi_ip_address /vmfs/volumes/xxx/vm/x.vmx gettoolsIsactive
o 0 =没安装或没运行
o 1=正常状态
o 5=intermittent heartbeat
o 10=无心跳
为虚拟机创建快照(vCLI):
#vmwaress �Cvihostesxi_ip_address /vmfs/volumes/xxx/vm/x.vmx createsnapshot snapshot_namedescription_information 0 0
检查虚拟机是否有快照(vCLI):
#vmware-cmd �Cserver vcenter_ip_address �Cvihost esxi_ip_address/vmfs/volumes/xxx/vm/x.vmx hassnapshot
o 0=有快照
o 1=无快照
恢复虚拟机快照:
#vmware-cmd �Cserver vcenter_ip_address �Cvihostesxi_ip_address /vmfs/volumes/xxx/vm/x.vmx revertsnapshot
删除虚拟机快照:
#vmware-cmd �Cserver vcenter_ip_address �Cvihostesxi_ip_address /vmfs/volumes/xxx/vm/x.vmx removesnapshot
利用esxcli命令强行终止虚拟机:
#esxcli <conn_options> vm process list
#esxcli <conn_options> vm process kill