• No results found

Additional Information about Disk, Redo-Log, Snapshot, and Lock Files

This section provides information about virtual machine files.

Disk Files

The virtual machine settings editor (VM > Settings) lets you choose the disk files for a  virtual machine. 

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  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 Microsoft Windows hosts, each virtual disk is contained in one file by default. You  can optionally 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 lets you 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 lets you 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 might also be smaller than 2GB.

If you chose not to 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  assigned 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 Files

Redo‐log files are stored in the virtual machine’s working directory, and are for saving  changes to independent‐nonpersistent disks. 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. 

The redo‐log file for a virtual disk vm is named 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 named vm.vmdk.REDO, vm-02.vmdk.REDO, vm-03.vmdk.REDO and so on.

You can choose the location where the redo‐log 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 files in the virtual machine settings  editor. With the virtual machine powered off, choose VM > Settings. Click the Options  tab, select General. Under Working directory, enter the name or browse to the folder  in which the redo‐log file should be stored.

You can store 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. 

Snapshot Files

When you take a snapshot of a virtual machine named vm, VMware Server stores the  snapshot in a file named vm.vmsn. VMware Server stores snapshot information in files  named vm‐SnapshotX.vmsn and in vm‐xxxxxx.vmdk. For more information about  snapshots, see “Taking Snapshots” on page 112.

You can choose the location where the snapshot files are stored. By default, the files are  stored in the same directory as the virtual disk (.vmdk) file. You can change the location  of the snapshot files in the virtual machine settings editor. With the virtual machine  powered off, choose VM > Settings. Click the Options tab, select General. Under  Working directory, enter the name or browse to the folder in which the snapshot file  should be stored.

You can store 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 VMware Server on Microsoft 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 

You can use SCSI reservation to work around the lock file so that multiple virtual  machines can access it. This is typically done in conjunction with a high‐availability  configuration, such as clustering. For more information about this, see “Using  High‐Availability Configurations” in the VMware Server Administration Guide.

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 whether

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 can 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 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.