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

Products and Accounts

Support

Knowledge

Communities

Success

Learning

My Subscriptions

Loading

Knowledge Base

Determining if a virtual disk is attached to another virtual machine (1003656)

Last Updated: 2/14/2016Categories: TroubleshootingTotal Views: 46378Language:
Chinese (Simplified)JapaneseEnglish

3 like this article

Subscribe to get an email
newsletter with new updates

3 people found this helpful Please provide article feedback:

Symptoms

You cannot power on a virtual machine

You see the error:

Unable to access a file since it is locked.

Purpose

This article provides steps to determine if a virtual disk is attached to another virtual machine.

Resolution

To determine if a virtual disk is attached to another virtual machine:

Log in to the ESX server console.

Run this command to see if the file is referenced in any other .vmx file:

grep -i diskname /vmfs/volumes/*/*/*.vmx

Here is a sample command and its output:

grep -i virtualdisk.vmdk /vmfs/volumes/*/*/*.vmx

/vmfs/volumes/xxxxxxxx-xxxxxxxx-xxxx-xxxxxxxxxxxx/VM/VM.vmx:scsi0:0.fileName = "virtualdisk.vmdk"

If the output from Step 2 returns more than one match, the virtual disk is being referenced by more than one virtual machine. Remove the disk from one of the virtual machines.

If you do not know the host of the virtual machine, proceed to Step 4.

Run this command to check the VMkernel logs to see if the file is in use and to identify the owner:

vmkfstools -D diskname-flat.vmdk

Here is a sample command and the output it writes to the VMkernel log:

vmkfstools -D /vmfs/volumes/xxxxxxxx-xxxxxxxx-xxxx-xxxxxxxxxxxx/VM/virtualdisk-flat.vmdk

Aug 24 16:15:52 esxhost vmkernel: 10:20:00:22.731 cpu5:1040)FS3: 130: <START virtualdisk-flat.vmdk>
Aug 24 16:15:52 esxhost vmkernel: 10:20:00:22.731 cpu5:1040)Lock [type 10c00001 offset 48226304 v 386, hb offset 3558400
Aug 24 16:15:52 esxhost vmkernel: gen 37, mode 0, owner 00000000-00000000-0000-000000000000 mtime 221688]
Aug 24 16:15:52 esxhost vmkernel: 10:20:00:22.731 cpu5:1040)Addr <4, 96, 156>, gen 336, links 1, type reg, flags 0x0, uid 0, gid 0, mode 100600
Aug 24 16:15:52 esxhost vmkernel: 10:20:00:22.731 cpu5:1040)len 12884901888, nb 6144 tbz 0, zla 3, bs 2097152
Aug 24 16:15:52 esxhost vmkernel: 10:20:00:22.731 cpu5:1040)FS3: 132: <END virtualdisk-flat.vmdk>

In this example, 00000000-00000000-0000-000000000000 indicates that the file is not in use or locked by another owner.

After the virtual machine is powered on, the output written to the VMkernel log appears similar to:

Aug 25 09:32:13 esxhost vmkernel: 11:13:16:44.102 cpu3:1041)FS3: 130: <START virtualdisk-flat.vmdk>
Aug 25 09:32:13 esxhost vmkernel: 11:13:16:44.102 cpu3:1041)Lock [type 10c00001 offset 69419008 v 436, hb offset 3200512
Aug 25 09:32:13 esxhost vmkernel: gen 40, mode 1, owner 4a84acc3-786ebaf4-aaf9-xxxxxxxxxxxx mtime 271]
Aug 25 09:32:13 esxhost vmkernel: 11:13:16:44.102 cpu3:1041)Addr <4, 153, 112>, gen 379, links 1, type reg, flags 0x0, uid 0, gid 0, mode 100600
Aug 25 09:32:13 esxhost vmkernel: 11:13:16:44.102 cpu3:1041)len 8388608, nb 8 tbz 0, zla 1, bs 1048576
Aug 25 09:32:13 esxhost vmkernel: 11:13:16:44.102 cpu3:1041)FS3: 132: <END virtualdisk-flat.vmdk>

The owner is 4a84acc3-786ebaf4-aaf9-001a6465b7b0. The part highlighted in red is the MAC address of vmnic0 from the host that has the lock.

Run the following command to see the information about vmnic0:

ifconfig vmnic0

The output appears similar to:

vmnic0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:296556076 errors:0 dropped:0 overruns:0 frame:0
TX packets:190731002 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2165627030 (2065.3 Mb) TX bytes:699435263 (667.0 Mb)
Interrupt:113 Memory:ce000000-ce012100

The HWaddr (MAC) of vmnic0 matches the last grouping of the owner (from the VMkernel logs). This host owns the lock on the file.

Note: This example assumes that the Service Console of the ESX host is using vmnic0.

Related Information

仮想ディスクが別の仮想マシンに接続されているかどうかの判定
判断虚拟磁盘是否附加到其他虚拟机

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)

Result 1 of 1

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware ESX Server

Related Versions:

VMware ESX Server 3.0.x

VMware ESX 4.1.x

VMware ESX 4.0.x

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