Paravirt Linux CPU Hotplug

From Xen
Revision as of 08:40, 27 June 2012 by Ijc (talk | contribs) (link to ML thread, add udev reload command, format heading.)

Why does not xl vcpu-set work as expected when I try to increase the number of VCPUs?

Most likely that udev event is not handled correctly in the target domain.

To identify the problem, try to run `udevadm monitor` as root in target domain, then plug CPUs. If you can see similar output:

KERNEL[1327937839.577165] add      /devices/system/cpu/cpu1 (cpu)
UDEV  [1327937839.577368] add      /devices/system/cpu/cpu1 (cpu)
KERNEL[1327937839.577581] add      /devices/system/cpu/cpu2 (cpu)
UDEV  [1327937839.577684] add      /devices/system/cpu/cpu2 (cpu)

then CPUs are correctly added to system.

All you need to do now is write to corresponding sysfs nodes to bring those CPUs online.

To automate this process, simply create a `cpu-online.rules` under /etc/udev/rules.d in target domain and tell udev to reload its rules with udevadm control --reload-rules (or restart udevd).

Content of `cpu-online.rules`:

SUBSYSTEM=="cpu",ACTION=="add",RUN+="/bin/sh -c '[ ! -e /sys$devpath/online ] || echo 1 > /sys$devpath/online'"

If you cannot see hotplug events, probably you're hitting other limitations such as max VCPU quotation, do check against Xen configuration documents.

If you've checked every options and configurations and believe that this problem is caused by a bug, please follow instructions in Reporting_Bugs_against_Xen to submit bug report.

Background

See this mailing list thread for discussion of the rationale for this behaviour