[an error occurred while processing this directive] [an error occurred while processing this directive]
VMware

VMware Workstation 3.2

Features | Documentation | Knowledge Base | Discussion Forums

previous Prev   Contents   Last   Next next

Configuring Hard Disk Storage in a Virtual Machine

Configuring Hard Disk Storage in a Virtual Machine

Like a physical computer, a VMware Workstation virtual machine stores its operating system, programs and data files on one or more hard disks. Unlike a physical computer, VMware Workstation gives you options for undoing changes to the virtual machine's hard disk.

The New Virtual Machine Wizard (on Windows hosts) or Configuration Wizard (on Linux hosts) creates a virtual machine with one disk drive. You can use the Configuration Editor (Settings > Configuration Editor) to add more disk drives to your virtual machine, to remove disk drives from your virtual machine or to change certain settings for the existing disk drives.

This section describes the choices you can make in setting up hard disk storage for your virtual machine.

Disk Types: Virtual and Raw

Disk Types: Virtual and Raw

In the most common configurations, VMware Workstation creates virtual hard disks, which are made up of files that are typically stored on your host computer's hard disk. In some circumstances, you may need to give your virtual machine direct access to a physical hard drive on your host computer - using the disk type known as a raw disk.

Virtual Disk

Virtual Disk

A virtual disk is a file or set of files that appears as a physical disk drive to a guest operating system. The files 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 virtual disk without repartitioning a physical disk or rebooting the host.

IDE virtual disks can be as large as 128GB. SCSI virtual disks can be as large as 256GB. VMware Workstation creates a file for each 2GB of virtual disk capacity and virtual machine overhead. The actual files used by the virtual disk start out small and grow to their maximum size as needed.

Virtual disks can be set up as IDE disks for any guest operating system. They can be set up as SCSI disks for any guest operating system that has a driver for the BusLogic SCSI adapter used in a VMware Workstation virtual machine.

Note: To use SCSI disks in a Windows XP or Windows .NET Server virtual machine, you need a special SCSI driver available from the download section of the VMware Web site at www.vmware.com/download. Follow the instructions on the Web site to use the driver with a fresh installation of Windows XP or .NET Server.

A virtual disk of either type can be stored on either type of physical hard disk. That is, the files that make up an IDE virtual disk can be stored on either an IDE hard disk or a SCSI hard disk. So can the files that make up a SCSI virtual disk. They can also be stored on other types of fast-access storage media, such as DVD-ROM or CD-ROM discs.

A key advantage of virtual disks is their portability. Because the virtual disks are stored as files on the host machine or a remote computer, you can move them easily to a new location on the same computer or to a different computer. You can also use VMware Workstation on a Windows host to create virtual disks, then move them to a Linux computer and use them under VMware Workstation for Linux - or vice versa. For information about moving virtual disks, see Moving and Sharing Virtual Machines

Note: Beginning with VMware Workstation 3.0, virtual disks are created in a new format that is not recognized by earlier VMware products. Future versions of other VMware products will support this new virtual disk format.

Raw Disk

Raw Disk

A raw disk directly accesses an existing local disk or partition. You can use raw disks if you want 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 not supported.

The most common use of a raw disk is for converting a dual-boot or multiple-boot machine so one or more of the existing operating systems can be run inside a virtual machine.

Caution: If you run an operating system natively on the host computer, the switch to running it inside a virtual machine is like pulling the hard drive out of one computer and installing it in a second computer with a different motherboard and other hardware. You need to prepare carefully for such a switch. The specific steps you need to take depend on the operating system you want to use inside the virtual machine. For details, see Configuring a Dual-Boot Computer for Use with a Virtual Machine.

You can also create a new virtual machine using a raw disk. For details, see Installing an Operating System onto a Raw Partition from a Virtual Machine. In most cases, however, it is better to use a virtual disk.

Only expert users should attempt raw disk configurations.

Plain Disk

Plain Disk

VMware Workstation 2.0 offered an experimental disk type called plain disk. In VMware Workstation 2.0, virtual disks could be no larger than 2GB. Plain disks provided a way to create larger disks for the virtual machine. VMware Workstation 3.x allows you to create large disks - up to 256GB - as virtual disks. Consequently, this version does not support creation of new plain disks.

Virtual machines with plain disks created in VMware Workstation 2.0 do run under VMware Workstation 3.x.

Disk Modes: Persistent, Undoable and Nonpersistent

