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.
Adding a New Virtual Disk
A new virtual disk may be added to a virtual machine via the VI Web Access management interface (details of which are covered in the A Guided Tour of the VMware Server 2.0 Infrastructure Web Access Interface chapter of this book). SCSI based virtual disks may be installed on running virtual machines as long as those machines are running on VMware virtual hardware version 7 or later (the default setting when virtual machines are created in VMware Server 2.0). IDE based virtual disks or virtual machines running on older versions of the virtual hardware require that the virtual machine be powered off prior to addition of a new virtual disk.
Once logged into the VI Web Access interface, the first step in adding a new virtual disk is to select the required virtual machine from the Inventory panel. In the Commands section of the virtual machine workspace, click on the Add Hardware link to invoke the Add Hardware Wizard as illustrated in the following figure:
To add a new virtual disk, select the Hard Disk option from the list of new hardware devices to proceed to the Hard Disk page. Options are available to either create an entirely new virtual disk, or to use an existing virtual disk that may already have been created for a pre-existing virtual machine. In fact, this second option can be used to enable multiple virtual machines to share a virtual disk, although careful steps should be taken to avoid disk write conflicts (for example both guests attempting to write simultaneously to the same disk block will likely cause problems for most standard file systems).
Once a decision has been make created or re-using a virtual disk, the next wizard screen provides the option to configure the