Configure Memory and Processors

Applies To: Windows Server 2008 R2

When you create a virtual machine, you configure the memory and processor to provide the appropriate computing resources for the workload you plan to run on the virtual machine. This workload consists of the guest operating system and all applications and services that will run at the same time on the virtual machine.

If you need to adjust the computing resources of a virtual machine, you can reconfigure the resources to meet the changing needs. You can also specify resource controls to automate how resources are allocated to virtual machines.

Configure memory or processors for a virtual machine

A virtual machine needs enough memory allocated to it to run the workload. However, each virtual machine consumes memory only when it is running or paused. For more information about determining memory allocation, see “Performance Tuning for Virtualization Servers” in the Performance Tuning Guidelines for Windows Server 2008 (http://go.microsoft.com/fwlink/?LinkID=135682).

The number of virtual processors you should configure depends on the guest operating system. For more information about determining the appropriate memory and processors for the guest operating system that will run on the virtual machine, see About Virtual Machines and Guest Operating Systems (http://go.microsoft.com/fwlink/?LinkID=128037).

Hyper-V provides processor compatibility settings to make it easier to use an older operating system and to make it easier to perform a live migration of a virtual machine to another physical computer with a different processor version. The following considerations apply to the migration scenario:

  • The Migrate to a physical computer with a different processor version setting ensures that the virtual machine uses only the features of the processor that are available on all versions of a virtualization-capable processor by the same processor manufacturer. It does not provide compatibility between different processor manufacturers.

  • The setting is useful for high availability and backup and recovery scenarios because it makes it easier to move a highly available virtual machine to another node in a cluster or restore the virtual machine to different hardware.

noteNote
If the physical computer has multiple processors and uses non-uniform memory architecture (NUMA), we recommend that you do not assign more processors or memory to a virtual machine than are available on a single NUMA node. For example, do not assign 4 processors to a virtual machine if each NUMA node has only two processors. For more information about the processor architecture of the physical computer, see the documentation that came with the computer.

To configure memory or processors for a virtual machine
  1. Open Hyper-V Manager. Click Start, point to Administrative Tools, and then click Hyper-V Manager.

  2. In the results pane, under Virtual Machines, select the virtual machine that you want to configure.

  3. In the Action pane, under the virtual machine name, click Settings. Then, in the navigation pane, click the appropriate hardware setting as described in the following steps.

  4. To configure the memory, click Memory. On the Memory page, specify the new amount of memory.

  5. To configure the processor, click Processor. If multiple processors are supported by the guest operating system, specify the number of processors to assign to the virtual machine. Then click OK.

Configure resource allocation for a virtual machine

Resource controls provide you with several ways to control the way that Hyper-V allocates resources to virtual machines. The following is a brief description of each control. For more information about the controls, see “Weights and Reserves” in the Performance Tuning Guidelines for Windows Server 2008 (http://go.microsoft.com/fwlink/?LinkID=135682).

  • Virtual machine reserve. Of the processor resources available to a virtual machine, specifies the percentage that is reserved for the virtual machine. This setting guarantees that the percentage you specify will be available to the virtual machine. This setting can also affect how many virtual machines you can run at one time.

  • Virtual machine limit. Of the processor resources available to a virtual machine, specifies the maximum percentage that can be used by the virtual machine. This setting applies regardless of whether other virtual machines are running.

  • Relative weight. Specifies how Hyper-V allocates resources to this virtual machine when more than one virtual machine is running and the virtual machines compete for resources.

To configure resource allocation for a virtual machine
  1. Open Hyper-V Manager. Click Start, point to Administrative Tools, and then click Hyper-V Manager.

  2. In the results pane, under Virtual Machines, select the virtual machine that you want to configure.

  3. In the Action pane, under the virtual machine name, click Settings.

  4. In the navigation pane, click Processor.

  5. Under Resource control, specify the amount for each control you want to use. Then click OK.

Additional considerations

  • By default, membership in the local Administrators group, or equivalent, is the minimum required to complete this procedure. However, an administrator can use Authorization Manager to modify the authorization policy so that a user or group of users can complete this procedure. For more information, see Using Authorization Manager for Hyper-V Security (http://go.microsoft.com/fwlink/?LinkId=142886).

  • The virtual machine must be turned off before you can modify the memory or processor settings.

Additional references

Tags :


Community Content

Thomas Lee
My understanding on relative weight
As I understand it, the relative weight assigned is the amount of cpu this vm gets relative to the others. A given VM's percentage of the resource is its weight divided by the sum of all the weights. <br /><br />In the first case above, with 3 VMs with weights 50, 75, 100 respectively, then the first vm gets 50/225, the second 75/225 and the third 100/225 (i.e. 22.2%, 33.3% and the third 44.4%).<br /><br />
Tags :

The Evil Overlord
Relative Weight Explained (in a way that makes sense)
If, everything else being equal, the virtual machine with a larger relative weight will have more of the host's available CPU cycles allocated to it.<br /><br />Think of it as a 'reverse priority' scale. When a manager asks you to prioritize your to-do list, you give your highest priority task a value of one (1), your second most important task a value of two (2) and so on. But Hyper-V's relative weights work backwards of your to-do list. If you have three pre-existing VMs with relative weights of 50, 75, &amp; 100 and you create another VM that should always have a larger slice of the host's available CPU cycles, set the new VM's relative weight to 125. You don't <u>have</u> to reorganize the other three weights.<br /><br />What remains to be explained is how the time slicing actually takes place. If you have only two VM's with respective relative weights of 100 and 200 (and they both run pegged at 100% CPU utilization for the purpose of this argument), will the 200 weight VM consume two thirds of the Host's CPU cycles while the 100 weight VM consumes one third?
Tags : contentbug

Page view tracker