资源描述
VMware-cmd常用命令
时间:2009-06-25 00:00来源:虚拟化百科 作者:canvin 点击: 252次
强制关闭VM虚拟机
使用vmware-cmd命令行
u 登陆服务控制台
u 键入“vmware-cmd –l”得到所有虚拟机及其路径的列表
u 键入“vmware-cmd //.vmx getstate”查看虚拟机状态
u 强制关闭“vmware-cmd //.vmx stop hard”
u 再次检查虚拟机状态,现在应该是关闭着的
u 键入“vmware-cmd //.vmx start”启动虚拟机
手动注销虚拟机,通过找到虚拟机进程标识符(pid)并使用注销命令终止它。
u 登陆服务控制台
u 键入“vmware-cmd –l”得到所有虚拟机及其路径的列表
u 键入“vmware-cmd //.vmx getstate”查看虚拟机状态
u 键入“ps –auxwww | grep –i <vm name>”
u 第二栏显示虚拟机vmkload_app的进程标识符pid
u 键入“kill -9 PID”
u 重新查看虚拟机状态,现在应该是关着的
u 键入“vmware-cmd //.vmx start”启动虚拟机
注册虚拟机
u /usr/bin/vmware-cmd -s register <config_file_path>
取消注册
u /usr/bin/vmware-cmd -s unregister <config_file_path>
重启VM虚拟机
u /usr/bin/vmware-cmd <cfg> reset <powerop_mode>
挂起虚拟机
u /usr/bin/vmware-cmd <cfg> suspend <powerop_mode>
创建虚拟机快照
u /usr/bin/vmware-cmd <cfg> createsnapshot <name> <description> <quiesce> <memory>
恢复虚拟机快照
u /usr/bin/vmware-cmd <cfg> revertsnapshot
删除虚拟机快照
u /usr/bin/vmware-cmd <cfg> removesnapshots
VMware-cmd命令行
Usage: /usr/bin/vmware-cmd <options> <vm-cfg-path> <vm-action> <arguments>
/usr/bin/vmware-cmd -s <options> <server-action> <arguments>
Options:
Connection Options:
-H <host> specifies an alternative host (if set, -U and -P must also be set)
-O <port> specifies an alternative port
-U <username> specifies a user
-P <password> specifies a password
General Options:
-h More detailed help.
-q Quiet. Minimal output
-v Verbose.
Server Operations:
/usr/bin/vmware-cmd -l
– lists the registered VMs
/usr/bin/vmware-cmd -s register <config_file_path>
– registers a VM
/usr/bin/vmware-cmd -s unregister <config_file_path>
– unregisters a VM
/usr/bin/vmware-cmd -s getresource <variable>
– retrieves a server resource
/usr/bin/vmware-cmd -s setresource <variable> <value>
– sets a server resource
VM Operations:
/usr/bin/vmware-cmd <cfg> getconnectedusers
/usr/bin/vmware-cmd <cfg> getstate
– gets the execution state of the VM
/usr/bin/vmware-cmd <cfg> start <powerop_mode>
– powers on or resumes a VM
/usr/bin/vmware-cmd <cfg> stop <powerop_mode>
– stops a VM
/usr/bin/vmware-cmd <cfg> reset <powerop_mode>
– resets a VM
/usr/bin/vmware-cmd <cfg> suspend <powerop_mode>
– suspends a VM
/usr/bin/vmware-cmd <cfg> setconfig <variable> <value>
– sets a configuration variable
/usr/bin/vmware-cmd <cfg> getconfig <variable>
– retrieves the value for a configuration variable
/usr/bin/vmware-cmd <cfg> setguestinfo <variable> <value>
– sets a guest info variable
/usr/bin/vmware-cmd <cfg> getguestinfo <variable>
– retrieves the value for a guest info variable
/usr/bin/vmware-cmd <cfg> getproductinfo <prodinfo>
– gets various product information
/usr/bin/vmware-cmd <cfg> connectdevice <device_name>
– connects a virtual device to a VM
/usr/bin/vmware-cmd <cfg> disconnectdevice <device_name>
– disconnects a virtual device from a VM
/usr/bin/vmware-cmd <cfg> getconfigfile
– retrieves the path to the configuration file
/usr/bin/vmware-cmd <cfg> getheartbeat
– retrieves the heartbeat value of the guest OS
/usr/bin/vmware-cmd <cfg> gettoolslastactive
– retrieves the number of seconds since last notification from the tools
/usr/bin/vmware-cmd <cfg> getresource <variable>
– retrieves a VM resource
/usr/bin/vmware-cmd <cfg> setresource <variable> <value>
– sets a VM resource
/usr/bin/vmware-cmd <cfg> hassnapshot
– determine if a VM has a snapshot
/usr/bin/vmware-cmd <cfg> createsnapshot <name> <description> <quiesce> <memory>
– creates a snapshot of a VM
/usr/bin/vmware-cmd <cfg> revertsnapshot
– revert to the last snapshot of a VM
/usr/bin/vmware-cmd <cfg> removesnapshots
– remove all snapshots of a VM
/usr/bin/vmware-cmd <cfg> answer
– answers a question for a VM requesting input
展开阅读全文