2. Machine Settings
After you’ve created the VM
for your SBS server, you should make some changes to the machine
settings that the New Virtual Machine Wizard has configured. To adjust
the settings of a VM, select the VM in the center Virtual Machines pane
of Hyper-V Manager, and click Settings on the Action menu to open the
Settings dialog box for the VM, as shown in Figure 6.
The settings page of a VM allows
you to control the virtual hardware available to that VM. The settings
that can be changed on a VM include
Add Hardware Add a SCSI Controller, network adapter, or legacy network adapter.
BIOS Change the boot order and Numlock state.
Memory Set the amount of memory assigned to the VM. SBS VMs are limited to 32 GB of RAM, just as they are on physical hardware.
Processor Set the number of logical processors
assigned to the VM. This is limited to the number of logical processors
available on the host computer or four logical processors, whichever is
less. For SBS 2011, assign at least two logical processors, and four is
preferred.
IDE Controllers 0, 1 Set the drives connected to each IDE controller. Both Hard Disk and DVD Drive types are supported on IDE controllers.
SCSI Controller(s) Set the drives connected to the synthetic SCSI
controller. Each SCSI controller is assigned to SCSI ID7 and can
support up to six virtual SCSI drives. SCSI drives cannot be used as
boot drives and are not available until integration components are
installed. Even if your physical drives are SCSI or SAS, do not choose SCSI here for your boot disk. That must always be IDE.
Network Adapters
Set the network, Mac type, and VLAN connections of the synthetic
network adapters. SBS 2011 supports only a single network adapter, and
you should choose a synthetic network adapter (the default).
Legacy Network Adapters Set the network, Mac type, and VLAN connections of the legacy network adapters. Each VM is limited to a maximum of four legacy network adapters. Avoid these if at all possible—they’re slow.
COM 1, COM 2
Set the named pipe used to communicate with the physical host computer.
This setting is essentially useless for most things in the SBS
environment.
Diskette Drive Set the virtual floppy drive (.vfd)
that is connected to the virtual floppy drive. No pass-through to the
physical floppy drive on the host (parent) computer is supported. Use
VFDs for SBS Answer Files to automate deployment.
2.1. Memory and CPU
Hyper-V supports a maximum of four processors
and 64 GB of RAM per VM. On host computers with fewer than four
processors, you’ll be limited to the number of logical processors on the
host itself. And you need to be careful to not over-specify the RAM for
VMs on a physical computer. You need to leave at least 500 Mb of RAM
for the host partition, plus a bit (less than 100 Mb) per running VM.
Windows Server 2008 R2 Service Pack 1 (SP1) and Microsoft Hyper-V Server 2008 R2 SP1 support dynamic memory
for Hyper-V virtual machines. Dynamic memory allows you to allocate a
minimum amount of memory to supported virtual machines, but also set a
maximum amount of memory. The Hyper-V host can now dynamically assign
memory to virtual machines based on the dynamic memory needs of the
virtual machines and their overall memory weighting as set by the
administrator. This dramatically enhances your ability to effectively
use the resources of the Hyper-V host to support the maximum number of
virtual machines without performance degradation.
When you configure the settings on a virtual machine, you enable dynamic memory for that machine and you set a Startup RAM and a Maximum RAM, along with a memory buffer percentage, and the memory weight of the virtual machine, as shown in Figure 6-14.
The Hyper-V host first attempts to start all the virtual machines that
are scheduled to start by allocating the Startup RAM specified to each VM.
Once that RAM has been allocated, it looks at the buffer specified for
each virtual machine and, if it can, reserves the full buffer to each
virtual machine. If it is unable to assign each virtual machine the full
buffer specified, it then uses a combination of the weighting of the
memory for the virtual machines and the memory pressure of the virtual
machines to allocate the available memory resources as effectively as
possible. As the memory pressure from each virtual machine changes
dynamically over time, the Hyper-V host will be allocated more or less
RAM depending on the settings of the VMs on the host and the available
RAM resources.
To use dynamic memory, your
Hyper-V host must be running SP1 and your guest operating systems must
be supported. For SBS networks, this means you must install Windows
Server 2008 R2 SP1 on the Premium Add-on server if you have one, and upgrade the integration components on the virtual machine. Dynamic
memory allocation is not supported for the main SBS server. Additional
virtual machines running Windows Server 2003, Windows Server 2008,
Windows Vista (Enterprise or Ultimate), or Windows 7 (Enterprise or
Ultimate) are also able to take advantage of dynamic memory if they have
been upgraded to the latest service pack.
|
2.2. Disks and Controllers
Hyper-V uses a pair of synthetic IDE controllers for hard disks and DVD drives by default. You must use an IDE for the boot hard disk—the synthetic SCSI controller won’t have drivers available in the operating system until after the integration components are installed.
If you’re familiar with the IDE
controller in Virtual Server 2005, you’ll know that it was slow and
only supported hard disks up to 127 GB. We quickly learned to use
Virtual Server’s SCSI controller and floppy disk to load the drivers
during installation, greatly speeding up the process. But that
workaround is no longer necessary and won’t work with the Hyper-V SCSI
controller. The new IDE controller in Hyper-V has full LBA-48 support,
and it’s much faster than the old Virtual Server one.
In Windows Server 2008 R2 Hyper-V, all virtual machines include a SCSI controller by default. You can add additional SCSI
controllers if necessary. You should use a SCSI disk type for any
additional data disks you assign to the SBS VM. Windows Server 2008 R2
supports hot add and remove of SCSI hard disks to running VMs.
Hyper-V supports three virtual disk types—dynamically expanding disks, fixed-sized disks, and differencing disks.
Dynamically expanding disks are created with a maximum size, and this is the size that the operating system of the VM
sees. But the actual .vhd file of the disk takes up only as much space
on your physical hard disk or array as absolutely required for the
current contents of the VM drive. As the VM requires more storage space,
Hyper-V automatically grows the .vhd file. This is very efficient,
allowing you to add hard disk space only as absolutely required. But it
does result in a slight performance hit every time the disk needs to
grow, and more important, the .vhd file tends to become somewhat
fragmented over time, also impacting performance. Nonetheless, we almost
always use this type of disk for our nonproduction VMs. But not for the main SBS VM.
A fixed-size
disk is also a .vhd file, but with a fixed-size .vhd file, the .vhd
file is created at the full size on disk that it needs to be. It takes a
significant amount of time to create the .vhd file, but it will be
created as a contiguous file (or as contiguous as the underlying
fragmentation of your physical disk or array allows).
A differencing disk is an interesting disk type. It is like a dynamic
disk in that it gets only as large as it needs to. But a differencing
disk is a great way to combine the disk space requirements of multiple
VMs. You create the original “base” VM, and then mark the disks as
read-only. You can actually delete the VM that created the base disks.
Then you create one or more VMs that have the same operating system, and
you create them with one or more differencing
disks. The differencing disk points to the original base .vhd file, and
the only thing that gets saved to the differencing disk is any change
from the base VM. This allows multiple VMs to share the same base,
simplifying deployment of different versions of the same base
system—very useful for quickly building test networks.
The biggest
disadvantage of differencing disks is their impact on speed. As more VMs
point back to the original VHD files, the access to that VHD can be
slowed. And if anything causes a change to the original VHD, all the VMs
that point to it can be lost. Over time, the size advantage of
differencing disks is also reduced as updates and service packs are
applied to the differenced VMs. But for a test environment? Differencing
disks can be a great speed and resource saver.
The final option is a
pass-through disk that points directly to the physical partition. This
is the fastest option, but it provides the least flexibility. You might
choose this option if you are running Microsoft SQL Server on a VM and
you have a performance-sensitive application. But even there, we tend to
avoid it if at all possible. The difference in performance compared to a
fixed-size VHD is small (on the order of 5 percent, we’re told). Spend
your money on good disk I/O subsystems and avoid pass-through disks.
|
2.3. Network Adapters
When you create a new VM,
it will automatically include a single network adapter. Unless you
choose to install the operating system from the network, it will add one
of the synthetic network adapters that are new to Hyper-V. These work
great and are definitely the preferred choice—unless you are running an
operating system that doesn’t have integration components available for
it. If that’s the case, you need to change this adapter to a legacy
network adapter. You can’t directly change the adapter type—you need to
delete the existing one and add a legacy adapter.
Because SBS 2011
includes the necessary integration components built in to the base
operating system, you should always choose a synthetic network adapter
unless you are using PXE to boot from the network.
2.4. COM and Floppy
Hyper-V automatically configures a pair of virtual COM ports (COM1 and COM2) and a virtual floppy disk drive for each VM.
But it doesn’t actually connect them to anything. To connect a COM port
to the host computer, you need to use named pipes, which are,
unfortunately, useless for faxing or anything else we might be doing
with our SBS servers. For floppy disks, you need to create a virtual
floppy disk file (.vfd). A VFD
file is an image of a floppy disk. There is no way in Hyper-V to
connect directly to any existing floppy drive on the server.