Compartilhar via


Virtual hard disks

Virtual hard disks

A virtual hard disk provides storage for a virtual machine. Within the virtual machine, the virtual hard disk is represented as a physical disk and is used by the virtual machine as if it were a physical disk. Technically, the virtual hard disk is a file that resides on a physical disk that the host operating system can access. On the physical disk, the virtual hard disk file is stored as a .vhd file. As a general rule, you can store a .vhd file on any type of storage device as long as the host operating system can access the storage device. If the device is available to the host operating system, it also will be available to Virtual Server 2005, and as a result, to any of the virtual machines. For example, you can use any of the following types of storage:

  • IDE drive
  • SCSI drive
  • Redundant array of independent disks (RAID)
  • Storage area network (SAN)

Note

The maximum size for a virtual hard disk is 2,040 gigabytes (GB). However, any virtual hard disk attached to the IDE controller cannot exceed 127 gigabytes (GB). To support a larger virtual hard disk size, attach the virtual hard disk to a SCSI adapter. When deciding whether to attach multiple virtual hard disks to the virtual IDE adapter or a virtual SCSI adapter, we recommend attaching to one or more SCSI adapters to improve disk input/output (I/O) performance. IDE is limited to one transaction at a time, regardless of whether the bus is physical or virtual. This means that a virtual machine with two virtual hard disks attached to the IDE adapter is limited to a single transaction for both disks. By contrast, a SCSI adapter allows for multiple simultaneous transactions, which provides better performance than disks attached to the IDE adapter.

Within a virtual machine, there is no direct access to the physical disk that stores the .vhd file which the virtual machine uses as a virtual hard disk. This means you cannot access information about the physical disk from within the virtual machine. For example, format and label information about a physical disk cannot be obtained from within a virtual machine.

About fixed-size disks

A fixed-size virtual hard disk is a .vhd file whose size is determined when the file is created. Even when the amount of data being stored on the file changes, the size of the .vhd file remains fixed. For example, if you create a fixed-size virtual hard disk of 1 GB, Virtual Server creates a 1-GB .vhd file.

The size of a fixed-size virtual hard disk does not change because all of the storage space that is available on a fixed-size virtual hard disk is reserved when the virtual hard disk is created. The file utilizes as much contiguous space as is available on the physical disk that stores the .vhd file. The reserved space is filled as needed as data is written to the disk. The space on a fixed-size disk is more likely to be contiguous than on a dynamically expanding disk, so fixed-size disks generally provide better performance. Also, the file size of a fixed-size virtual hard disk does not need to be expanded before data is written to the file, which also helps provide better performance.

About dynamically expanding disks

A dynamically expanding virtual hard disk is one in which the size of the .vhd file grows as data is written to the virtual hard disk. This is the default type of virtual hard disk created by Virtual Server.

When you create a dynamically expanding virtual hard disk, you specify a maximum file size. This size restricts how large the disk can become. However, the initial size of the .vhd file is only about 3 MB. For example, if you create a 1-GB, dynamically expanding virtual hard disk, the initial size of the .vhd file will be about 3 MB. As a virtual machine uses the virtual hard disk, the size of the .vhd file grows to accommodate the new data. The size of any dynamically expanding disk only grows; it does not shrink, even when you delete data. You may be able to reduce the size of a dynamically expanding disk by compacting it. For more information, see Compacting dynamically expanding virtual hard disks.

You could encounter a situation in which Virtual Server is unable to expand the virtual hard disk to the maximum size. This problem occurs when there is not enough free space on the physical disk that stores the .vhd file. Virtual Server monitors the free space on the physical disk. If the dynamically expanding disk starts to approach the limits of available space left on the volume on which the virtual hard disk file is stored, Virtual Server pauses the virtual machine and logs an error to the Virtual Server event log.

About linked disks

A linked virtual hard disk is a virtual hard disk that points to and uses an entire physical disk for the purpose of converting a physical disk to a virtual hard disk. A linked disk can be associated only to a drive; it cannot be associated to a volume. Because linked disks are intended only for conversion, you cannot turn on a virtual machine if a linked disk is attached to the virtual machine. For more information about the conversion process, see Copying a physical disk to a virtual hard disk.

About undo and differencing disks

Undo disks and differencing disks store all state changes to a virtual machine or virtual hard disk in a separate file. This allows you to isolate changes to a virtual machine and keep a virtual hard disk in an unchanged state. The main difference between an undo disk and a differencing disk is that undo disks apply to all virtual hard disks associated with a virtual machine, and a differencing disk applies to one virtual hard disk only.

You cannot specify a size for either type of disk. Both types of disks can be thought of as a special type of dynamically expanding disk. The size of any dynamically expanding disk only grows; it does not shrink, even when you delete data. Undo disks and differencing disks can grow as large as the parent disks to which they are associated. However, unlike dynamically expanding disks, undo disks and differencing disks cannot be compacted directly. You can update the parent disk with the changes stored in the undo or differencing disk. You can then compact the parent disk if it is a dynamically expanding disk. If the parent disk is a fixed-size disk, you can compact it by converting it to a dynamically expanding disk and then compacting the converted disk. For more information about these and other disk management tasks, see Managing Virtual Hard Disks.