vmware CLI学习
情境:
今天在虚拟机关机的情况下进行虚拟机快照的删除,控制台页面进度进行到99%后卡主不动
解决过程 :
1、SSH登录到ESXI主机,后台查看任务列表
vim-cmd vimsvc/task_list
输出显示任务如下:
(ManagedObjectReference) [
'vim.Task:haTask-1-vim.vm.Snapshot.remove-165968846'
]
2、查看任务详情
vim-cmd vimsvc/task_info haTask-1-vim.vm.Snapshot.remove-165968846
输出显示如下:
(vim.TaskInfo) {
dynamicType = <unset>,
key = "haTask-9-vim.VirtualMachine.removeAllSnapshots-304060994",
task = 'vim.Task:haTask-9-vim.VirtualMachine.removeAllSnapshots-304060994',
description = (vmodl.LocalizableMessage) null,
name = "vim.VirtualMachine.removeAllSnapshots",
descriptionId = "VirtualMachine.removeAllSnapshots",<--运行过程>
entity = 'vim.VirtualMachine:9', <---VIM ID>
entityName = "SvC5sql01",<---虚拟机名称>
state = "running",<---确保状态是正在运行而不是错误状态>
cancelled = false,
cancelable = false,
error = (vmodl.MethodFault) null,
result = <unset>,
progress = 33,<---任务进度>
reason = (vim.TaskReasonUser) {
dynamicType = <unset>,
userName = "root",
},
queueTime = "2013-10-02T07:22:02.224526Z",
startTime = "2013-10-02T07:22:02.225526Z",
completeTime = <unset>,
eventChainId = 304060994,
changeTag = <unset>,
parentTaskKey = <unset>,
rootTaskKey = <unset>,
}