[an error occurred while processing this directive] VMware Workstation Disk Types and Disk Modes [an error occurred while processing this directive] [an error occurred while processing this directive]
 
VMware Workstation Disk Types and Disk Modes

VMware Workstation allows users to flexibly configure the disks used by a virtual machine. Users can choose a type and a mode for each disk. There are three types and three modes. Each type can be configured with any one of the three modes and vice versa.


Disk Types
A virtual disk is a file on the host file system that appears as a physical disk drive to a guest operating system. The file system can be on the host machine or on a remote computer. When you configure a virtual machine with a virtual disk, you can install a new operating system onto the disk file without the need to repartition a physical disk or reboot the host. Virtual disks are limited to a maximum of 2GB. The actual file used by the virtual disk starts out small and grows to the maximum size as needed.

A plain disk is like a virtual disk, but it can be larger than 2GB. It is composed of several files, called extents. Each extent is limited to 2GB in length. Unlike a virtual disk, when a plain disk is created, all the disk space defined for the extents is allocated and filled with zeros.

A raw disk directly accesses an existing local disk or partition. Raw disks can be used to allow VMware Workstation to run one or more guest operating systems from existing disk partitions. Raw disks may be set up on both IDE and SCSI devices. At this time, however, booting from an operating system already set up on an existing SCSI disk or partition is experimental.

Additional information on using raw disk partitions can be found on the VMware Web site:


Disk Modes: Persistent, Nonpersistent and Undoable
In the VMware Workstation configuration menu (fig. 1) disks can be configured in one of three modes: Persistent, Nonpersistent, and Undoable.


click for full-size image
Figure 1. Configuration Editor showing an IDE hard disk configured as undoable

Disk modes determine how changes are saved to the disk. Raw, virtual and plain disks can use any available mode. For example, a user could have an undoable raw disk, an undoable virtual disk, or an undoable plain disk.

Persistent
Persistent disks are the simplest type of disks that VMware Workstation supports. Persistent disks behave like conventional disk drives on your computer. All writes done to a persistent disk are written out permanently to the disk. The behavior is the same for all disk types.


Nonpersistent
Changes to nonpersistent disks are not saved during the VMware Workstation session and are lost at the end of the session (that is, when the virtual machine is powered off or reset). Nonpersistent disks are convenient for people who always want to start with a virtual machine in the same state. Example uses include providing known environments for software test and technical support users as well as doing demonstrations of software. Any disk type can be used in nonpersistent mode.

VMware Workstation only reads the disk. Any writes to the disk during the session are actually written to a redo log file that is deleted at the end of the session when you power off or reset the virtual machine.

During the VMware Workstation session any blocks that have been modified and written to the redo log file are read from the redo log file instead of the disk. At the end of the VMware Workstation session the redo log file is discarded. The guest operating system is entirely unaware that the disk is nonpersistent. Normal guest operating system file buffering works on top of this mechanism, providing efficient buffered I/O. Some disk operations may even be faster to a VMware Workstation nonpersistent disk than to an actual disk.

The redo log file is placed in the same directory as the disk file by default. However, the location of the redo log file can be changed in the Configuration Editor under Misc.


Undoable
Undoable disks are similar to nonpersistent disks in that writes to the disk are logged elsewhere in a file called a redo log. An undoable disk, unlike a nonpersistent disk, gives the user the option later of permanently applying the changes saved in the redo log to the disk. Undoable disks are convenient in that errors or problems can be undone by simply discarding the redo log. Examples of uses for undoable disks include installing software or doing administration tasks that may need to be undone if there are problems.

While the VMware Workstation session is running, disk blocks that have been modified and written to the redo log are read from there instead of the disk. Any disk type can be used in undoable mode.

When you power off a VMware Workstation session with an undoable disk, you are given the option of either:

  • Committing the changes in the redo log to the disk (fig 2.)
  • Discarding the changes in the redo log
  • Saving the redo log


Figure 2. When you power off with an undoable disk, you are prompted to either commit the redo log changes, discard the changes, or keep the redo log.

If you choose to keep the redo log, you are prompted again (fig 3.) when you power on the next VMware Workstation session to see if you want to commit the redo log changes from the previous session, discard the redo log, continue appending changes to the redo log, or cancel the power on.


Figure 3. During power on, if VMware Workstation detects a redo log file it prompts you to either commit the redo log changes, discard the changes, append new changes to the redo log, or cancel the power on.

The guest operating system is entirely unaware that the disk is undoable. Normal guest operating system file buffering works on top of the redo log mechanism, providing efficient buffered I/O. Some disk operations, including file system creation, repair, and other operations may be faster on a VMware Workstation undoable disk than on an actual disk.

The redo log file is placed in the same directory as the disk file by default. However, the location of the redo log file can be changed in the Configuration Editor under Misc.


File locations
The Configuration Editor allows you to specify where the disk file is located on the file system. A disk file has a .dsk extension for virtual disks.

Plain disks have a .pln extension, and the extents of the plain disk have a .dat extension.

Log files are used to save blocks that the virtual machine modifies during a session. The log file for a nonpersistent disk is not saved at the end of a session, while the log file for an undoable disk is saved. As described above, the log file for undoable disks is called the redo log, and the user is able to decide whether the log file should be saved or not.

The log file for a virtual disk called filename is called filename.dsk.REDO and is created by default in the same directory as the .dsk file. In the case of plain disks, filename.pln.REDO is created by default in the same directory as the .pln file.

By default, log files for raw disks are located in the same directory as the virtual machine configuration file. Using the Configuration Editor, you can change the log file for nonpersistent and undoable disks using the Advanced button and specifying a different VMware Workstation Redo Log Directory.

You may choose to locate the log files in a different directory to increase available space. For best performance, the log files for a virtual machine should be local to the machine running the virtual machine.


Lock files
A running virtual machine tries to create lock files to prevent consistency problems on disks. If the virtual machine didn't 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 .dsk or .pln file. There are two types of lock files: reader and writer. A nonpersistent disk will be protected by reader lock files, while persistent and undoable disks 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 will remove lock files it created when the virtual machine is powered off. If it cannot remove the lock, a stale lock file will be left protecting the .dsk or .pln file. For example, if the machine crashes before the virtual machine has a chance to remove its lock file, there will be a stale lock.

If a stale lock file remains when the virtual machine is started again, the virtual machine will try 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 are not true, a dialog will be shown explaining what the user 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.

[an error occurred while processing this directive]