给vc做快照过程中vc卡死

问题:vc做快照的过程中卡死,无法登陆。重启vc,结果报有任务在运行,无法重启或关机。打算结束正在运行的做快照的任务。

 

1、ssh登陆到VC所在ESXI主机

2、查看vc的Vmid

[root@esxi01:~]vim-cmd vmsvc/getallvms

结果输出:

Vmid Name File Guest OS Version Annotation
3 VMware vCenter Server-192.1.1.230 [datastore1-1.1] VMware vCenter Server/VMware vCenter Server.vmx other3xLinux64Guest vmx-10 VMware vCenter Server Appliance

3、查看vc的任务

[root@esxi01:~]vim-cmd vmsvc/get.tasklist 3

结果输出:

(ManagedObjectReference) [
'vim.Task:haTask-3-vim.VirtualMachine.powerOff-111003585',
'vim.Task:haTask-3-vim.VirtualMachine.powerOff-111003454',
'vim.Task:haTask-3-vim.VirtualMachine.createSnapshot-111002937'
]

4、查看任务信息

[root@esxi01:~]vim-cmd vimsvc/task_info haTask-3-vim.VirtualMachine.createSnapshot-111002937

结果输出:

(vim.TaskInfo) {
key = "haTask-3-vim.VirtualMachine.createSnapshot-111002937",
task = 'vim.Task:haTask-3-vim.VirtualMachine.createSnapshot-111002937',
description = (vmodl.LocalizableMessage) null,
name = "vim.VirtualMachine.createSnapshot",
descriptionId = "VirtualMachine.createSnapshot",
entity = 'vim.VirtualMachine:3',
entityName = "VMware vCenter Server-172.1.91.230",
locked = <unset>,
state = "running",
cancelled = false,
cancelable = true,
error = (vmodl.MethodFault) null,
result = <unset>,
progress = 63,
reason = (vim.TaskReasonUser) {
userName = "vpxuser"
},
queueTime = "2024-04-19T05:03:45.659354Z",
startTime = "2024-04-19T05:03:45.66047Z",
completeTime = <unset>,
eventChainId = 111002937,
changeTag = <unset>,
parentTaskKey = <unset>,
rootTaskKey = <unset>,
activationId = <unset>
}

其中canalable:true表示任务可以取消

5、取消vc的快照任务

[root@esxi01:~]vim-cmd vimsvc/task_cancel haTask-3-vim.VirtualMachine.createSnapshot-111002937

执行完成后vcenter页面立马可以打开了

 
 

 

posted @ 2024-04-22 10:26  正在努力的BOY  阅读(34)  评论(0编辑  收藏  举报