在创建或删除快照时虚拟机电源关闭,并出现以下错误:无法锁定文件
search cancel

在创建或删除快照时虚拟机电源关闭,并出现以下错误:无法锁定文件

book

Article ID: 341063

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
免责声明:本文为 Virtual machine powers off while creating or deleting snapshots with the error: Failed to lock the file (1033571) 的翻译版本。尽管我们会不断努力为本文提供最佳翻译版本,但本地化的内容可能会过时。有关最新内容,请参见英文版本。


在创建或删除快照操作期间,虚拟机电源突然关闭并出现以下症状:

  • 创建或删除快照任务失败。
  • 虚拟机电源关闭并出现以下错误:

    Cannot open the disk '/vmfs/volumes/UUID/VMName/VMName-000001.vmdk' or one of the snapshot disks it depends on.Reason: Failed to lock the file.

  • 虚拟机的 vmware.log 文件包含类似以下内容的消息:

    vmx| [msg.disk.configureDiskError] Reason: Failed to lock the file.----------------------------------------
    vmx| Msg_Post: Error
    vmx| [msg.checkpoint.continuesync.fail] Error encountered while restarting virtual machine after taking snapshot.The virtual machine will be powered off.


  • hostd.log 文件包含类似以下内容的消息:

    info 'ha-eventmgr'] Event 78390 : Message on VMNAME on ESXHOSTNAME in ha-datacenter: Cannot open the disk '/vmfs/volumes/UUID/VMName/VMName-000001.vmdk' or one of the snapshot disks it depends on.Reason: Failed to lock the file.

  • 当出现损坏的描述符文件时,您可能会看到类似以下内容的错误:

    10T04:40:30.093Z| vcpu-0| DISK: Cannot open disk "/vmfs/volumes/4a96b658-f4566303-6459-0024e86324cf/<vm-name>/<vm-name>-000003.vmdk": The capacity of the parent virtual disk and the capacity of the child disk are different (67).
    10T04:40:30.093Z| vcpu-0| Msg_Post: Error
    10T04:40:30.093Z| vcpu-0| [msg.disk.noBackEnd] Cannot open the disk '/vmfs/volumes/4a96b658-f4566303-6459-0024e86324cf/<vm-name>/<vm-name>-000003.vmdk' or one of the snapshot disks it depends on.
    10T04:40:30.093Z| vcpu-0| [msg.disk.configureDiskError] Reason: The capacity of the parent virtual disk and the capacity of the child disk are different.
    10T04:40:30.093Z| vcpu-0| ----------------------------------------
    10T04:40:30.102Z| vcpu-0| CPT current = 6, requesting 0
    10T04:40:30.109Z| vcpu-0| Msg_Post: Error
    10T04:40:30.109Z| vcpu-0| [msg.checkpoint.continuesync.fail] An error occurred while restarting virtual machine after taking a snapshot.The virtual machine will be powered off.


Environment

VMware ESXi 4.1.x Embedded
VMware ESXi 4.1.x Installable
VMware vSphere ESXi 5.5
VMware ESX 4.0.x
VMware ESXi 4.0.x Embedded
VMware ESX 4.1.x
VMware ESXi 4.0.x Installable
VMware ESX Server 3.5.x
VMware ESX Server 3.0.x
VMware ESXi 3.5.x Installable
VMware vSphere ESXi 5.0
VMware vSphere ESXi 5.1
VMware ESXi 3.5.x Embedded

Cause

当虚拟机所需的文件之一已经由其他应用程序打开时,会发生此问题。

在虚拟机运行时执行创建或删除快照操作期间,所有的磁盘文件都会短暂性地关闭然后重新打开。在此期间,这些文件可以由另一虚拟机、管理进程或第三方实用程序打开。如果该应用程序创建并维护所需磁盘文件的锁,则虚拟机就不能重新打开文件并恢复运行。

Resolution

如果文件不再锁定,请再次尝试打开虚拟机的电源。这次会成功。要确定以前文件锁定的原因,请查看 VMkernel、hostdvpxa 日志文件,然后尝试确定以下内容:
  • hostdvpxa 管理代理打开 VMDK 描述符文件时,会记录类似以下内容的消息:

    info 'DiskLib'] DISKLIB-VMFS : "/vmfs/volumes/UUID/VMName/VMName-000001.vmdk" : open successful (21) size = 32227695616, hd = 0. Type 8
    info 'DiskLib'] DISKLIB-VMFS : "/vmfs/volumes/UUID/VMName/VMName-000001.vmdk" : closed.


  • 当 VMkernel 尝试打开锁定文件时,将报告以下内容:

    31:16:46:55.498 cpu7:8715)FS3: 2928: [Requested mode: 2] Lock [type 10c00001 offset 11401216 v 2035, hb offset 3178496
    gen 26643, mode 1, owner 4ca72d14-84dc8dd4-0da3-0017a4770038 mtime 2213195] is not free on volume 'norr_prod_vmfs_data08'

  • 该文件可能已经由在 ESXi/ESX 主机上或者外部运行的第三方软件锁定。查看在那时对虚拟机的 VMDK 文件进行操作的第三方软件的日志。
如果由于文件仍处于锁定状态而不能再次打开虚拟机的电源,或者为了确定哪个 ESX 主机之前持有该锁,请参见 Investigating virtual machine file locks on ESX/ESXi (10051)

有关要尝试的其他步骤,请参见 Unable to delete the virtual machine snapshot due to locked files (2017072)

Additional Information

Virtual machine powers off while creating or deleting snapshots with the error: Failed to lock the file