Loading

×Sorry to interrupt
CSS Error

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

Skip to main content

My Subscriptions

Loading

Knowledge Base

Cannot deploy a virtual machine from a template because the template VMDK file is locked (1007487)

Last Updated: 10/7/2020Categories: TroubleshootingTotal Views: 7491Language:
Chinese (Simplified)JapaneseEnglish

1 like this article

Subscribe to get an email
newsletter with new updates

1 people found this helpful Please provide article feedback:

Symptoms

Cannot deploy a virtual machine from a template

The template's <vm name>-flat.vmdk or <vm name>.vmdk file is locked by a running virtual machine

The VMDK file is not found

When deploying a template the option to Edit virtual Hardware (Experimental) is selected and the disk size has been modified

Resolution

A virtual machine deployed from a template locks the template's VMDK files if it is incorrectly configured to run on the template's virtual disk and VMDK file instead of its own. The lock prevents other virtual machines from being deployed from the template.

You must determine if the template's VMDK file is locked by another virtual machine, and if so, release the lock on the files.

Caution: Since a virtual machine was running on the template's disk, there may have been unwanted changes to the disk. As such, a good backup and recovery plan is essential to production environments.

To determine if the template's VMDK file is locked by another virtual machine:

Login as root to the ESXi host

Change to the working directory of the template

Run the command:
vmkfstools -D <virtual disk file> | tail -f /var/log/vmkernel.log | grep -i owner

If there are (non-zero) numbers and letters near the end of the output, a MAC address has been associated with this VMDK and another virtual machine has a lock on this file. If there are zeros at the end of the output, the VMDK file is not locked by another virtual machine.

To release the lock on the template's VMDK file:

To show which virtual machine on a single host has the lock, run the command:

grep -lr <virtual disk file> /vmfs/volumes/*/*/*.vmx

Note: Record the full path to the virtual disk file. If this fails because of locked files try one of the methods below. This may be the case if the virtual machine disks are on storage shared between multiple hosts:

Alternate methods:

grep vmx /etc/vmware/hostd/vmInventory.xml | sed -e 's/>/</g' | awk -F\< '{print $3}' > vmx;
IFS=$(echo -en "\n\b"); for i in `cat vmx`; do echo grep -H vmdk $i; done

Connect-VIServer -server localhost
Get-Vm | Get-Harddisk | Where {$_.Filename -match "<diskname>"} or Get-Vm | % { if ((Get-Harddisk -VM $_).Filename -match "<diskname file>") {$_ }}

Power off the virtual machine that has the lock. If you cannot power off the virtual machine, seePowering off an unresponsive virtual machine on an ESX host (1004340).

Edit the virtual machine's settings and remove the virtual disk, but do not delete it.

To connect an existing disk:

In the Add Hardware Wizard, click Hard Disk > Next.

Select the type of storage for the virtual machine’s disk.

Click Next > Use an existing virtual disk.

Browse to the path of the virtual disk file identified in Step 1.

Click Next. --> Finish

Related Information

テンプレートの VMDK ファイルがロックされているためにテンプレートから仮想マシンをデプロイできない
由于模板 VMDK 文件被锁定，无法从模板部署虚拟机

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
Chinese (Simplified)JapaneseEnglish

Attachments

Additional Resources

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

KB
•
Download and Install VMware Fusion (2014097)

KB
•
Usage Meter が vCenter Server の登録後に vROps を検出できない (58549)

Results 1-3 of 3

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware vSphere ESXi

VMware VirtualCenter

VMware vCenter Server

Related Versions:

Take Our Survey

Was this article helpful?

YES

NO

Copyright © 2005-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.

Terms of Use

Your California Privacy Rights

Privacy

Accessibility

Cookie Settings

Support Assistant