Compartilhar via


Creating virtual hard disks in Virtual Server

Creating virtual hard disks

You can use a virtual hard disk to run the virtual machine's operating system (the guest operating system) and to save data. The guest operating system treats the virtual hard disk as if it were a physical hard disk. When you create a virtual hard disk it is empty, and it is saved as a .vhd file. The following table describes the different types of virtual hard disks you can create.

Type of virtual hard disk Description

Dynamically expanding

The size of the virtual hard disk expands as data is written to it. The initial size is typically less than 100 KB, but as data is added the disk size will expand until it reaches the limit you specified when the disk was created. (When you create a new virtual machine, this is the type of disk that gets created by default.) Virtual Server 2005 will monitor the available hard disk space on the physical computer and notify you if the dynamically expanding disk starts to approach the limits of available space on the physical computer.

Fixed-size

The size of the virtual hard disk is fixed to the size you specify when you create the disk. The initial size and the limit are equal; when you create the disk, it immediately uses the amount of space you specify. For example, if you create a 10-gigabyte (GB) fixed-size virtual hard disk, it will immediately use 10 GB of space.

Note

Consider the amount of storage you need on the disk before you allocate the disk space. The size of a fixed-size virtual hard disk cannot be changed after you create it.

Differencing

On the Differencing Virtual Hard Disk page, the option to create a differencing virtual hard disk. Differencing disks enable you to have multiple operating system configurations that are based on a single operating system installation. This allows you to perform tests with several minor variations of the same operating system without consuming a large amount of disk space.

A differencing virtual hard disk is a virtual hard disk associated with another virtual hard disk in a parent-child relationship. The differencing disk is the child and the associated virtual disk is the parent. The parent disk can be any type of virtual hard disk. The differencing disk (the child) stores a record of all changes made to the parent disk and provides a way to save changes without altering the parent disk. In other words, by using differencing disks you ensure that changes are made by default to the differencing disks and not to the original virtual hard disk. You can, however, elect to merge changes from the differencing disk to the original virtual hard disk when it is appropriate to do so.

The differencing hard disk expands dynamically as data intended for the parent disk is actually written to the differencing disk.

We recommend that you write-protect or lock the parent disk. Otherwise, if the parent disk is modified by some other process that does not recognize the parent/child relationship of the differencing disk, all differencing disks related to the parent disk become invalid, and any data written to them is lost. By locking the parent disk, you can mount the disk on more than one virtual machine, similar to a read-only floppy disk or CD-ROM.

The following figure illustrates an example of the use of differencing disks. The parent virtual hard disk has a Microsoft Windows 2000 Server operating system installed on it. Each child disk includes Microsoft Windows 2000 Professional, identical to the parent, and is then customized with a specific version of Microsoft Internet Explorer.

One parent disk with multiple differencing disks

Linked

Virtual Server supports linking a virtual hard disk to a physical hard disk on the physical computer. This virtual hard disk can have multiple volumes. The virtual hard disk is created with the actual boot partition and partition map from the drive on the physical computer. All read and write requests are forwarded directly to the linked physical hard disk.

Linked disks are intended for converting a physical disk to a virtual hard disk. You cannot use a linked disk as a startup disk. Virtual machines will not be able to start with linked disks attached. If you turn on a virtual machine with a linked disk attached, the virtual machine will turn itself back off and write an event to the event log.

For more information about converting physical disks, see Copying a physical disk to a virtual hard disk.

Linking to a physical hard disk requires the following:

  • You must be an administrator or a member of the Administrators group to create or use a link to a physical hard disk.
  • The physical disk must be a basic disk; it cannot be a dynamic disk.

Warning

Unlike the other virtual hard disk types, which permit only the virtual machine to write to the specified virtual hard disk files, a virtual hard disk linked to a physical hard disk allows the guest operating system to directly modify the contents of the linked physical hard disk. This means that the guest operating system can overwrite the contents of the linked physical hard disk and can potentially corrupt the host operating system and other programs and data of the linked physical hard disk.

Important

You cannot write to a linked physical hard disk that has 100 MB or less of available storage space. If you attempt to do so, you will receive an error message. Correct the problem by moving or deleting files on the physical drive to create more storage space.

To use a virtual hard disk on a SCSI bus, you must first add the SCSI adapter to the virtual machine, and then select one of the SCSI channels when configuring the virtual hard disk.

For more information about virtual hard disks, see Managing Virtual Hard Disks and Set Up Virtual Disks.

Disk usage considerations

The following table shows the advantages and disadvantages of each type of virtual hard disk.

Disk type Advantages Disadvantages

Dynamically expanding

Dynamically expanding virtual hard disks require less space when initially created.

You must monitor the size of dynamically expanding virtual hard disks in order to avoid running out of disk space. If the size gets too large, other virtual machines that have a virtual hard disk on the same volume can be affected.

Fixed-size

Because the physical disk space is allocated when the virtual hard disk is created, you have immediate feedback as to your disk requirements.

Fixed-size hard disks can consume a lot of disk space unnecessarily.

Linked

Linked disks provide a way to convert a physical data disk to a virtual hard disk.

  • You cannot start a virtual machine with a linked disk attached.
  • A linked disk can only be used to convert a physical data disk to a virtual hard disk.