A running virtual machine tries to create lock files to prevent consistency problems on virtual disks. If the virtual machine did not use locks, multiple virtual machines might read and write to the disk, causing users to lose data.
Lock files are always created in the same directory as the .vmdk or .pln file. There are two types of lock files: reader and writer. A disk in nonpersistent mode is protected by reader lock files, while disks in persistent and undoable modes use writer lock files. A disk protected by a writer lock file can be accessed by only one virtual machine. A disk that has reader lock files can be read by more than one virtual machine but cannot be written to. The extents of a plain disk are individually locked, using the same method.
A virtual machine removes lock files it created when the virtual machine is powered off. If it cannot remove the lock, a stale lock file is left protecting the .vmdk or .pln file. For example, if the machine crashes before the virtual machine has a chance to remove its lock file, there a stale lock remains.
If a stale lock file remains when the virtual machine is started again, the virtual machine tries to remove the stale lock. To make sure that no virtual machine could be using the lock file, the virtual machine checks the lock file to see if:
If these two conditions are true, the virtual machine can safely remove the stale lock. If either of those conditions are not true, a dialog box appears, explaining what you can do about the lock.
Raw disk partitions are also protected by locks. However, if the host operating system is installed on the same raw disk that the virtual machine is using, the locks are ignored. VMware strongly recommends that the raw disk for the virtual machine not be installed on the same raw disk as the host operating system for this reason.
© 2001-2002 VMware, Inc. All rights reserved.