Powering on a virtual machine fails with the error: Failed to initialize swap file '/Datastorepath/swapfilename.vswp' : reason
search cancel

Powering on a virtual machine fails with the error: Failed to initialize swap file '/Datastorepath/swapfilename.vswp' : reason

book

Article ID: 311332

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
  • Cannot power on a virtual machine
  • Powering on a virtual machine fails
  • You see the error:

    Failed to power on VM
    Could not power on VM : <REASON>.
    Failed to initialize swap file '/Datastorepath/swapfilename.vswp' : Reason
    WARNING: Swap: vm 6023: 4431: Swap initialization failed Busy
    WARNING: NFSLock: 2128: disk is being locked by other consumer\
    WARNING: Swap: vm 6024: 2431: Failed to open swap file '/volumes/76786d15-634ca363/vmware/vmware.vswp': Busy


    Where Reason can be:
    • Lock was not free
    • Invalid metadata
    • Not found
    • Busy
    • IO was halted
    • Permission denied
    • No connection
    • Not supported


Environment

VMware ESXi 4.0.x Embedded
VMware ESX 4.0.x
VMware ESX 4.1.x
VMware vSphere ESXi 5.0
VMware ESXi 4.1.x Embedded
VMware ESXi 4.0.x Installable
VMware ESXi 4.1.x Installable

Resolution

Lock was not free

To prevent concurrent changes to critical virtual machine files, ESX hosts establish exclusive locks on these files when the virtual machine is powered on. In some cases, these virtual machine files remain locked even when the virtual machine is powered off. These files cannot be accessed by other ESX hosts while locked and the virtual machine fails to to power-on on those hosts.

To resolve this issue, see Investigating virtual machine file locks in ESX/ESXi (10051).

Invalid metadata

A virtual machine fails to power on with this error if the metadata region of the VMFS datastore used for the heartbeat protocol is incorrect for some reason.
 
To workaround this issue, configure the ESX host to create the swap file on another datastore. For more information, see Storing a virtual machine swap file in a location other than the default (1004082).
 
To resolve the VMFS metadata issue, open a support request with VMware Support. For more information, see Filing a Support Request in Customer Connect (2006985) or How to Submit a Support Request.

No Connection

This error is reported if the ESX host loses access to the datastore on which the swap file is created. The most common reasons are intermittent SAN and network issues, such as unreachable storage or high latencies.
 
To resolve this issue, ensure that there are no issues with the storage or network in your environment.

For related information, see:

Permission Denied

This error is usually seen while powering on virtual machines located on NFS datastores. This issue may occur due to permissions issues on the NFS datastore.

To resolve this issue, ensure that the host has the correct read/write permissions to access the NFS export.
If your storage array has the No Root Squash option, ensure that the option is enabled or contact your Storage Administrator.
 
Notes:


Additional Information

Troubleshooting fibre channel storage connectivity
Troubleshooting iSCSI LUN connectivity issues on ESX/ESXi hosts
Troubleshooting ESXi/ESX connectivity to iSCSI arrays using software initiators
Troubleshooting LUN connectivity issues on ESXi/ESX hosts
Troubleshooting connectivity issues to an NFS datastore on ESX and ESXi hosts
Storing a virtual machine swap file in a location other than the default in ESX/ESXi
Investigating virtual machine file locks on ESXi
Using ESXi Shell in ESXi 5.x and 6.x
How to file a Support Request in Customer Connect
仮想マシンをパワーオンすると、次のエラーで失敗する:スワップ ファイル「/Datastorepath/swapfilename.vswp」の初期化に失敗しました:理由
打开虚拟机电源失败并出现错误:无法初始化交换文件“/Datastorepath/swapfilename.vswp”: 原因