Managing VMware Server 2.0 Virtual Disks
Rather than using a physical disk drive to store the system and user files for a guest operating system, VMware Server virtual machines use files (known as virtual disks) located on the disk drives attached to the host system.
The objective of this chapter is to provide an overview of the creation, management and configuration of virtual disks.
VMware Server Virtual Disk and Device Types
Virtual disks provide the storage for guest operating system and user files. Each VMware Server virtual machine will likely have one or more virtual disks configured and during the lifecycle of a virtual machine virtual disks may be added and removed as needed. the size of a virtual disk is specified at creation time and can range from 1MB up to a maximum of 950GB).
When a virtual disk is first created (either during the virtual machine process or later) it may be configured as growable or pre-allocated. Once this decision has been made about a virtual disk, it is not possible to change this configuration option. A growable disk is initially created smaller than the specified disk size, and subsequently grows as space is needed up until the maximum specified size is reached. This has the advantage that the disk creation process is shorter and less disk space on the host is used initially. A further advantage of growable disks is that the size of the disk can be reduced at a later time using the VMware Tools Shrink Disk feature (see the chapter entitled The VMware Tools Control Panel for more details on this and other VMware Tools features). These features, however, come at the cost of reduced performance (since system resources will be needed to increase the size of the disk as additional data is written).
In the case of a pre-allocated virtual disk, the entire space required for the disk is allocated at creation time. This has the advantage that virtual disk performance is not degraded due to the need to increase the disk size as more space is needed. Disadvantages include an increased amount of time needed to create the disk (taking several hours for a 950GB virtual disk) and the inability to reduce the size of the disk at a later time.
An additional options allows virtual disks to be split amongst multiple 2GB files on the host, rather than contained in a single file. This option has little benefit unless VMware Server is hosted on a file system which limits file sizes to 2GB.
To the guest operating system running inside a virtual machine, virtual disks appear as though they are physical devices. As such, the disk can be configured to appear to the virtual machine as either an IDE or SCSI device. In the case of SCSI virtual disks, VMware uses a virtual SCSI controller which appears to the guest as either an LSI Logic or BusLogic controller. As such, guest operating system drivers may need to be installed accordingly.
VMware Server Disk Modes
VMware Server virtual disks may be configured to run either in Independent mode which provides two additional options in terms of disk configuration:
- Persistent - Data written to the disk by the guest operating system is retained when the system is powered off. This is the normal mode of operating for most virtual disks.
- Nonpersistent - Data written to the disk during a discarded after the virtual machine is powered off or reset. This is useful if the guest operating system is required to be started with a clean system each time the virtual machine is powered on, perhaps in a testing or secure environment.
Disks configured as independent are not included in snapshots.
VMware Server Virtual Disk Caching Options
The disk write caching policy for virtual disks defines the point at which new data is written to the virtual disk (as opposed to being cached in memory before being written) by the guest operating system. These settings have implications for performance, with increased performance being available at the cost of data integrity. A choice of two policy options are available:
- Optimize for safety - Data is not cached. Write operations made by the guest operating system are written immediately to the virtual disk image. Reduces risk of data loss in the event of a system failure, but results in slower disk write performance.
- Optimize for performance - Write operations performed by the guest operating system are initially cached prior to being written to the virtual disk. Provides increased write performance at the cost of increased risk of data loss on system failure.