Contents
Previous Next
Additional Information about Disk, Redo-Log, Snapshot and Lock Files
This section provides more information about various virtual machine files.
Disk Files
The virtual machine settings editor (VM > Settings) allows you to choose the disk files for a virtual machine.
You may want to choose a file other than the one created by the New Virtual Machine Wizard if you are using a virtual disk that you created in a different location or if you are moving the automatically created disk files to a new location.
The disk files for a virtual disk store the information that you write to a virtual machine's hard disk the operating system, the program files and the data files. The virtual disk files have a .vmdk extension.
A virtual disk is made up of one or more .vmdk files.
On Windows hosts, each virtual disk is contained in one file by default. You may, as an option, configure the virtual disk to use a set of files limited to 2GB per file. Use this option if you plan to move the virtual disk to a file system that does not support files larger than 2GB.
You must set this option at the time you create the virtual disk.
If you are setting up a new virtual machine, follow the custom path in the New Virtual Machine Wizard. In the screen that allows you to specify the virtual disk's capacity, select Split disk into 2GB files.
If you are adding a virtual disk to an existing virtual machine, follow the steps in the Add Hardware Wizard. In the screen that allows you to specify the virtual disk's capacity, select Split disk into 2GB files.
When a disk is split into multiple files, larger virtual disks have more .vmdk files.
The first .vmdk file for each disk is small and contains pointers to the other files that make up the virtual disk. The other .vmdk files contain data stored by your virtual machine and use a small amount of space for virtual machine overhead.
By default, all disk space is allocated when you create the virtual disk. A preallocated virtual disk has fixed file sizes, and most of the files are 2GB. As mentioned above, the first file is small. The last file in the series may also be smaller than 2GB.
If you chose to not allocate the space in advance, the .vmdk files grow as data is added, to a maximum of 2GB each except for the first file in the set, which remains small.
The virtual machine settings editor shows the name of the first file in the set the one that contains pointers to the other files in the set. The other files used for that disk are automatically given names based on the name of the first file.
For example, a Windows 2000 Server virtual machine using the default configuration, with files that grow as needed, stores the disk in files named Windows 2000 Server.vmdk, Windows 2000 Server-s001.vmdk, Windows 2000 Server-s002.vmdk and so on.
If the disk space is allocated in advance and the virtual disk is split into 2GB files, the names are similar, except that they include an f instead of an s for example, Windows 2000 Server-f001.vmdk. If the disk is not split into 2GB files, the virtual machine stores the disk in two files, named Windows 2000 Server.vmdk and Windows 2000 Server-flat.vmdk.
If you are using a physical disk, the .vmdk file stores information about the physical disk or partition used by the virtual machine.
Redo-Log and Snapshot Files
Redo-log files save blocks that the virtual machine modifies while it is running. The redo-log file for a disk in independent-nonpersistent mode is not saved when the virtual machine is powered off or reset, while the redo-log file for a disk with a snapshot is saved. This file is known as the redo log.
The redo-log file for a virtual disk called vm is called vm.vmdk.REDO. If the virtual disk is split into 2GB files, the disk files are named vm.vmdk, vm-02.vmdk, vm-03.vmdk and so on; its redo-log files are called vm.vmdk.REDO, vm-02.vmdk.REDO, vm-03.vmdk.REDO and so on.
When you take a snapshot of a virtual machine called
vm, GSX Server stores the snapshot in a file is called
vm.vmsn. For more information about snapshots, see
Taking Snapshots.
You can choose the location where the redo-log and snapshot files are stored. By default, the files are stored in the same directory as the virtual disk (.vmdk) file.
By default, redo-log files for physical disks are located in the same directory as the virtual machine configuration file (.vmx).
You can change the location of the redo-log and snapshot files in the virtual machine settings editor. With the virtual machine powered off, choose VM > Settings. Click the Options tab, select General, then under Working directory, type in or browse to the folder in which the redo log or snapshot should be stored.
You may choose to locate these files in a different directory to increase available space or improve performance. For best performance, the log files for a virtual machine should be on a local hard drive on the host computer.
Lock Files
A running virtual machine creates 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 data corruption.
Lock files are always created in the same directory as the .vmdk file.
The locking methods used by GSX Server on Windows and Linux hosts are different, so files shared between them are not fully protected. If you use a common file repository that provides files to users on both Windows and Linux hosts, be sure that each virtual machine is run by only one user at a time.
There is a way to work around the lock file so that multiple virtual machines can access it by using SCSI reservation. This is typically done in conjunction with a high-availability configuration, such as clustering. For more information about this, see
High-Availability Configurations with VMware GSX Server.
When a virtual machine is powered off, it removes the lock files it created. If it cannot remove the lock, a stale lock file is left protecting the .vmdk file. For example, if the host machine crashes before the virtual machine has a chance to remove its lock file, 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
1. The lock was created on the same host where the virtual machine is running.
2. The process that created the lock is not running.
If those two conditions are true, the virtual machine can safely remove the stale lock. If either of those conditions is not true, a dialog box appears, warning you that the virtual machine cannot be powered on. If you are sure it is safe to do so, you may delete the lock files manually. On Windows hosts, the filenames of the lock files end in .lck. On Linux hosts, the filenames of the lock files end in .WRITELOCK.
Physical disk partitions are also protected by locks. However, the host operating system is not aware of this locking convention and thus does not respect it. For this reason, VMware strongly recommends that the physical disk for a virtual machine not be installed on the same physical disk as the host operating system.