故障
导出虚拟机时,网络错误
解决方案
ovftool.exe vi://root@172.30.1.201/centos-3 d:\vm\
但是
如果使用上面的命令一直卡在
百分比
这里不动,就说明有不被支持设备没有被移除,一般情况是CDROM
但是的但是
如果你使用命令行执行了任务后,结果任务一直卡在
百分比
那里,一般人的做法就是Ctrl+C
,这个时候就会出现,命令行看似已经终止了,但是ESXI中的任务列表中一直会卡住不动,又一次懵B,ESXI管理页面根本没有终止正在执行的任务方法
解决方案-ESXI命令行
列出所以虚拟机
[root@localhost:~] vim-cmd vmsvc/getallvms
Vmid Name File Guest OS Version Annotation
1 centos-3 [datastore1 (3)] centos-3/centos-3.vmx centos7_64Guest vmx-14
2 xxxxxxxxx [datastore1 (3)] win7/win7.vmx windows7_64Guest vmx-14
3 centos-201 [datastore1 (3)] centos-201/centos-201.vmx centos7_64Guest vmx-14
查看某个虚拟机的状态
[root@localhost:~] vim-cmd vmsvc/power.getstate 1
Retrieved runtime info
Powered off
查看正在执行的任务
[root@localhost:~] vim-cmd vimsvc/task_list
(ManagedObjectReference) [
'vim.Task:haTask-1-vim.VirtualMachine.exportVm-1020710519',
'vim.Task:haTask-5-vim.VirtualMachine.exportVm-1019909662',
'vim.Task:haTask-5-vim.VirtualMachine.exportVm-1019909678',
'vim.Task:haTask-1-vim.VirtualMachine.powerOn-1020712293'
]
查看某一个任务的状态
[root@localhost:~] vim-cmd vimsvc/task_info haTask-1-vim.VirtualMachine.exportVm-1020710519
(vim.TaskInfo) {
key = "haTask-1-vim.VirtualMachine.exportVm-1020710519",
task = 'vim.Task:haTask-1-vim.VirtualMachine.exportVm-1020710519',
description = (vmodl.LocalizableMessage) null,
name = "vim.VirtualMachine.exportVm",
descriptionId = "VirtualMachine.exportVm",
entity = 'vim.VirtualMachine:1',
entityName = "centos-3",
locked = <unset>,
state = "running", #还处于正在运行状态
cancelled = false,
cancelable = true,
error = (vmodl.MethodFault) null,
result = <unset>,
progress = 10,
reason = (vim.TaskReasonUser) {
userName = "root"
},
queueTime = "2021-11-29T16:33:29.512321Z",
startTime = "2021-11-29T16:33:29.512468Z",
completeTime = <unset>,
eventChainId = 1020710519,
changeTag = <unset>,
parentTaskKey = <unset>,
rootTaskKey = <unset>,
activationId = <unset>
}
终止某一项任务
[root@localhost:~] vim-cmd vimsvc/task_cancel haTask-1-vim.VirtualMachine.exportVm-1020710519
再次查看任务列表
[root@localhost:~] vim-cmd vimsvc/task_list
(ManagedObjectReference) [
'vim.Task:haTask-5-vim.VirtualMachine.exportVm-1019909662',
'vim.Task:haTask-5-vim.VirtualMachine.exportVm-1019909678',
'vim.Task:haTask-1-vim.VirtualMachine.exportVm-1020710519'
]
vim-cmd 帮助
[root@localhost:~] vim-cmd help
Commands available under /:
hbrsvc/ internalsvc/ solo/ vmsvc/
hostsvc/ proxysvc/ vimsvc/ help