Looks like the info you provided is for Vmware. I am running Xenserver 5.5.
How do I set affinity on Xenserver?
Main Topics
Browse All TopicsI have a quad core CPU in my server. Can I hard code (or bind) one of the four cores to a particular VM so that it's the only VM that can use it?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Check out this forum post:
http://forums.citrix.com/t
Roger's a good guy... :) You have to do the pinning of a CPU on the command line. There is no way to do it in the GUI. General thought behind this is that you should use all the resources available, and let XenServer decide how to best allocate those resources. if you REALLY want to trump those decisions, Roger details how to do it in the above forum post.
Here's another good forum post:
http://forums.citrix.com/t
and the associated doc:
http://docs.vmd.citrix.com
I really don't want to do it this way but we are force to in certain situation with Oracle licensing. Oracle's licensing model is based on # of CPU's as opposed to vCPUs'. Therefore, In order to meet the licensing terms, I need to be able to lock a VM into x number of cores.
I took a look at the post you gave. I don't have xm commands in Xenserver 5.5 Only xe commands and apparently there is NO 'vcpu-pin' command in the xe command set. Here are all of the commands for xe:
Is it called something else now?
# xe help --all
Usage: xe <command> [-s server] [-pw passwd] [-p port] [-u user] [-pwf password-file]
[command specific arguments]
To get help on a specific command: xe help <command>
Full command list
-----------------
host-backup, host-bugreport-upload, host-call-plugin
host-compute-free-memory, host-cpu-list, host-cpu-param-get
host-cpu-param-list, host-crashdump-destroy, host-crashdump-list
host-crashdump-param-get, host-crashdump-param-list
host-crashdump-upload, host-data-source-forget, host-data-source-list
host-data-source-query, host-data-source-record, host-disable
host-dmesg, host-emergency-ha-disable
host-emergency-management-
host-forget, host-get-server-certificat
host-get-system-status-cap
host-get-vms-which-prevent
host-license-add, host-license-view, host-list, host-logs-download
host-management-disable, host-management-reconfigur
host-param-clear, host-param-get, host-param-list, host-param-remove
host-param-set, host-power-on, host-reboot, host-restore
host-retrieve-wlb-evacuate
host-set-hostname-live, host-shutdown, host-shutdown-agent
host-sync-data, host-syslog-reconfigure
vm-cd-add, vm-cd-eject, vm-cd-insert, vm-cd-list, vm-cd-remove, vm-clone
vm-compute-maximum-memory,
vm-data-source-forget, vm-data-source-list, vm-data-source-query
vm-data-source-record, vm-destroy, vm-disk-add, vm-disk-list
vm-disk-remove, vm-export, vm-import, vm-install, vm-list
vm-memory-shadow-multiplie
vm-param-clear, vm-param-get, vm-param-list, vm-param-remove
vm-param-set, vm-pause, vm-reboot, vm-reset-powerstate, vm-resume
vm-retrieve-wlb-recommenda
vm-snapshot-with-quiesce, vm-start, vm-suspend, vm-uninstall, vm-unpause
vm-vcpu-hotplug, vm-vif-list
bond-create, bond-destroy, bond-list, bond-param-get, bond-param-list
cd-list, console-list, console-param-add, console-param-clear
console-param-get, console-param-list, console-param-remove
console-param-set, diagnostic-compact, diagnostic-db-log
diagnostic-db-stats, diagnostic-gc-stats, diagnostic-license-status
diagnostic-timing-stats, diagnostic-vdi-status, diagnostic-vm-status
event-wait, log-get, log-get-keys, log-reopen, log-set-output
message-create, message-list, message-param-get, message-param-list
network-create, network-destroy, network-list, network-param-add
network-param-clear, network-param-get, network-param-list
network-param-remove, network-param-set, patch-apply, patch-clean
patch-destroy, patch-list, patch-param-clear, patch-param-get
patch-param-list, patch-pool-apply, patch-precheck, patch-upload
pbd-create, pbd-destroy, pbd-list, pbd-param-add, pbd-param-clear
pbd-param-get, pbd-param-list, pbd-param-remove, pbd-param-set, pbd-plug
pbd-unplug, pif-forget, pif-introduce, pif-list, pif-param-add
pif-param-clear, pif-param-get, pif-param-list, pif-param-remove
pif-param-set, pif-plug, pif-reconfigure-ip, pif-scan, pif-unplug
pool-certificate-install, pool-certificate-list, pool-certificate-sync
pool-certificate-uninstall
pool-crl-uninstall, pool-deconfigure-wlb, pool-designate-new-master
pool-disable-external-auth
pool-emergency-reset-maste
pool-enable-external-auth
pool-ha-compute-hypothetic
pool-ha-compute-max-host-f
pool-ha-enable, pool-initialize-wlb, pool-join, pool-list
pool-param-add, pool-param-clear, pool-param-get, pool-param-list
pool-param-remove, pool-param-set, pool-recover-slaves
pool-restore-database, pool-retrieve-wlb-configur
pool-retrieve-wlb-diagnost
pool-retrieve-wlb-report, pool-send-test-post
pool-send-wlb-configuratio
session-subject-identifier
session-subject-identifier
sm-param-list, sr-create, sr-destroy, sr-forget, sr-introduce, sr-list
sr-param-add, sr-param-clear, sr-param-get, sr-param-list
sr-param-remove, sr-param-set, sr-probe, sr-scan, sr-update, subject-add
subject-list, subject-list, subject-param-clear, subject-param-get
subject-param-list, subject-remove, task-cancel, task-list
task-param-get, task-param-list, template-export, template-list
template-param-add, template-param-clear, template-param-get
template-param-list, template-param-remove, template-param-set
template-uninstall, update-upload, user-password-change, vbd-create
vbd-destroy, vbd-eject, vbd-insert, vbd-list, vbd-param-add
vbd-param-clear, vbd-param-get, vbd-param-list, vbd-param-remove
vbd-param-set, vbd-plug, vbd-unplug, vdi-clone, vdi-copy, vdi-create
vdi-destroy, vdi-forget, vdi-import, vdi-introduce, vdi-list
vdi-param-add, vdi-param-clear, vdi-param-get, vdi-param-list
vdi-param-remove, vdi-param-set, vdi-resize, vdi-snapshot, vdi-unlock
vdi-update, vif-create, vif-destroy, vif-list, vif-param-add
vif-param-clear, vif-param-get, vif-param-list, vif-param-remove
vif-param-set, vif-plug, vif-unplug, vlan-create, vlan-destroy
vlan-list, vlan-param-get, vlan-param-list
Ick. you'd think Oracle would get it's head out of its... anyway...
You have to change the parameters of the VM. First off:
xe vm-list
Find your VM in the resulting list, and remember the UUID
xe vm-param-list uuid=<uuid-from-above>
Note you can tab-complete the uuid for ease of typing. The parameter you are interested in is VCPUs-params. This is a key-value pair listing. Check Peter Bats post in Citrix thread ID 245034 as linked above for complete details, but you want to mask the CPU to a certain number of processors, like so:
xe vm-param-set uuid=<vm_uuid> VCPUs-params:mask=1,2,3,4
or whatever CPU mask is appropriate. Peter goes into detail about CPU weights and other fun stuff if you are so inclined.
Business Accounts
Answer for Membership
by: sathishchowdhryPosted on 2009-08-31 at 10:22:28ID: 25224563
yes you can
Right click VM -> Edit Settings... -> Recources -> Advanced CPU
set the CPU affinity to dedicate to the particular VM, , if you set affinity you cannot vmotion
Alternatively:
on the VM set the processor reservation to the speed of a single core. If the vm has two processors set the reservation to 2x the speed.... etc.
That should ensure that the ESX hosts always keep that processing power aside for the VM.