CTX117960
XenServer
XenServer 6_2_0,XenServer 6_1_0,XenServer 6_0
Configuration
2016-04-15
2014-08-04
This article describes how to configure the virtual CPU management.

Objective

This article describes how to set the virtual CPU management of Virtual Machines (VM)?? running on a Citrix XenServer.

Background

In the default setup of XenServer, physical CPU resources are split between VMs using a fair-share balancing algorithm. This ensures all the VMs get their share of the system’s CPU resources. XenServer has a CPU load balancing scheduler that automatically moves the VMs CPUs between physical CPU cores to provide the best performance for all VMs. In some situations, it might be necessary to modify the default setup to grant?? VM more or less resources to optimize the use of processors.

XenServer enumerates physical CPUs in a depth-first manner. For a system with both hyperthreading and multiple cores, this would be all the hyperthreads on a given core, then all the cores on a given socket, and then all sockets.

For example: On a two socket, dual-core, hyper threaded Xeon, the CPU orders is as follows:

socket0

socket1

core0

core1

core0

core1

ht0

ht1

ht0

ht1

ht0

ht1

ht0

ht1

#0

#1

#2

#3

#4

#5

#6

#7


Instructions

The following section describes the procedure to modify the default setup with sample commands:

  1. The virtual CPU (vCPU) behaviour can be modified by altering the vCPUs-params parameter of a VM. vCPU pinning is the term for mapping vCPUs of a VM to specific physical resources. Run the following command to tune a vCPU's pinning:
    [root@xenserver ~]# xe vm-param-set uuid=<VM UUID> VCPUs-params:mask=1,3,7
    The VM in the preceding example runs on physical CPUs 1, 3, and 7 only.

  2. The VCPU priority weight parameters can also be modified to grant a specific VM more CPU time than others. Run the following command:
    [root@xenserver ~]# xe vm-param-set uuid=<VM UUID> VCPUs-params:weight=512
    The VM in the preceding example with a weight of 512 gets twice as much CPU as a domain with a weight of 256 on a busy XenServer Host where all CPU resources are in use.
    Valid weights range is from 1 to 65535 and the default is 256.

  3. The CPU cap optionally fixes the maximum amount of CPU a VM can use. Run the following command:
    [root@xenserver ~]# xe vm-param-set uuid=<VM UUID> VCPUs-params:cap=80
    The VM in the preceding example with a cap of 80 is able to use only 80 per cent of one physical CPU even if the XenServer Host has idle CPU cycles.
    The cap is expressed in percentage of one physical CPU: 100 is one physical CPU, 50 is half a CPU, 400 is 4 CPUs, and so on. The default, 0 (zero), indicates there is no upper cap.

  4. After making the changes, reboot XenServer for the settings to be updated on the XenServer.

Note: The cap parameter limits the amount of CPU that a guest can use and is normally used by cloud providers and for performance testing. Setting this parameter erroneously can cause CPU starvation on the guest. Using weights is the recommended solution for prioritizing VM CPU access.


 

Join the conversation

Citrix Discussions

Open a case

Citrix Support

特别说明


本文来源为Citrix.com所有,翻译后版权归翻译者所有.如需转载请注明出处.

文档版本


.

广告招租


最新留言


.

广告招租


.