By default, Virtual Server will treat all virtual machines (VMs) with equal priority. In production environments, however, some VMs are more important than others. You will want to let Virtual Server know which VMs should get preference.
Virtual Server offers two main methods for managing CPU utilization per VM. To access the settings, click on "Resource Allocation" in the Virtual Server section of the Administration Web site. Figure 1 provides a view of the default resource allocations for VMs.
The initial display might seem simple enough, but there's a lot of potential power here. Let's look at the two main ways in which you can configure CPU settings.
Weight-based resource allocation
The simplest way to assign priorities to your VMs is to assign "weights" to them. When doling out CPU resources, Virtual Server will give preference to each VM based on its relative weight setting. The values can range from 1 (the lowest priority) to 10,000 (highest priority).
By default, all VMs will have a relative weight setting of 100. Since the values are relative, you can set up your own conventions, such as using only values in the range of 1 to 10 or 1 to 100. For example, if you want an important VM to have twice the priority of the others, you can set it to a weight of 200 (assuming that the other VMs are using the default weight of 100).
The preferences will kick in whenever CPU resources are limited. Weight-based resource allocation is the quickest and easiest way to prioritize your workloads while ensuring that all CPU resources are still available for use.
Constraint-based resource allocation
In some cases, you'll want more granular control over how CPU resources are managed. That's where constraint-based resource allocation comes in. This method is a bit more complicated (and you can make CPU resources unavailable if you don't understand the settings). But it can be very useful in production environments. You can specify two constraint types as percentages:
Reserved Capacity: This setting tells Virtual Server to reserve a certain amount of CPU time for a VM, whether or not it is actually using it. Because it's difficult to predict when an important VM will need resources, you can use this setting to ensure that one or more VMs will never be left waiting for CPU time.
Keep in mind that you can adversely impact other VMs running on the same machine, since the reserved capacity won't be available to other VMs.
Maximum Capacity: A potential problem when running multiple VMs is that one VM could monopolize CPU time and adversely affect all of the other VMs on the system. The maximum capacity setting specifics an upper limit to the amount of CPU time that a VM may use.
Again, keep in mind the potential for wasted cycles. Even if no other VMs are competing for resources, the amount of CPU power that can be accessed by the VM will be limited. This option is also helpful if you have other applications or services running on the host system and you want to ensure that Virtual Server doesn't dominate the machine.
By default, the reserved capacity is set to 0%, and the maximum capacity at 100% for all VMs. This effectively disables constraint-based resource allocation. Both settings can be defined as either a percentage of one CPU, or a percentage of all CPU resources on the system
The Administration Web site automatically calculates the amount of resources left to allocate and shows the current CPU utilization per VM. Figure 2 shows an example of configured values.
Figure 2: Enabling constraint-based resource allocation
One other helpful feature: Resource allocation settings can be changed dynamically while VMs are running. That can help troubleshoot problems with, for example, a VM that is hanging and trying to use all of the available CPU time.
Controlling virtualization mindshare
As you can see, you can tune Virtual Server's CPU resource referee in several ways. By letting Virtual Server know the relative importance of your VMs, you can help the virtualization layer make better decisions about how to ration resources.
Next on our hit-list for performance optimization will be managing virtual hard disks.