Disk Modes: Persistent, Undoable and Nonpersistent

You can use the Configuration Editor (Settings > Configuration Editor) to configure disks in one of three modes: persistent, undoable and nonpersistent.

The Configuration Editor on a Windows host shows an IDE virtual disk configured as undoable

The Configuration Editor on a Linux host shows installation of an IDE virtual disk configured as persistent

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 in persistent mode are the simplest to use. Disks in persistent mode behave like conventional disk drives on your physical computer. All data written to a disk in persistent mode are written out permanently to the disk. The behavior is the same for all disk types.

Undoable

Undoable

Undoable mode lets you decide when you power off the virtual machine whether you want to keep or discard the changes made since the virtual machine was powered on. This is especially useful for experimenting with new configurations or unfamiliar software. Because of the disaster-recovery possibilities this mode offers, many users prefer to set disks in undoable mode as a standard part of their configurations.

When data is written to an undoable mode disk, the changes are stored in a file called a redo log. A disk in undoable mode gives you the option later of permanently applying the changes saved in the redo log, so they become part of the main disk files.

While the virtual machine is running, disk blocks that have been modified and written to the redo log are read from there instead of from the disk files.

Any disk type can be used in undoable mode.

When you power off a virtual machine with a disk in undoable mode, you are given three options:

  • Commit the changes in the redo log to the disk
  • Discard the changes in the redo log
  • Keep the redo log

If you choose to keep the redo log, the next time you power on the virtual machine VMware Workstation detects the redo-log file and prompts you to either commit the redo log changes made from the last time the virtual machine ran, discard the redo log, continue appending changes to the redo log or cancel the power on.

The redo-log file is placed in the same folder (directory) as the disk file by default. However, you can change the location of the redo-log file in the Configuration Editor.

On a Windows host, click the Options tab, then type in or browse to the folder in which the redo log should be stored.

On a Linux host, click Misc on the left side of the Configuration Editor, then type in or choose the directory in which the redo log should be stored.

Nonpersistent

Nonpersistent

Changes to disks in nonpersistent mode are not saved to the disks, but are lost when the virtual machine is powered off or reset.

Nonpersistent mode is 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.

If your virtual disks are in nonpersistent mode, you can take advantage of the repeatable resume feature, which allows you to save the current state of the virtual machine when you suspend it, then resume from the point at which you suspended it every time you start the virtual machine. For more information, see Resuming Virtual Machines Repeatedly from the Same Point.

VMware Workstation only reads the virtual disk file. Any writes to the virtual disk are actually written to a redo-log file that is deleted when you power off or reset the virtual machine. This is similar to the redo-log files used with disks in undoable mode.

While you are running the virtual machine, any blocks that have been modified and written to the redo-log file are read from the redo-log file instead of the disk files. When the virtual machine is powered off or reset, the redo-log file is discarded.

The redo-log file is placed by default in the folder defined by the host operating system's TMPDIR environment variable. However, the location of the redo-log file can be changed in the Configuration Editor.

On a Windows host, click the Options tab, then type in or browse to the folder in which the redo log should be stored.

On a Linux host, click Misc on the left side of the Configuration Editor, then type in or choose the directory in which the redo log should be stored.

File Locations

File Locations

Disk Files

Disk Files

The Configuration Editor (Settings > Configuration Editor) 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 (on a Windows host) or Configuration Wizard (on a Linux host) 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 comprises one or more .vmdk files. The larger the size of the virtual disk, the more .vmdk files. As data is added to a virtual disk, the .vmdk files grow in size, to a maximum of 2GB each. Almost all of a .vmdk file's content is the virtual machine's data, with a small portion allotted to virtual machine overhead.

If the virtual disk needs 2GB or more disk space, the Configuration Editor shows the name of the first file in the set of files used to store the virtual disk. The other files used for that disk are automatically given names based on the first file's name. For example, a Windows Me virtual machine that needed two files to store its virtual disk would, by default, store it in files named Windows Me.vmdk and
Windows Me-02.vmdk.

If your virtual machine uses files created under earlier VMware products, with a .dsk extension, they can be updated automatically. For details, see Updating Filenames for Virtual Disks Created with Earlier VMware Products.

If you are using a raw disk, a file with the extension .raw stores information about the physical disk or partition used by the virtual machine.

The files for plain disks have a special format. The file that stores information about the plain disk has a .pln extension and the files used to store the plain disk's data have a .dat extension.

Redo-Log Files

Redo-Log Files

Log files save blocks that the virtual machine modifies while the it is running. The log file for a disk in nonpersistent mode is not saved when the virtual machine is powered off or reset, while the log file for a disk in undoable mode is saved. The log file for disks in undoable mode is called the redo log, and the user decides whether the redo-log file should be saved or not.

The redo-log file for a virtual disk called vm is called vm.vmdk.REDO. If the virtual disk is larger than 2GB, it is divided into sets of 2GB disk files 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.

You can choose the location where these redo logs are stored. By default, the redo logs for disks in undoable mode are stored in the same directory as the .vmdk file that contains the virtual machine configuration. Redo logs for disks in nonpersistent mode are stored in your host's temp directory by default. In the case of plain disks, filename.pln.REDO is created by default in the same directory as the .pln file.

By default, redo-log files for raw disks are located in the same directory as the virtual machine configuration file.

You can change the location of the log file for disks in nonpersistent and undoable modes in the Configuration Editor.

On a Windows host, click the Options tab, then type in or browse to the folder in which the redo log should be stored.

On a Linux host, click Misc on the left side of the Configuration Editor, then type in or choose the directory in which the redo log should be stored.

You may choose to locate the log 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 hard drive on the host computer.

Lock Files

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 users to lose data.

Lock files are always created in the same folder (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 data storage files of a plain disk are individually locked, using the same method.

Note: The locking methods used by VMware Workstation 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.

When a virtual machine is powered off, it removes lock files it created. 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 is a stale lock.

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 explaining what the user can do about the lock.

Raw 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 raw disk for a virtual machine not be installed on the same physical disk as the host operating system.

Updating Filenames for Virtual Disks Created with Earlier VMware Products

Updating Filenames for Virtual Disks Created with Earlier VMware Products

Except for VMware Workstation 3.0 and 3.1, previous VMware products, including VMware Workstation 2.0, named virtual disk files with a .dsk extension. To avoid conflicts with the System Restore feature on Windows XP and Windows .NET Server hosts, VMware Workstation now uses a .vmdk extension for those files. VMware Workstation 3.2 updates existing virtual disk files automatically. It also automatically updates references to the virtual disk files in the configuration files for the virtual machine.

In addition, VMware Workstation converts the filename extensions for the files that store the state of a suspended virtual machine. The old extension was .std. The new extensions is .vmss.

If your host computer is running Windows XP or Windows .NET Server, VMware Workstation must turn off System Restore on the host computer while it runs the updater. If this were not done and you restored the host to a time before you ran the updater, the System Restore feature would rename your virtual disk files to use the.dsk extension. You would again have the conflict the updater was designed to solve.

Note: Because the VMware Workstation updater turns off the System Restore feature while it runs, all existing restore points are deleted.

System Restore is turned back on after the updater completes its work.

Running the Updater at a Later Time

Running the Updater at a Later Time

On a Windows host computer, you can run the filename updater at any time. To do so, follow these steps.

  1. Open a command prompt.

  2. Change to the folder in which the VMware Workstation program files are installed. If you installed the files in the default locations, use this command.

    cd C:\Program Files\VMware\VMware Workstation\Programs

  3. Run the updater.

    dskrename.exe

Defragmenting and Shrinking Virtual Disks

Defragmenting and Shrinking Virtual Disks

When a virtual machine is powered off, you can defragment its virtual disks from the Configuration Editor (Settings > Configuration Editor).

Select the virtual disk you want to defragment, then click Defragment.

Defragmenting disks may take considerable time.

When a virtual machine is powered on, you can shrink its virtual disks from the VMware Tools control panel.

  1. To launch the control panel in a Windows guest, double-click the VMware Tools icon in the system tray or choose Start > Settings > Control Panel, then double-click VMware Tools.

    To launch the control panel in a Linux or FreeBSD guest, become root (su), then run vmware-toolbox.

  2. Click the Shrink tab.

  3. Select the virtual disks you want to shrink, then click Prepare to Shrink.

The shrink tool reclaims unused space in the virtual disk. If there is empty space in the disk, this process reduces the amount of space the virtual disk occupies on the host drive.

Shrinking disks may take considerable time

Note: VMware recommends you defragment your VMware Workstation host's hard drive after 10 shrink operations on a virtual disk. .

previous Prev   Contents   Last   Next next